Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'plotting several interpolating functions' topicStudent Support Forum > General > Archives > "plotting several interpolating functions"

Next Comment >Help | Reply To Topic
Author Comment/Response
Luka
03/08/13 4:16pm

Hi!

I want to get a profile of n[x] by changing the V from zero to maximum value.
I do not know which loop should I use. I tried with Do and get three InterpolatingFunction(s) for n[x] as a result. Now, I don't know how to plot them.
Is there a better way to accomplish my goal?
How can I calculate a gradient of n[x] at x=0?

Here is my code:
eq = Gx + D[Dif*\!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(n[x]\)\), x] -
Kr (n[x] - n0) == 0;
bcs = {n'[d] == 0, n[0] == n0*Exp[- V]};
d = 20*10^-6;
Gx = 10^19;
n0 = 10^21;
Dif = 4*10^-9;
Kr = 3.1*10^-9;
sol = Do[Print[
NDSolve[{eq, bcs}, n[x], {x, 0, d}, MaxSteps -> 50000]], {V, 0,
0.7, 0.3}]

And result:
{{n[x]->InterpolatingFunction[{{0.,0.00002}},<>][x]}}
{{n[x]->InterpolatingFunction[{{0.,0.00002}},<>][x]}}
{{n[x]->InterpolatingFunction[{{0.,0.00002}},<>][x]}}

Thank you very much!

Best regards,

Luka

URL: ,

Subject (listing for 'plotting several interpolating functions')
Author Date Posted
plotting several interpolating functions Luka 03/08/13 4:16pm
Re: plotting several interpolating functions Bill Simpson 03/08/13 9:13pm
Re: plotting several interpolating functions Bill Simpson 03/08/13 9:55pm
Re: plotting several interpolating functions Luka 03/09/13 11:58am
Re: plotting several interpolating functions Luka 03/10/13 03:13am
Re: Re: plotting several interpolating functions Bill Simpson 03/11/13 2:30pm
Next Comment >Help | Reply To Topic