symbolic evaluator over the complex field
This evalc(expr) calling sequence is used to manipulate complex-valued expressions, such as sin⁡a+I⁢b, by attempting to split such expressions into their real and imaginary parts. Whenever possible, the output from evalc is put into the canonical form expr1+I⁢expr2.
The fundamental assumption that evalc makes is that unknown variables represent real-valued quantities. Thus, for example, evalc(Re(a+I*b)) = a and evalc(Im(a+I*b)) = b. Furthermore, evalc also assumes that an unknown function of a real variable is real valued.
The assume command can be used to override these default assumptions. For example, assume(u::complex) tells evalc that u is not necessarily real. Note also that some usages of the assume command implicitly imply real and others do not. For example assume(u<1) implies u is real but assume(v^2<1) and assume(abs(v)<1) do not imply that v is real.
The evalc command maps onto sets, lists, equations and relations. The evalc command applied to a complex series will be a series with each coefficient in the above canonical form.
When evalc encounters a function whose decomposition into real and imaginary parts is unknown to it (such as f(1+I) where f is not defined), it attempts to put the arguments in the above canonical form.
The standard functions Re, Im, abs, and conjugate are recognized by evalc, and when such functions are invoked from within a call to evalc they apply the assumptions outlined above. For example, evalc(abs(a+I*b)) = sqrt(a^2+b^2).
A complex-valued expression may be represented to evalc as polar(r,theta) where r is the modulus and theta is the argument of the expression.
For a complete list of the functions initially known to evalc, see evalc/functions.
Set an assumption on v. An alternative way to set this assumption is with assume(-1<v,v<1), which implicitly assumes v is real.
Download Help Document