Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: symbolic variables and complex numbers
Replies: 9   Last Post: Jun 14, 2013 9:16 AM

 Messages: [ Previous | Next ]
 Alan Weiss Posts: 1,430 Registered: 11/27/08
Re: symbolic variables and complex numbers
Posted: Jun 14, 2013 8:56 AM

On 6/14/2013 5:17 AM, Uwe Brauer wrote:
> "Torsten" wrote in message <kpeljp\$i6p\$1@newscl01ah.mathworks.com>...
>

>> > Uwe Brauer
>> imag(sin(phi)) = 0, so the result should be abs(cos(phi)).
>> You should get this result using
>> simplify(abs(cos(phi)-1/2*i*sin(phi)+1/2*i*sin(abs(phi)^2/phi))).
>> Maybe you meant z=cos(phi)+i*sin(phi) ?
>>
>> Best wishes
>> Torsten.

>
> well I meant z=cos(phi)+i*sin(phi)
> However then Matlab returns only abs(cos(phi)+i*sin(phi))
>
> That is why I thought Imag means i*sin(phi), but no (I did not check
> carefully enough the doc): for a given complex number imag returns the
> imaginary part.
> But back to my original question it seems that matlab cannot calculate
> the absolute value of a complex function symbolically.

There are two problems. The main one is that you did not assume that phi
was real. If phi is complex, then abs(cos(phi) + i*sin(phi)) is not one.

Try the following:

syms phi real
z = abs(cos(phi) + i*sin(phi))
y = simplify(z,'Steps',100)

I get the following result:

y =

1

Alan Weiss
MATLAB mathematical toolbox documentation

Date Subject Author
6/14/13 Uwe Brauer
6/14/13 Torsten
6/14/13 Uwe Brauer
6/14/13 Torsten
6/14/13 Uwe Brauer
6/14/13 Torsten
6/14/13 Uwe Brauer
6/14/13 Torsten
6/14/13 Alan Weiss
6/14/13 Uwe Brauer