Post Reply 
Unreliable complex calculation in CAS? Bug?
04-08-2020, 04:02 PM (This post was last modified: 04-08-2020 04:07 PM by victorvbc.)
Post: #6
RE: Unreliable complex calculation in CAS? Bug?
(04-08-2020 04:10 AM)Dands Wrote:  The problem is that if you're in degrees mode, the exponential form will only take arguments in radians. I say that because I tried to input 14.43∠30° as 14.43e^i30 and did not get the answer.

I probably found another good example showing why the polar capabilities in CAS need to be improved asap.

Thanks

Complex exponentials are always in radians. You have to do the conversion for radians.

The problem is the CAS doesn't support operations directly in polar notation (someone correct me if I'm wrong), which makes phasors a bit inconvenient.

Anyway, here's something that might help you with that:

Code:

#cas
phasor(mag,phase):=
BEGIN

IF HAngle=1 THEN
  phase=pi*phase/180;
END

RETURN QPI(mag)*simplify(e^(QPI(phase)*i));

END;
#end

Here I use QPI instead of exact, because I like it better. I also like to throw a simplify in there, but you can remove it if you want.

I like to put this kind of function in a user key, so that it's easily accessible by pressing shift+user+mult(angle).


Code:

KEY K_Mul()
BEGIN
RETURN "phasor()";
END;

By using this you make sure the operations with phasors in CAS are always exact. After simplifying, you can use approx() to get your answer in decimal.

   

Just be careful, if there's even a single float in your matrix operation it will default to numeric mode.

   
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Unreliable complex calculation in CAS? Bug? - victorvbc - 04-08-2020 04:02 PM



User(s) browsing this thread: 2 Guest(s)