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
0 answers
51 views

One more incorrect result of FunctionMeromorphic and FunctionAnalytic

Two years ago I submitted a bug in FunctionMeromorphic (That bug still persists in 13.2.). Here is one more incorrect result in it and ...
  • 21.1k
0 votes
1 answer
50 views

The problem with complex numbers

I have one of the roots of the characteristic equation ...
1 vote
2 answers
79 views

Holomorphic derivatives (in 2 d) in Mathematica

In 2 Dimensional Conformal field theory, We have two coordinates $ z=x+i y$ and $\bar{z}=x-i y$. Here $x$ and $y$ are both real. So, one can work directly with $z$ and $\bar{z}$. I want to define $\...
  • 29
1 vote
1 answer
80 views

Green function and differential equation

I'm trying find the Green's function for a special operator. I have the homogeneous equation x (x - 1) y''[x] - 2 I Zm y'[x] - L(L + 1) y[x]==0 for $x>1$ ...
  • 438
0 votes
1 answer
31 views

Simplify complex conjugation and force joining of exponentials

I define the following piecewise functions. ...
  • 451
1 vote
1 answer
56 views

How to take the derivative of a function in `Im[]`?

I tried to take the derivative of a long expression containing $\text{Re} \text{Li}_3(e^{2\pi ix})$, the trilogarithm while $x$ is real. Since the real part function is linear ,it should be like this $...
1 vote
1 answer
111 views

How to get Mathematica to give me a specific alternate form? [closed]

I have a lot of equations of a form similar to $$\frac{x(\frac{4}{3} + 4x^4)}{(x - \sqrt{\frac{2}{3}}e^{i\pi/4})(x - \sqrt{\frac{2}{3}}e^{-i\pi/4})}.$$ All of these equations can for non-zero ...
1 vote
1 answer
62 views

Simple SDP using Hermitian matrices

I would like to run the following semidefinite program $$ \textrm{Minimize}\,\, \textrm{tr}\big({AX}\big)\\ \textrm{subject to}\,\, X \geq B_1\,, X \geq B_2\,, $$ where $A$, $B_1$ and $B_2$ are ...
3 votes
1 answer
106 views

How to change the styles of Real part and Imaginary part in ReImPlot using ReImStyle?

I have following code, ReImPlot[(2 + 3*I)*x + (4 + 5 I), {x, 0, 3}, ReImStyle -> {{Dashed, Red}, {DotDashed, Red}}] This will created the plot that looks like ...
  • 471
3 votes
1 answer
78 views

Finding real and imaginary part of long expression takes too long

