Questions tagged [complex]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
86 views

Instructing DSolve not to return answers with explicit complex numbers

DSolve sometimes returns solutions containing explicit complex numbers, even though the ODE does not. For instance (drawn from question 126072), ...
49
votes
2answers
3k views

Möbius transformations revealed

Möbius Transformations Revealed is a short video that vividly illustrates the simplicity of Möbius transformations when viewed as rigid motions of the Riemann sphere. It was one of the winners in the ...
13
votes
3answers
3k views

How can I recreate Trott's Riemann Surface plot in Mathematica?

In reading Michael Trott's Visualization of Riemann Surfaces of Algebraic Functions, he has: ...
13
votes
1answer
5k views

Bifurcation diagrams for multiple equation systems

I am interested in constructing a bifurcation diagram for some of my parameters (especially for β and γ) in the dynamical system given in the code below. I want to see how parameter changes affect the ...
8
votes
4answers
2k views

Visualizing the Riemann zeta function

How to visualize in a nice geometric way (e.g., like in this YT video) the Riemann zeta function, $\zeta (z)$?
5
votes
6answers
2k views

Why is this Mandelbrot set's implementation infeasible: takes a massive amount of time to do?

The Mandelbrot set is defined by complex numbers such as $z=z^2+c$ where $z_0=0$ for the initial point and $c\in\mathbb C$. The numbers grow very fast in the iteration. ...
8
votes
5answers
13k views

How can I plot the complex graph of $x^x$ in Mathematica?

For example, this Wolfram Alpha query shows this graph: But it does not show the code for plotting it in Mathematica. Plot[x^x, {x, -1, 1}] only plots the real ...
9
votes
6answers
4k views

Image of first quadrant under $f(z)=(z+i)/(z-i)$

I'm able to plot the region where Im[z] > 0 and Re[z] > 0: ...
6
votes
1answer
1k views

Plotting Riemann Surface of $w(z)=\sqrt{1-z^{2}}$

I'm working in the plotting the Riemann surface of two functions, namely: $$ w_{1}(z)=\sqrt{1-z^{2}} \,, $$ and $$ w_{2}(z)=\tanh\left(k\sqrt{1-z^{2}}\right)-2iz\frac{\sqrt{1-z^{2}}}{1-2z^{2}}\,, $...
3
votes
1answer
2k views

Working with derivative of conjugate of a complex number

I have a complex function, lets say $g(x)$. I want to take its and its conjugate's derivative. I need the solution of derivative which must be symbolically and computationally efficient. Lets take an ...
3
votes
1answer
245 views

How to solve PDE with periodic and anti-periodic b.c.?

I need to solve the PDE for a complex function $A(x,t)=A_r(x,t)+iA_i(x,t)$ ...
3
votes
1answer
496 views

Why `Chop` does not make the real part of machine complex numbers an exact zero? [duplicate]

The documentation says Chop does not make the real part of machine complex numbers an exact zero: In[2]:= Chop[10.^-12 + 2. I] Out[2]= 0. + 2. I Why does ...
9
votes
2answers
8k views

How do I find line integrals?

For example, how can I calculate $$\int_{\left | z \right |=1}\frac{dz}{z}$$ I know that the answer is $2\pi i$ but how do I do it using Mathematica?
7
votes
3answers
394 views

Integrate yields complex value, while after variable transformation the result is real. Bug?

I have the following integral: Integrate[1/Sqrt[0.7 + 0.3*(1 + z)^3], {z, 0, ∞}, Assumptions -> z ∈ Reals] >> -3.36354 - 3.85013 I The output is ...
6
votes
1answer
151 views

Complex LogIntegral error

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

Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
4
votes
3answers
2k views

Conjugating symbolic expression [duplicate]

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: ...
3
votes
1answer
684 views

ComplexExpand and Arg function [closed]

Why does the command ComplexExpand[Arg[a]] gives Arg[a] instead of 0? Isn't it that ...
2
votes
1answer
293 views

Residue failed to reproduce this residue in a paper

This problem is a more clearly state of my original problem which is off topic, so I reconsider my problem carefully based on previous discussions, and gives the following valid code to reproduce my ...
2
votes
1answer
258 views

How to define a complex function with assumptions?

I'm trying to define a complex function to be able to do analytic calculations. Specifically, I want to define a function $A(x,t)$ in the complex plane with argument $\theta(x,t)$ and modulus $R(x,t)&...
2
votes
1answer
6k 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])]] ...
7
votes
3answers
2k 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 + ...
6
votes
2answers
357 views

How to solve this trigonometric complex ODE system?

The system of nonlinear ODE is $$ \mathrm{i}\,s(\ddot p-\frac{1}{2}\sin{2p}\;\dot q^2)=\mathrm{i}\,c\sin p\;\dot q-a\sin p+b\cos p\cos q\,,\\ \mathrm{i}\,s(\sin^2p\;\ddot q+\sin{2p}\;\dot p\dot q)=-\...
6
votes
2answers
221 views

Series expansion gives incorrect result

Bug introduced after 10.4 and persisting through 11.3.0 Mathematica 11.1.1.0 tells me that ...
5
votes
2answers
453 views

presenting a real number as real instead of imaginary

I have an equation which results in an answer of the form $\frac{i a}{\sqrt{c-d}}$ is there any way to get Mathematica to present it in it's real form? like $\frac{a}{\sqrt{d-c}}$ I know that I ...
4
votes
2answers
1k views

What can I do to eliminate the error FindFit::nrjnum:?

I am testing the "Power Law with finite-time singularity" hypothesis for world population growth for a project. The data I'm using (same behaviour should also be exhibited by the stock ...
4
votes
1answer
2k views

Stop Mathematica from giving imaginary solutions

