Hello,,
I am trying to solve system of differential equations x,y and z depended on time t, with different values of constant c. where c= 2.2758, 2.04822, 1.82064, 1.59306, 1.36548 .
then I want to use the solution of the differential equations system to plot equation F that depend on x[t]
and plot equation FT that depend on y[t] and c
So what i want is plot a variety of different graphs for F and FT over the range of c and if it possible to get each graphs with different color.
Clear[t]
\[Tau] = 13.8;
\[Omega]0 = 1;
r = 0.7071;
n = 1.7758;
\[HBar] = 1.05457173*10^-34;
\[Omega] = 0.5;
k = 1666666.667;
s = 2.2758;
cVals = {2.2758, 2.04822, 1.82064, 1.59306, 1.36548}
system1 = {x'[t] == n*y[t],
y'[t] == -n*x[t] -c*E^(-(r^2/\[Omega]0^2) ((t^2*(1.177^2))/\[Tau]^2))*z[t],
z'[t] ==c*E^(-(r^2/\[Omega]0^2) ((t^2*(1.177^2))/\[Tau]^2))*y[t]};
initialvalues1 = {x[-20] == 0, y[-20] == 0, z[-20] == 1};
sol1 = NDSolve[ Join[system1, initialvalues1], {x[t], y[t], z[t]}, {t, -20, 20}];
F = (-10^33*s*\[HBar]*r*x[t])/\[Omega]0^2*E^(-(r^2/\[Omega]0^2) ((t^2*(1.177^2))/\[Tau]^2));
FT = (-10^33*c*\[HBar]*r*y[t])/\[Omega]0^2*E^(-(r^2/\[Omega]0^2) ((t^2*(1.177^2))/\[Tau]^2));
P1 = Plot[Evaluate[F /. sol1], {t, -20, 20}, FrameLabel -> {t, F}, Frame -> True, FrameTicks -> All]
P2 = Plot[Evaluate[FT /. sol1], {t, -20, 20}, FrameLabel -> {t, FT}, Frame -> True, FrameTicks -> All]
that did not work,so I trying use ParametricNDSolveValue
pfun = ParametricNDSolveValue[Join[system1, initialvalues1], {x[t], y[t], z[t]}, {t,-20, 20}, {c}];
but I didn't know how to use pfun in F and FT equations
Thanks,