I generally try to find real and imaginary parts of long expressions such as in the following example. But it takes too long time. a) How can we speed up it? (and it includes terms such as ...
4 votes
1 answer
127 views

DSolve solution for 1st order PDE involving complex number does not match initial condition

Bug introduced in 11.3 or earlier, persisting through 13.2.1. [Mathematica 12.0.0.0, MacOS X x86 (64bit)] Trying to solve ...
  • 175
0 votes
1 answer
85 views

How to compute the residue of $f(z)=\frac{n/z}{z^{n}-1}$ to be $-n$ at $z=0$? [duplicate]

How to get residue of $f(z)=\frac{n/z}{z^{n}-1}$ with correct residue of $-n$ at zero? It works it out just fine at 1 with: Residue[(n/z/(z^n - 1)), {z, 1}]
  • 333
2 votes
3 answers
305 views

Plotting a complex matrix with phase dependent color

I want to plot a complex matrix, i.e., a matrix with complex number entries. I want the matrix to be plotted as DiscretePlot3D as shown in the figure (top figure). But, I also want each bar to be ...
0 votes
1 answer
90 views

Mathematica does not accept that this variable is a positive real?

So I have the following expression that derives from previous computations: ...
1 vote
1 answer
61 views

How to make Mathematica able to integrate $\int_{-\infty}^\infty \frac{e^{ikx}}{(x+ia)^3} dx = i\pi k^2 e^{ka} \theta(-k)$ for $a>0$?

I want to evaluate an integral which is essentially a sum of the form $\lim_{a\to 0^+}\int_{-\infty}^\infty \frac{e^{ikx}}{(x+ia)^m} dx$, where $k\in\mathbb R$ and $m\in\mathbb N$. By the residue ...
  • 1,009
5 votes
4 answers
385 views

Displaying results with Exp instead of powers

Entering Solve[z^4 == -1] gives: {{z -> -(-1)^(1/4)}, {z -> (-1)^( 1/4)}, {z -> -(-1)^(3/4)}, {z -> (-1)^(3/4)}} or $\left\{\left\{z\to -\sqrt[4]{-...
  • 53
0 votes
1 answer
63 views

FullSimplify does not simplify involving `ResidueSum`

Consider the following code involving ResidueSum: ...
  • 1,009
2 votes
1 answer
89 views

How do we separate a complex matrix into real and imaginary matrices?

If we have a complex matrix C, how do we separate it into two matrices as C=A+iB, where A and B are real matrices?
-1 votes
2 answers
86 views

How to write a Mathematica code to plot complex function in a 3D plane [closed]

f(x)=square(X)+ix. Plot a 3D plane for this complex function
0 votes
1 answer
70 views

how to draw the roots of a complex number

I created a simple code to calculate roots of a complex number using De Moivre's formula. I would like to draw these elements. ...
  • 1
0 votes
1 answer
46 views

Replace x + I y by z in complex expression

Say I define z = x + I y; Then I calculate -2 Im[z] + 3 + I(2 Re[z]) // ComplexExpand which gives ...
  • 717
1 vote
2 answers
302 views

Polar graph of the Riemann zeta function

I would like to plot a complex graph of the Riemann zeta function on the Argand diagram $ς(s)$, where $s = \frac{1}{2} + i t $, and the value of $t$ is varied to get a graph in the polar form. Can ...
0 votes
2 answers
56 views

Plotting a complex number on the Argand diagram [closed]

I want to plot (0.25)^(2+i) on the Argand diagram. Can anyone help me with it?
2 votes
1 answer
257 views

How to calculate infinitesimal analytic continuation?

Many problems in science and engineering are related to the analytic continuation and in particular infinitesimal analytic continuation to the upper or lower complex plane, i.e., a generic complex ...
  • 4,584
1 vote
1 answer
68 views

How to avoid using the principal branch?

How can I make Mathematica to use $Log[-1]=i\pi+2i\pi*n$ with $n\in\mathbb{Z}$? Currently, mathematica set $Log(-1)=i\pi$ and when I try to redefine the value of $Log[-1]$ I get the message "Set::...
  • 121
1 vote
3 answers
477 views

How to plot an imaginary number, i, power tower as done in the following way?

Can somebody explain what two variables exactly they have plotted against each other to get such graphs, and how one would go about getting this graph in Mathematica?
  • 43
0 votes
0 answers
46 views

How to change branch cut of Log[z] to positive real axis, [duplicate]

No one ever answered original ZZZ's question in a straightforward shortest code " Mathematica chooses the branch cut for log(z) to lie along the negative real axis. It it possible to change this ...
  • 309
4 votes
1 answer
121 views

How can I plot a list of complex numbers against a parameter while separating their real and imaginary parts?

This is a sort of continuation of How can I make a list of values "remember" the entered parameters? I have some cubic function which solves for a variable ...
2 votes
1 answer
173 views

How to get the real part of a complex function with some real coefficients?

I want to get the real part of the function n3[t] (see below) which is the solution to a differential equation. Solve the differential equation. (Suppose ...
0 votes
0 answers
63 views

Why do I get different results for this complex line integral?

I want to compute line integral of $f(z) = \frac{1}{z(z-1)^{n+1}}$ over a closed curve $\gamma: t \mapsto 1 + \frac{1}{2} e^{i t}, t \in [0,2\pi]$ in the complex plane in two different ways but the ...
  • 153
2 votes
2 answers
123 views

Plot circle of radio `r` in complex plane

I am having a brain-not-working day... Embarrassingly, I can't figure out how to plot a circle on the complex plane with origin z_0 and radio ...
1 vote
1 answer
50 views

Converting a complex matrix into an equal-sized PNG

Now, I would think that when I run the following code, I'd get a 20x20 pixel image I could copy as a PNG with all the pixels corresponding to the given(although in this case random) data. Instead, I ...
  • 171
0 votes
1 answer
78 views

Julia set and external rays for high degree

We know that the soft "Mandel dynamics" by W,Jung give us the way to draw the Julia sets and their external rays, I wonder whether there are good programs for polynomial of high degree, ...
2 votes
0 answers
54 views

Finding the equation of a circle for complex numbers

Solve[Abs[z]²==1,z] returns two solutions, -1, and 1. I would like to get all the solutions of the form Exp[I c₁]. ...
  • 193
1 vote
1 answer
76 views

FullSimplify not working when simplifying a complex number

Here is a snippet of the code I am working on, which requires me to get the Real part of the Harmonic Oscillator wavefunction. ...
  • 15
0 votes
0 answers
92 views

Solving an equation without output

Could you please help in solving the equation below. I am not able to do it with the current version of mathematica (very old one). All parameters are real and positive. Thank you so much in advance <...
  • 21
2 votes
3 answers
203 views

How to get rid of complex terms in the given expression and rewrite it as a real function?

I have an expression exp in terms of the parameter $n\in\mathbb{N}^+$ which takes the values $n=\{ 1,2,3,4,5,6,7,8,9,10 \}$. As can be seen (a picture is also ...
  • 1,159
0 votes
1 answer
67 views

What is the most efficient/optimal way to simplify the given function? Does the given code need more assumptions?

I have a very long function for $\{x,b\}\in\mathbb{R}$ and $n=\{1,2,3,4,5,6,7,8,9,10\}$; here, I have only mentioned a short part of that. The function is a sum of the complex exponentials (a picture ...
  • 1,159
1 vote
1 answer
91 views

How to treat variables in an expression as real? [closed]

Let's say we'd like to define a general complex polynomial and then separate the real terms from the imaginary terms. We could define ...
0 votes
1 answer
59 views

Unable to solve a couple complex valued differential equation usingNDSolve [closed]

I am new to Mathematica and I am trying to use the NDSolve to deal with the following odes ...
1 vote
4 answers
106 views

Simplifying a function to get rid of fractional powers of $-1$

I have the following function for $x>0$. ...
  • 659
2 votes
2 answers
68 views

Showing Real and Imaginary parts of a Complex expression without reordering

I know Mathematica has a strong tendency to reordering expressions, but this is too much and there must be a way. So I'll give you an extremely simple example. I define this ...
0 votes
1 answer
107 views

Solve a system of complex equations with parameters

I have a system of ten complex equations, with four complex variables u1,u2,v1,v2 and two real variables θ1, θ2. In these ...
  • 55
0 votes
0 answers
56 views

Complex conjugate in Mathematica [duplicate]

Suppose $a$ and $b$ are two complex variables, how to realize: $$\text{Conjugate}[a+b]=\text{Conjugate}[a]+\text{Conjugate}[b] $$ in Mathematica. Suppose in following situation, I want to simplify: <...
  • 101
-1 votes
1 answer
80 views

Evaluating a complex expression

I have the function complex valued function g[z_]:=(2a z^2+bz)/(az^2+bz) where $z=e^{i \theta}$.I want g in terms of $\cos(\theta)$ and $\sin(\theta)$.How do I do it mathematica?Next I want value(...
6 votes
2 answers
698 views

How to prove this algebraic identity?

I mean $$\forall z \in \mathbb C\left(\ \left| \sqrt{z^2-1}-z\right| +\left| z+\sqrt{z^2-1}\right| =| z-1| +| z+1|\right ) .$$ The command ...
  • 21.1k
2 votes
2 answers
62 views

Checking region membership in a polygon defined by complex roots

I want to define a function that returns True if a complex number $z$ is in complex set $\Omega $ which is the pentagon with vertices located at the fifth roots of ...
  • 243
3 votes
2 answers
84 views

How to get rid of the absolute value in ComplexPlot3D[]?

I'm starting to study complex analysis,so I'm trying out Mathematica as tool for visualizing complex functions. I'm trying to graph $f(z)=z^2 + 1$ with the code: ...
7 votes
4 answers
287 views

Remove conjugates from a list

I have this list: ...
  • 1,307
0 votes
1 answer
47 views

Need help with Assumptions for an integral

I want to solve this Log, Integrate[2a Log[-a+((A0 + (y-y1)²)^½, {y1, 0,b}] But Mathematica only gives me long conditional expressions or imaginary numbers. I (my thinking which can be wrong) assume I ...
  • 1

1
2 3 4 5
25