evalc - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

evalc

symbolic evaluator over the complex field

 Calling Sequence evalc(expr)

Parameters

 expr - any expression

Description

 • This evalc(expr) calling sequence is used to manipulate complex-valued expressions, such as $\mathrm{sin}\left(a+Ib\right)$, by attempting to split such expressions into their real and imaginary parts.  Whenever possible, the output from evalc is put into the canonical form $\mathrm{expr1}+I\mathrm{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+b)) = 0. 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.

Examples

 > $\mathrm{evalc}\left(\sqrt{1+I}\right)$
 $\frac{{1}}{{2}}{}\sqrt{{2}{+}{2}{}\sqrt{{2}}}{+}\frac{{1}}{{2}}{}{I}{}\sqrt{{-}{2}{+}{2}{}\sqrt{{2}}}$ (1)
 > $\mathrm{evalc}\left(\mathrm{sin}\left(3+5I\right)\right)$
 ${\mathrm{sin}}{}\left({3}\right){}{\mathrm{cosh}}{}\left({5}\right){+}{I}{}{\mathrm{cos}}{}\left({3}\right){}{\mathrm{sinh}}{}\left({5}\right)$ (2)
 > $\mathrm{evalc}\left({2}^{1+I}\right)$
 ${2}{}{\mathrm{cos}}{}\left({\mathrm{ln}}{}\left({2}\right)\right){+}{2}{}{I}{}{\mathrm{sin}}{}\left({\mathrm{ln}}{}\left({2}\right)\right)$ (3)
 > $\mathrm{evalc}\left(\stackrel{&conjugate0;}{{ⅇ}^{I}}\right)$
 $\frac{{\mathrm{cos}}{}\left({1}\right)}{{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{+}{{\mathrm{sin}}{}\left({1}\right)}^{{2}}}{-}\frac{{I}{}{\mathrm{sin}}{}\left({1}\right)}{{{\mathrm{cos}}{}\left({1}\right)}^{{2}}{+}{{\mathrm{sin}}{}\left({1}\right)}^{{2}}}$ (4)
 > $\mathrm{evalc}\left(f\left({ⅇ}^{a+bI}\right)\right)$
 ${f}{}\left({{ⅇ}}^{{a}}{}{\mathrm{cos}}{}\left({b}\right){+}{I}{}{{ⅇ}}^{{a}}{}{\mathrm{sin}}{}\left({b}\right)\right)$ (5)
 > $\mathrm{evalc}\left(\mathrm{polar}\left(r,\mathrm{θ}\right)\right)$
 ${r}{}{\mathrm{cos}}{}\left({\mathrm{θ}}\right){+}{I}{}{r}{}{\mathrm{sin}}{}\left({\mathrm{θ}}\right)$ (6)
 > $\mathrm{evalc}\left(\left[{\left(a+Ib\right)}^{2},\mathrm{ln}\left(a+Ib\right)\right]\right)$
 $\left[{-}{{b}}^{{2}}{+}{2}{}{I}{}{a}{}{b}{+}{{a}}^{{2}}{,}\frac{{1}}{{2}}{}{\mathrm{ln}}{}\left({{a}}^{{2}}{+}{{b}}^{{2}}\right){+}{I}{}{\mathrm{arctan}}{}\left({b}{,}{a}\right)\right]$ (7)
 > $\mathrm{evalc}\left(\left|x+Iy\right|=\mathrm{cos}\left(u\left(x\right)+Iv\left(y\right)\right)\right)$
 $\sqrt{{{x}}^{{2}}{+}{{y}}^{{2}}}{=}{\mathrm{cos}}{}\left({u}{}\left({x}\right)\right){}{\mathrm{cosh}}{}\left({v}{}\left({y}\right)\right){-}{I}{}{\mathrm{sin}}{}\left({u}{}\left({x}\right)\right){}{\mathrm{sinh}}{}\left({v}{}\left({y}\right)\right)$ (8)
 > $\mathrm{evalc}\left(\sqrt{1-{u}^{2}}\right)$
 $\frac{{1}}{{2}}{}\sqrt{\left|{{u}}^{{2}}{-}{1}\right|}{}\left({1}{-}{\mathrm{signum}}{}\left({{u}}^{{2}}{-}{1}\right)\right){+}\frac{{1}}{{2}}{}{I}{}\sqrt{\left|{{u}}^{{2}}{-}{1}\right|}{}\left({1}{+}{\mathrm{signum}}{}\left({{u}}^{{2}}{-}{1}\right)\right)$ (9)

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.

 > $\mathrm{assume}\left(v::\mathrm{real},{v}^{2}<1\right)$
 > $\mathrm{evalc}\left(\sqrt{1-{v}^{2}}\right)$
 $\sqrt{{-}{{\mathrm{v~}}}^{{2}}{+}{1}}$ (10)
 > $\mathrm{series}\left({ⅇ}^{\mathrm{Ei}\left(1,4I\right)x},x,3\right)$
 ${1}{+}{\mathrm{Ei}}{}\left({1}{,}{4}{}{I}\right){}{x}{+}\frac{{1}}{{2}}{}{{\mathrm{Ei}}{}\left({1}{,}{4}{}{I}\right)}^{{2}}{}{{x}}^{{2}}{+}{\mathrm{O}}\left({{x}}^{{3}}\right)$ (11)
 > $\mathrm{evalc}\left(\right)$
 ${1}{+}\left({-}{\mathrm{Ci}}{}\left({4}\right){+}{I}{}\left({\mathrm{Si}}{}\left({4}\right){-}\frac{{1}}{{2}}{}{\mathrm{π}}\right)\right){}{x}{+}\left(\frac{{1}}{{2}}{}{{\mathrm{Ci}}{}\left({4}\right)}^{{2}}{-}\frac{{1}}{{2}}{}{{\mathrm{Si}}{}\left({4}\right)}^{{2}}{+}\frac{{1}}{{2}}{}{\mathrm{Si}}{}\left({4}\right){}{\mathrm{π}}{-}\frac{{1}}{{8}}{}{{\mathrm{π}}}^{{2}}{+}{I}{}\left({-}{\mathrm{Ci}}{}\left({4}\right){}{\mathrm{Si}}{}\left({4}\right){+}\frac{{1}}{{2}}{}{\mathrm{Ci}}{}\left({4}\right){}{\mathrm{π}}\right)\right){}{{x}}^{{2}}{+}{\mathrm{O}}\left({{x}}^{{3}}\right)$ (12)

 See Also