Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Complex equation+ NDsolve

426 views
Skip to first unread message

sumarna...@gmail.com

unread,
Jun 5, 2012, 4:54:37 AM6/5/12
to
Can Mathematica solve Complex partial differential equations?? using NDsolve

Szabolcs Horvát

unread,
Jun 6, 2012, 4:47:30 AM6/6/12
to
On 2012.06.05. 10:54, sumarna...@gmail.com wrote:
> Can Mathematica solve Complex partial differential equations?? using NDsolve
>

The first section here will tell you what it can handle:

http://reference.wolfram.com/mathematica/tutorial/NDSolvePDE.html

--
Szabolcs Horv�t
Visit Mathematica.SE: http://mathematica.stackexchange.com/

Bob Hanlon

unread,
Jun 6, 2012, 4:48:01 AM6/6/12
to
>From the documentation: "The differential equations in NDSolve can
involve complex numbers. "

sol = NDSolve[{y'[t] == Sqrt[y[t]] - 1,
y[0] == 1/10}, y, {t, 0, 1},
Method -> "ExplicitRungeKutta"][[1]];

s[t_?NumericQ] := y[t] /. sol

b = t /. FindRoot[Im[s[t]] == 10^-16, {t, 0.1, 0.2}]

0.127783

ParametricPlot[
{Re[s[t]], Im[s[t]]},
{t, 0, 1},
Frame -> True, Axes -> False,
Epilog -> {Red, AbsolutePointSize[3],
Point[{Re[s[b]], Im[s[b]]}]},
FrameLabel -> {"Re", "Im"}]


Bob Hanlon

da...@wolfram.com

unread,
Jun 6, 2012, 4:49:02 AM6/6/12
to
On Tuesday, June 5, 2012 3:54:37 AM UTC-5, sumarna...@gmail.com wrote:
> Can Mathematica solve Complex partial differential equations?? using NDsolve

Yes. Here is a quick example.

NDSolve[x'[t] == I*x[t] && x[0] == 1, x[t], {t, 0, 2}]

This gives a sensible result, as can be seen visually:

Plot[{Re[soln], Im[soln]}, {t, 0, 1}]

Some methods may require input that is split into explicitly real equations though. This is the case if the input is a DAE system, for example.

Daniel Lichtblau
Wolfram Research

da...@wolfram.com

unread,
Jun 7, 2012, 5:18:11 AM6/7/12
to
Oops, I missed "partial" in the query. My guess is the type of example above will still work, but I have not checked to verify this.

Daniel Lichtblau
Wolfram Research

0 new messages