Questions about using complex numbers in Mathematica. This includes basic arithmetic, functions of complex numbers, plotting complex functions, and dealing with branch cuts.

learn more… | top users | synonyms

0
votes
0answers
28 views

How to solve the warning problem and obtain real roots without imaginary part?

I am trying to solve a equation with Newton's method via FindRoot, and the codes are: Define the functions: ...
1
vote
1answer
48 views

Plot sets in the complex plane [duplicate]

I just want to know if there's a way to plot sets in the complex plane. For example $$A=\{z\in \mathbb{C},z+e^{z}=0\},\\A=\{z\in \mathbb{C},\Re(z)+e^{z}\geq0\}.$$
1
vote
1answer
123 views

Check for holomorphy of a function

Given a (rather complicated) function H(z), what is the best approach to check symbolically whether it is holomorphic? What I tried is checking explicitly the ...
3
votes
1answer
63 views

Express a complex function $f(z)$ as $u(x,y)+iv(x,y)$

How can I write a complex function $f(z)$ in the form $u(x,y)+iv(x,y)$ using Mathematica? Re and Im do not work, because they do it for complex numbers, not functions. For example, if I try ...
1
vote
1answer
77 views

How do I solve for the real and complex parts of an equation simultaneously?

If I were to have an equation, say something similar to... (1-Sqrt[x - I y])/(1+Sqrt[x - I y]) = A + I B Where I = Sqrt[-1], is there a way for Mathematica to ...
0
votes
1answer
78 views

Contourplot of complex Roots

Suppose I have this equation: $$ z^2 + 3z + (x^2 + y^2) = 0 $$ I want the real and complex contour plot of $z(x,y)$. Analytically, the real/imaginary boundary is separated by condition $x^2 + y^2 ...
7
votes
2answers
221 views

Does FindFit support complex numbers or doesn't it?

Inspired by this previous question: Findfit doesn't give the good fit; Changing the starting values will not change the results. Consider the following complex-valued dataset. ...
3
votes
1answer
269 views

HarmonicNumber problem

I am looking for all the roots of HarmonicNumber, in the domain [-30, 1] and [0, 6000] for the real and imaginary parts, respectively, and where the parameter ...
0
votes
1answer
49 views

How to evaluate Floor[1/2 + Arg[z]/(2π)] with Re[z] > 0

I want to do a series expansion of an expression containing Gamma functions with specific arguments. An example is the following: ...
1
vote
1answer
59 views

Simplifying complex expression with Mathematica

I want do get the imaginary part of Exp[I*t]/(1-Exp[I*t]) I've tried to do this Im[ComplexExpand[Exp[I*t]/(1-Exp[I*t])]] ...
0
votes
0answers
42 views

Why does this integral have a complex result

I wanted to find the normalization of distribution F2 . ...
0
votes
2answers
78 views

Absolute value and argument of a complex expression

I would like to find the absolute value and the argument of the expression: $ x + \sqrt { x^2 + y^2 } $ under the assumption that the absolute values of $ x $ and $ y $ are equal. I have written: ...
1
vote
1answer
65 views

Real and imaginary parts of a complex number

I would like to find the real and imaginary parts of $x + y$ in terms of polar coordinates. Here is code: ...
0
votes
3answers
96 views
-2
votes
1answer
70 views

how draw root locus in mathematica 9 for a special case

my closed loop transfer function is: H(s)=2exp(-q)/(1+exp(-2q)) q=sqrt((a+k*sqrt(s)+s)*s) , s=sigma+jw how can i draw root locus of H(s) as 'a' changes for ...
3
votes
1answer
111 views

Riemann surface for cubic root

I'm trying to generate Riemann surfaces of higher order. I read How to visualize Riemann surfaces?, and the subsequent documents. I'm able to reproduce the surface using polar representation, but I'm ...
2
votes
1answer
123 views

Differential Equation in Complex Plane and Parametric Plot