I have the following equation: $$D=\frac{1}{64} \pi A ^3 B \sin \left(C\right)-\frac{1}{2} \pi A B \sin \left(C\right)$$ which I want to solve for $A$. The equation is cubic in $A$ so this should ...
3
votes
3answers
267 views

Simultaneous plotting

For my experiment, I have to simultaneously fit the real part and imaginary part of cavity reflection data which is given here column 1: frequency, column 2: reflection magnitude, column 3: phase I ...
2
votes
2answers
831 views

Listplot imaginary part of complex numbers

I have the following list w={{0.01,99 +0.00001414 I},{0.15,6.6370108 +0.003144129 I},{0.25,3.9515722 +0.00854493297 I},{6,0.10041 +0.28132187 I}} and I want to <...
2
votes
0answers
244 views

Evaluating Real and Imaginary parts in a dispersion equation via ContourPlot [closed]

I want to reproduce a dispersion curve from P. Zou's thesis found here: http://www.ipd.anl.gov/anlpubs/2001/06/39620.pdf on Pg. 31, Eq. 2.13. The problem is, the code below only gives values for the ...
1
vote
1answer
276 views

How to solve equations in Gaussian integers modulo p

How to solve a complex equation of the form: $$z^n \equiv i \pmod p$$ where $z$ is a Gaussian integer, $i$ is the imaginary number, $n, p \in \mathbb{Z}^+$ and $p$ is prime. I am dealing with quite ...
1
vote
1answer
199 views

Nsolve gives solutions with a small complex part which can't be eliminated by chop command

I do see that what I'm asking has been asked many times, and I have checked the previous questions, but they didn't work for the specific problem I'm asking: I have six equations with six unknowns: <...
0
votes
0answers
38 views

Plotting NDSolve function in complex coordinates

I have this system of equations: $- \ddot{z} + \frac{1}{g} \frac{\partial g}{\partial z} \dot{z}^2 + \frac{1}{g} \frac{\partial g}{\partial z^*} \dot{z} \dot{z}^*$ =0 , $- \ddot{z}^*+ \frac{1}{g^*} ...
19
votes
1answer
1k views

Dual complex integral over implicit path using contour plot

Context I am interested in doing double contour integral over paths which are defined implicitly. For the sake of debugging, let's assume its $$\oint_{\cal C}\oint_{\cal C} \frac{1}{u\, x} d u d x$$ ...
10
votes
1answer
10k views

Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
17
votes
2answers
3k views

Stereographic Projection

Say I want to represent points of the complex plane in the sphere $\Bbb S^2$ using stereographic projection. That is, the Riemann sphere: Specifically, it would be nice to be able to: Given the ...
12
votes
1answer
5k views

Is Abs[z]^2 a bad way to calculate the square modulus of z?

For a numerical quantity z, Abs[z] returns the square root of the sum of the squares of the real and imaginary parts of ...
6
votes
2answers
3k views

Plot3D with coloring based on phase value of f

I'm reading a sample chapter of Visual Complex Functions by E. Wegert. Near the bottom of this page, there is a link "Download Sample pages 1 (pdf, 2.4 MB)" which allows you to read Chapter 2 of the ...
13
votes
2answers
784 views

Is there a faster way to calculate Abs[z]^2 numerically?

Here I'm not interested in accuracy (see 13614) but rather in raw speed. You'd think that for a complex machine-precision number z, calculating ...
8
votes
2answers
518 views

Complex continuation of an interpolated function

Context I have a complicated real function defined implicitly by a series of imbricated numerical integration. I need to make a continuation of this function for a complex variable which is easily ...
7
votes
3answers
1k views

How do I plot the images of oriented curves under complex transformation?

I'm working on a complex transformation sketch that I'd like to create via mathematica. I'm working with the function $$w=z^2\tag{0},$$ where its real and imaginary parts are $u=x^2-y^2$ and $v=2xy$, ...
7
votes
3answers
472 views

Riemann-Spherical Projection of Network onto the $\mathbb{R}^2$-Plane

I'm trying to find a way to plot the graph ...
6
votes
2answers
625 views

NIntegrate and Integrate giving different results for ill-behaved function

I'm trying to integrate the following function with Mathematica 8: $$ I(a,b)= \int_0^1 \mathrm{d}x\int_0^1\mathrm{d}y \,\theta(1-x-y) \frac{1}{x a^2-y(1-y)b^2},$$ where $\theta$ is the Heaviside ...
10
votes
2answers
632 views

Symbolic Integration along contour: branch cut problem?

Context Following this question on path integrals in the complex plane, having defined again a numerical and symbolic integrator along a path as ...
5
votes
4answers
10k views

Solving complex equations

I feel like I am missing a basic, but key point when using Mathematica's Solve or Reduce. ...
4
votes
2answers
219 views

Better way to treat branch cut problem in Mathematica

Currently, Mathematica treats function which has branch cuts; $\log(z)$,$\sqrt[n]{z}$, etc, by taking its principal value. This may cause a problem in Contour integration when the path of integration ...
4
votes
1answer
2k 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 ...
3
votes
2answers
176 views

Getting an Accurate Transformed Region (Part II)

I asked earlier about transforming a set of curves and getting an accurate plot when a curve goes to infinity: Getting an Accurate Transformed Region Here is an example where a transformed region ...
1
vote
2answers
2k views

Contour plot of complex function: problem in choosing argument

I have a complex function F[x,y], and now I want to plot the contour F[x,y] = 0. What can I do in order to have the contour plot vs Re[x] and y (That is, I want to treat y a real variable and x a ...
9
votes
2answers
174 views

Problem with Identifying Complex Components

I am trying to isolate out the real and complex terms in a fairly large expression. During the process, I have made several assumptions that last throughout the entire process. ...