how to get the argument and the modulus of a analytic complex function?
11 views (last 30 days)
John D'Errico on 7 Dec 2021
Edited: John D'Errico on 7 Dec 2021
The use of mod as the name of a variable is a REALLY bad idea. Soon, when you begin using MATLAB more, you will trip over things like this, and then post a frantic question here, asking why does the mod function no longer work properly in MATLAB? (Or some similarly anxious question.) So don't use names like mod.
Your basic problem in that code, is the answer you want to get is not valid, at least if some of those parameters are not real numbers. But if we do this, restricting a,b,c to be all real valued,
syms a b c real
z = a*exp(i*b*c);
Note that the modulus is NOT simply a, but abs(a). If a were negative, then would you expect the modulus to be negative? Of course not.
And as far as the phase angle goes, it is not quite as simple as you have shown it.
Yes, I know you need not believe me. But that phase angle is a function of a also. For example, suppose a were 1 or -1?
Z1 = 1*exp(2i)
Z2 = -1*exp(2i)
So we would indeed expect two distinct phase angles for Z1 and Z2.
Your problem lies in your expectations.