I would like to solve $dx/dt=\sqrt{1 + (I x)^3}$, where x is complex, for some initial condition like $1 - 5 I$ and plot the imaginary part of the solution versus the real part. (A somewhat similar ...
1
vote
2answers
122 views

Complex differential equation

I want to solve $dx/dt=\sqrt{(1-x^2)}$, where $x$ is complex. When I solve it by hand and analytically for some initial value and draw the imaginary part versus the real part, I obtain an ellipse, as ...
0
votes
1answer
85 views

Plot a real part of complex equation depending on a parameter

I would ask you to kindly provide me a way to solve this problem in mathematica way. Let the equation $z^2 + 9 -1.5 e^{- t z}=0$ where $z\in \mathbb C$ and $t\in \mathbb R^+$. In order to plot graph ...
0
votes
0answers
48 views

Complex integrals and residues

I have a question. I try to integrate this function: Integrate[Exp[I k z]*Exp[-Sqrt[k^2 - A^2]x]*Exp[-k^2*L^2/4]/Sqrt[k^2 - A^2], {k, -Infinity, -A}] But ...
0
votes
0answers
75 views

A power series expansion

Consider the function, $f(z) = z tanh(\pi z) log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ and ...
0
votes
0answers
52 views

Polar Plotting in Complex Plane [duplicate]

How would I plot the following functions in the polar complex plane? $$ \phi={-k\over 2\pi r}cos(\theta_0-\theta) $$ and $$ \psi={-k\over 2\pi r}sin(\theta_0-\theta) $$ Please ...
0
votes
1answer
69 views

Trouble fitting an explicitly complex model with the TransformedFit package

This is follow up from a previous question in which @Oleksandr R. suggested the use of a package he developed for splitting a model and data into real and imaginary parts to avoid a problem with ...
3
votes
2answers
282 views

ComplexExpand absolute squared

ComplexExpand[Abs[a + b I]] Gives $\sqrt{a^2 + b^2 }$ ComplexExpand[Abs[a + b I]^2] On the other hand gives Abs[a ...
0
votes
1answer
57 views

Can't Plot Fourier Series [closed]

I have been trying to plot fourier series but the plot is allways empty. I guess there is something wrong in my code but i dont know exactly what is it. Looking here for some previous ...
-2
votes
1answer
145 views

How to solve a non-linear equation?

I am trying to solve the following non-linear equation: $\frac{i e^{-x^2} \sqrt{\pi } x}{K^2}+\left(-0.131251-0.0379031 x^2-0.0151154 x^4-0.0100462 x^6+0.5 \left(0.00273859 +0.0400003 K^2\right) ...
0
votes
0answers
68 views

About how Mathematica understands the branchcuts of the complex logarithm [Part 3]

One understands that for the function $\log(z^2+a^2)$ Mathematica implicitly puts the branch cuts to be starting at $\pm ia$ and going up/down respectively on the imaginary axis. The phase of this ...
1
vote
0answers
43 views

Conjugate of InterpolatingFunction?

From NDSolve, I got this: {{a1 -> InterpolatingFunction[{{0., 40.}}, "<>"]}} What would be a sensible approach to ...
1
vote
3answers
166 views

Conjugating symbolic expression

I am trying to conjugate a symbolic expression, and I have explicitly stated the real terms. However, I simply can't get it to work: ...
0
votes
1answer
84 views

Series expansion of a complex function

How do I expand a function $f(z)$ in a particular region? For example, how would I expand $f(z)=(z^2-3z+2)^{-1}$ in the region $0<|z-1|<1.$? I believe this can be done by the binomial theorem. ...
32
votes
6answers
4k views

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$. When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
8
votes
4answers
588 views

Moving the location of the branch cut in Mathematica

According to the documentation, Mathematica chooses the branch cut for $\log(z)$ to lie along the negative real axis. It it possible to change this so that it lies along the positive axis or elsewhere ...
0
votes
0answers
50 views
9
votes
1answer
522 views

How does Mathematica understand branchcuts of the complex logarithm?

Say I have the function $f(x) = x \tanh(\pi x) \log (x^2 +a^2)$ where $a$ is some positive real number. Then it seems to be me that Mathematica when given such a ...
10
votes
2answers
2k views

How to calculate contour integrals with Mathematica?

How to calculate the integral of $\frac{1}{\sqrt{4 z^2 + 4 z + 3}}$ over the unit circle counterclockwise for each branch of the integrand?
0
votes
0answers
515 views

Fastest way to create a NxNxNxN dimensional matrix

I have a function that outputs a complex number Func[x_,y_]:= blah blah; I have constructed a table of all possible values of this function. ...
0
votes
0answers
68 views

How does Mathematica understand branchcuts of the complex logarithm? [Part 2]

I observe that the answer generated by the first integration is not in any simple way related to the next two answers. (some simple jump of i 2\pi across the branchcut of the logarithm is not helping ...
1
vote
1answer
73 views
0
votes
0answers
36 views

Chopping pure Imaginary numbers [duplicate]

I would like to be able to Chop complex numbers and display only the non-zeroed real or imaginary part when applicable. Chop alone works just fine if the non-negligible part is only the real part. ...
0
votes
1answer
132 views

I integrate a real function, I want a real result [closed]

I want to count some integral in Mathematica (actually, check that this integral is zero...) I arrive to an answer which has a zero real part but has some imaginary part! Why? This could be a mistake ...
0
votes
1answer
82 views

A question about using Reduce [closed]

Can someone help decipher what is the meaning of this computation that Mathematica has done? ...
2
votes
1answer
114 views

How to do this complex integration on the real line?

$m, r$ are parameters in the following integral: Integrate[z Exp[I z r]/Sqrt[z^2 + m^2], {z, -∞, ∞}] How to do this integration directly? The result should be ...
2
votes
1answer
66 views

Determine types of input, output and internal variables in compiled functions

I am trying to speedup the computation of a longer function using Compile. For illustration consider the following short example: ...
0
votes
1answer
51 views

Simplifying complex expressions

I'm trying to work with complexes and I want Mathematica to know that all variables are real unless I explicitly assigned the variable with an I so I wrote: ...
1
vote
2answers
97 views

How to find the complex number has least and greatest modul satisfying a given condition?

Let be given the complex number $z$ satisfying the condition $|z-2+2i|=2\sqrt{2}$. I want to find the complex numbers $z$ so that their modul obtain least and greatest value. I tried. Put $z = x + y ...
3
votes
1answer
63 views

Complex LogIntegral error

Going through Derbyshire's Prime Obsession & trying to take LogIntegral of 20^ZetaZero[1] & comes up with a value of ...
0
votes
0answers
31 views

Check if a (possibly nested) list is real [duplicate]

I have a very large matrix of numbers. I want to check if all its entries are real. At the moment I am using realQ = And @@ Thread[Flatten[Im @ #] == 0] & Is ...
3
votes
1answer
239 views

How to get rid of all complex numbers and functions?

For almost esthetical reasons, I always have been fascinated by infinite sums of series and I always wonder if theyhave a closed form. A couple of days ago, I found on MSE a question related to the ...
-2
votes
2answers
81 views

Plot isn't outputting a plot [closed]

I am trying to plot the magnitude complex function (f) with respect to w. For some reason, Plot is just displaying a set of axes, with no points. Any Idea what's going on here? ...
0
votes
0answers
36 views

Plotting a complex valued function in mathematica [duplicate]

How can I plot a complex valued function like $f(z)=z^2, z=x+Iy$, in Mathematica? Can anyone help?