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
88
votes
5answers
12k views

How can I generate this “domain coloring” plot?

I found this plot on Wikipedia: Domain coloring of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnitude. ...
49
votes
6answers
10k 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 ...
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 ...
45
votes
1answer
9k views

How to visualize Riemann surfaces?

In WolframAlpha we can easily visualize Riemann surfaces of arbitrary functions, can we plot the Riemann surface of an arbitrary function using Mathematica and ...
42
votes
5answers
44k views

Plotting Complex Quantity Functions

Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ...
42
votes
2answers
19k 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?
36
votes
3answers
56k views

How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

I'm trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example, ...
26
votes
2answers
4k 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 ...
26
votes
3answers
6k views

Visualizing a Complex Vector Field near Poles

I've been playing around with a visualization technique for complex functions where one views the function $f: \mathbb{C} \rightarrow \mathbb{C}$ as the vector field $f: \mathbb{R^2} \rightarrow \...
23
votes
1answer
1k views

Numerical inverse Laplace-Hankel transform

When trying to reproduce the result of this paper about numerical solution of Lamb's problem, I encountered the following double integral (to be more precise, the 0-order inverse Hankel-Laplace ...
22
votes
5answers
5k views

Why this real integral yields imaginary results?

This integral yields -1-4Iπ/3 in Mathematica: Integrate[(y - y^2 + x - x^2 + 2*x*y)/(1 - x - y), {x,0,1}, {y, 0, 1}] Since ...
21
votes
2answers
1k views

Why doesn't FullSimplify drop the Re function from an expression known to be real?

For some reason Mathematica does not properly simplify this expression: ...
19
votes
6answers
9k views

Plotting complex numbers as an Argand Diagram

I have the function: $F(\omega) = \frac{5\; - \;i\;\omega}{5^2\; +\; \omega^2}$ When $\omega$ has the values : $\{ -7, -2,\; 0,\; 2,\; 7\}$ How would I plot the Argand diagram in Mathematica? Or ...
19
votes
3answers
7k views

Derivative of real functions including Re and Im

When deriving functions using Re, Im or Arg (and probably some other functions as well), ...
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$$ ...
18
votes
3answers
3k 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 ...
17
votes
2answers
13k views

Plotting complex Sine

I've got another plotting problem. I want to plot Sin[z] where z is complex. So, I've tried the following: ...
17
votes
4answers
15k views

Factoring polynomials to factors involving complex coefficients

I've run into some problems using Factor on polynomials with complex coefficient factors. Reading the documentation it looks like it only factors over the ...
17
votes
4answers
758 views

Why is (-1.)^2. a complex number

Why (-1.)^2. in Mathematica returns a complex number? It looks like in both C and Fortran it returns 1. Why does Mathematica behave differently than the other ...
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 ...
16
votes
2answers
520 views

Plotting Joukowski Airfoil Streamlines using conformal maps

I want to plot the streamlines around Joukowski Airfoil using conformal mapping of a circle solution. I do know that there are a lot of solutions to plot the airfoil itself (for example this), but I'...
16
votes
1answer
380 views

Why are Exp[3] and 2 treated differently within Complex?

Why doesn't the last command below split the complex number into its real and imaginary parts? ...
15
votes
3answers
8k views

How can I convert a complex number into an exponent form

When I have an expression such as (1/4 + I/4) ((1 - 2 I) x + Sqrt[3] y) it is hard to get an intuition of the number. So I want to convert it to the complex ...
15
votes
2answers
993 views

Visualizing a holomorphic bijection between the unit disc and a domain

One can construct a holomorphic bijection between the (open) unit disc $D=\{z\in{\bf C}: |z|<1\}$, and a domain $D\setminus\overline{B_{1/2}(-1/2)}$ where $B_r(z_0)$ denotes the ball of radius $r$ ...
15
votes
2answers
15k views

How to specify assumptions before evaluation?

If I request mathematica evaluate an integral for me, I'll often get a more general ConditionalExpression than I want. Example : ...
15
votes
4answers
315 views

How to convert this term to a Hypergeometric function?

