Re: [casper] Question about complex_addsub block

2016-10-03 Thread David MacMahon
I just went into the casper_library directory and ran "git grep -l 
complex_addsub".  I now realize that maybe the block is used by a block in a 
.slx format file which that command will not find.  So maybe it is used.  To be 
sure, one would have to use some form of the "find_system" command at the 
matlab prompt.

Dave

> On Oct 3, 2016, at 16:10, Franco Curotto  wrote:
> 
> Thanks! That's a relief, for a moment there I doubted my high school math 
> knowledge. Just out of curiosity, how do you check if a block is used by 
> another block in the library?
> 
> Franco  
> 
> On 10/03/2016 06:14 PM, David MacMahon wrote:
>> Hi, Franco,
>> 
>> I can understand your confusion!  This block is very unusual.  In all 
>> fairness, that bock does what it says it will do, but it is unclear what 
>> it’s intended purpose is.  I think it really computes "a+(b*)" and 
>> "-i(a-(b*))".
>> 
>> It does not appear to be used by any other blocks in the CASPER library.  I 
>> think this block should be removed from the library (or modified to match 
>> the expectations from its name) unless anyone can justify its continued 
>> existence in its current state.
>> 
>> Hope this helps,
>> Dave
>> 
>>> On Oct 3, 2016, at 10:44, Franco >> > wrote:
>>> 
>>> Hi
>>> 
>>> Well I feel a little bit stupid asking this, but from the addsub block:
>>> 
>>> 
>>> Adds and subtracts the complex inputs. 
>>> If a = w + ix, b = y + iz then 
>>> a+b = (w+y)/2 + i(x-z)/2 and 
>>> a-b = (x+z)/2 + i(y-w)/2
>>> 
>>> Why it does it like this? Shouldn't it be simply:
>>> 
>>> a+b = w+y + i(x+z)
>>> 
>>> a-b = w-y + i(x-z)
>>> 
>>> I could understand the division by two as a way to avoid overflow, but not 
>>> the rest of the changes.
>>> 
>>> Franco
>>> 
>> 
> 



Re: [casper] Question about complex_addsub block

2016-10-03 Thread Franco Curotto
Thanks! That's a relief, for a moment there I doubted my high school 
math knowledge. Just out of curiosity, how do you check if a block is 
used by another block in the library?


Franco


On 10/03/2016 06:14 PM, David MacMahon wrote:

Hi, Franco,

I can understand your confusion!  This block is very unusual.  In all 
fairness, that bock does what it says it will do, but it is unclear 
what it’s intended purpose is.  I think it really computes "a+(b*)" 
and "-i(a-(b*))".


It does not appear to be used by any other blocks in the CASPER 
library.  I think this block should be removed from the library (or 
modified to match the expectations from its name) unless anyone can 
justify its continued existence in its current state.


Hope this helps,
Dave

On Oct 3, 2016, at 10:44, Franco > wrote:


Hi

Well I feel a little bit stupid asking this, but from the addsub block:

Adds and subtracts the complex inputs.

If a = w + ix, b = y + iz then

a+b = (w+y)/2 + i(x-z)/2 and

a-b = (x+z)/2 + i(y-w)/2

Why it does it like this? Shouldn't it be simply:

a+b = w+y + i(x+z)

a-b = w-y + i(x-z)

I could understand the division by two as a way to avoid overflow, 
but not the rest of the changes.


Franco







Re: [casper] Question about complex_addsub block

2016-10-03 Thread David MacMahon
Hi, Franco,

I can understand your confusion!  This block is very unusual.  In all fairness, 
that bock does what it says it will do, but it is unclear what it’s intended 
purpose is.  I think it really computes "a+(b*)" and "-i(a-(b*))".

It does not appear to be used by any other blocks in the CASPER library.  I 
think this block should be removed from the library (or modified to match the 
expectations from its name) unless anyone can justify its continued existence 
in its current state.

Hope this helps,
Dave

> On Oct 3, 2016, at 10:44, Franco  wrote:
> 
> Hi
> 
> Well I feel a little bit stupid asking this, but from the addsub block:
> 
> 
> Adds and subtracts the complex inputs. 
> If a = w + ix, b = y + iz then 
> a+b = (w+y)/2 + i(x-z)/2 and 
> a-b = (x+z)/2 + i(y-w)/2
> 
> Why it does it like this? Shouldn't it be simply:
> 
> a+b = w+y + i(x+z)
> 
> a-b = w-y + i(x-z)
> 
> I could understand the division by two as a way to avoid overflow, but not 
> the rest of the changes.
> 
> Franco
> 



[casper] Question about complex_addsub block

2016-10-03 Thread Franco

Hi

Well I feel a little bit stupid asking this, but from the addsub block:

Adds and subtracts the complex inputs.

If a = w + ix, b = y + iz then

a+b = (w+y)/2 + i(x-z)/2 and

a-b = (x+z)/2 + i(y-w)/2

Why it does it like this? Shouldn't it be simply:

a+b = w+y + i(x+z)

a-b = w-y + i(x-z)

I could understand the division by two as a way to avoid overflow, but 
not the rest of the changes.


Franco



[casper] Question about complex_addsub block

2016-10-03 Thread Franco

Hi

Well I feel a little bit stupid asking this, but from the addsub block:

Adds and subtracts the complex inputs.

If a = w + ix, b = y + iz then

a+b = (w+y)/2 + i(x-z)/2 and

a-b = (x+z)/2 + i(y-w)/2

Why it does it like this? Shouldn't it be simply:

a+b = w+y + i(x+z)

a-b = w-y + i(x-z)

I could understand the division by two as a way to avoid overflow, but 
not the rest of the changes.


Franco