RE: Plot Complex Interpol .Func.
- To: mathgroup at smc.vnet.net
- Subject: [mg9590] RE: [mg9561] Plot Complex Interpol .Func.
- From: jmthomas <jmthomas at cybercable.tm.fr>
- Date: Thu, 13 Nov 1997 23:24:02 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Check the syntax for ParametricPlot: you need two (real) arguments:
ParametricPlot[{function1, function2},{param,min,max}] In your case you
can use:
{r[a_],i[a_]}={Re[(f/.First at soln)[a],Im[ etc, where Re and Im split
the complex value into two real arguments, then
ParametricPlot[{r at a,i at a,{a,min, max}] Hope this helps
----------------------------------------------- Jean-Marie THOMAS
Conseil et Audit en Ingnierie de Calcul jmthomas at cybercable.tm.fr
www.cybercable.tm.fr/~jmthomas
-----Original Message-----
From: Jim Leddon [SMTP:jleddon at cyberramp.net] To: mathgroup at smc.vnet.net
Sent: Thursday, November 13, 1997 7:40 AM To: mathgroup at smc.vnet.net
Subject: [mg9561] Plot Complex Interpol .Func.
I am trying to solve the schrodinger equation as follows and I want to
be able to plot the resulting interpolating function (which should
contain complex values).
In[6]:=Schrodinger[V_,A_] := D[f[a],{a,2}] + (V - A)f[a]]
In[7]:= R[x_,y_] := x + I y
In[8]:= V[R_,a_] :=
R[1,2](-1/(Cos[a] - Sin[a]) -1/Sin[a] + 1/Cos[a])
In[9]:= eq1 = 0 == Schrodinger[V[R,a],-900] Out[9]=
0==f[a] (900 + (1 +
2 I) (-Csc[a] + Sec[a] -
1/(Cos[a] - Sin[a])) + f''[a]
In[10]:= soln =NDSolve[{eq1, f[0.00005] ==0, f'[0.00005]
==.5},
f, {a, 0.00005, 0.785348}][[1]] Out[10]=
{f->InterpolatingFunction[{{0.00005,0.785348}},"<>"]}
In[11]:= ParametricPlot[f /. soln[[1]], {a, 0.00005, 1}]
The error message I got at this point was:
function f/. soln[[1]] cannot be compiled; plotting will proceed.. f/.
soln[[1]] does not evaluate to a real pair of numbers
at a =0.000050041664...., etc.
What went wrong ? How can I plot the interpolating function?
Thanks in advance for your help!
Debbie Leddon
jleddon at cyberramp.net