# ParametricNDSolve and plotting problem

I have a problem with ParametricNDSolve:

a = 1; d = 0.13; s = 0.4; f = .1;

eq = c'[t] + I a (Abs[c[t]])^2 c[t] + d (Abs[c[t]])^2 c[t] -s (Abs[c[t]])^2 c[t] - f Exp[-I w t] == 0;

r =  ParametricNDSolve[{eq, c[0] == 0}, c[t], {t, 0, 25}, {w}];
Plot[Evaluate[{Re@#, Im@#} &[c[t] /. r, {w, 1, 10, .1}]], {t, 0, 25}]


i have no idea what is wrong here; i checked the documentation center and some posts on similar topic - and i'm still stuck. Any help appreciated! Thanks in advance!

a = 1; d = 0.13; s = 0.4; f = .1;
eq = c'[t] + I a (Abs[c[t]])^2 c[t] + d (Abs[c[t]])^2 c[t] -
s (Abs[c[t]])^2 c[t] - f Exp[-I w t] == 0;
r = ParametricNDSolve[{eq, c[0] == 0}, c, {t, 0, 25}, {w}];
Plot[Table[Through@{Re, Im}@c[w][t] /. r, {w, 1, 10, .1}], {t, 0, 25}, Evaluated -> True]


Update: various views

pre0 = Plot[Table[Re@c[w][t] /. r, {w, 1, 10, .1}], {t, 0, 25},
Evaluated -> True, ImageSize -> 500,
PlotLabel -> Style["Plot@Table[Re@c[w][t]/.r,{w,1,10,.1}],{t,0,25}]", 16]];
pim0 = Plot[Table[Im@c[w][t] /. r, {w, 1, 10, .1}], {t, 0, 25},
Evaluated -> True, ImageSize -> 500,
PlotLabel -> Style["Plot@Table[Im@c[w][t]/.r,{w,1,10,.1}],{t,0,25}]", 16]];
pre1 = Plot[Table[Re@c[w][t] /. r, {t, 0, 25, 5}], {w, 1, 10},
Evaluated -> True, ImageSize -> 500,
PlotLabel -> Style["Plot[Re@c[w][t]/.r,{t,0,25,5}],{w,1,10}]", 16]];
pim1 = Plot[Table[Im@c[w][t] /. r, {t, 0, 25, 5}], {w, 1, 10},
Evaluated -> True, ImageSize -> 500,
PlotLabel -> Style["Plot[Table[Im@c[w][t]/.r,{t,0,25,5}],{w,1,10}]", 16]];

Row[{pre0, pim0}, Spacer[5]]


Row[{pre1, pim1}, Spacer[5]]


Plot3D[Re@c[w][t] /. r, {t, 0, 10}, {w, 1, 5}, Evaluated -> True,
PlotPoints -> 100, BoxRatios -> 1, ImageSize -> 500,
ColorFunction -> "TemperatureMap", Mesh -> None, Lighting -> "Neutral"]


• thank you guys! and btw. is there a way to plot the c dependence of w without transforming the equation explicitly? Nov 6, 2014 at 20:35
• @BarLac, do the plots in my updated post answer your question re "the c dependence of w without transforming the equation explicitly"?
– kglr
Nov 11, 2014 at 19:20
r = ParametricNDSolve[{eq, c[0] == 0}, c, {t, 0, 25}, w];

Plot[Flatten[{Re@#, Im@#} &[Table[c[w][t] /. r, {w, 1, 4}]]], {t, 0,
25}, Evaluated -> True]

• ok, thanks; also i'd like to make a fourier transform for this equation, but somehow FourierTransform[eq, t, [Omega]] is stuck on evaluation (putting a or w instead of omega doesn't work) Nov 11, 2014 at 15:57