term=8*(-1)^(1/4)*Sqrt[b]*q0^(3/2)*\[Kappa]* EllipticF[I*ArcSinh[((-1)^(1/4)*Sqrt[b]*r)/Sqrt[q0]], -1] This is a physical term and it is not convenient to appear ...
15
votes
5answers
837 views

Is there a workaround for this integral?

The command Integrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}] produces ConditionalExpression[0, a == 0] which is not correct in view of ...
15
votes
2answers
549 views

Inconsistent results from equivalent integrals

Why is Mathematica returning different values for these two integrals: I am just being introduced to complex integration, so it's possible that I have a misunderstanding of how this works, but in ...
14
votes
2answers
7k views

Paths integrals in the complex plane

I can't find how to calculate path integrals of complex functions in the complex plane. For example: $$\oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$
14
votes
2answers
2k 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. ...
14
votes
1answer
399 views

Why does Mathematica choose branches as it does in this situation?

Consider these integrals: ...
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
3answers
755 views

Finding and visualization of branch cuts and branch points

Is it possible to determine branch cuts and branch points for complicated functions using mathematica Iam trying to determine the brnach cuts and branch points of this complicated function We have ...
13
votes
3answers
8k views

Complex number operations: telling Mathematica variables are real

I want to do Conjugate[a + b*I], but when I do that, the solution is Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
13
votes
2answers
785 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 ...
13
votes
3answers
220 views

Convert Real packed array of pairs to Complex packed array

I have a Real packed array arr. It may have arbitrary depth but Last@Dimensions[arr] == 2. ...
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 ...
13
votes
2answers
979 views

Compiling the VoigtDistribution PDF

According to List of compilable functions, Erf and Erfc are compilable functions. However, I want to make a compiled version ...
13
votes
2answers
538 views

How to compute the residue of $e^{z-\frac{1}{z}}$ at z=0?

I've tried the following but it didn't work: Residue[Exp[z - 1/z], {z, 0}] not even this: Residue[Exp[1/z], {z, 0}] ...
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 ...
12
votes
2answers
556 views

What is the best way to define Wirtinger derivatives

Wirtinger derivatives ( also called Cauchy operators) in complex analysis are widely used tools. They are defined in the case of one dimensional complex plane as follows $$\frac{\partial}{\partial z}=...
11
votes
3answers
6k views

Is there a simple way to plot complex numbers satisfying a given criteria

I think this should be straightforward, but I cannot seem to find a good source on how to do it after searching around, so I'm trying to sketch sets of complex numbers that meet a given for criteria. ...
11
votes
2answers
843 views

Why does Arg'[1. + I] return -0.5?

From the document we know that Arg[z] gives the gives the argument of the complex number z. Then how about ...
11
votes
1answer
201 views

Definition of Mod and Quotient with complex arguments

How are Mod and Quotient defined for three real/complex arguments? I wasn't able to find the definition. My main surprise so ...
10
votes
1answer
1k views

How do I put an image on the complex plane?

I watched this video and became interested in transforming an image. But I have no good idea on how to embed an image in the complex plane using Mathematica. I have a method that seems to work, but ...
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 ...
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 ...
10
votes
2answers
347 views

Strange behavior of Limit in Mathematica 9 and 10 (bug?)

fixed in 10.1 Consider a complex logarithm where the branch cut is defined along the negative axis. Then for $r$ and $\eta$ real and positive we can write $ \lim_{\eta \to 0} \log(-r+ i \eta) = log (...
10
votes
1answer
278 views

FiniteElement v.s. TensorProductGrid: which is reliable for Schrödinger equation with periodic b.c.?

This is a problem comes up in the discussion under this post and I think it's worth starting a new question for it. I suspect the underlying issue is the same as in this post, but not sure. Consider ...
10
votes
1answer
827 views

Contour Integration along a contour containing two branch points

I need to compute following contour integrations: $$f(u)=\oint_\alpha dz \sqrt{z^3+z+u} \qquad ; \qquad g(u)=\oint_\beta dz \sqrt{z^3+z+u}$$ In which $\alpha$ and $\beta$ are two contours in ...

1
2 3 4 5
19