0
$\begingroup$

I would like to plot the solutions to the system of ODEs that is written below:

smax = -0.668;
t = Flatten@Table[0.2 + i, {i, 0, 1, 1.5}]
Sol = NDSolveValue[{F'[s] == dF[s], Δ0'[s] == dΔ0[s]*Dsonic[s], 
 R'[s] == Dsonic[s],  F[0] == #, Δ0[0] == Δinit, 
 R[0] == Rinit}, {F, Δ0, R}, {s, 0, smax}] & /@ t

Plot[Evaluate@Through[Sol[s]], {s, 0, smax}, PlotRange -> All]
Plot[{#[s]}, {s, 0, smax}, PlotRange -> All] & /@ Sol

The NDSolve works but iIcan't plot it with what I have written. I would like to plot F[s] over R[s]. I haven't included the odes in the code because are a bit lengthy. I can include a script if it is necessary.

$\endgroup$
3
  • 1
    $\begingroup$ Your Sol — avoid starting with capitals, by the way — is a list of a list. You need to access its parts properly. For instance Plot[Through[#[s]], {s, 0, smax}, PlotRange -> All] & /@ Sol. Not sure what you really want. Sounds to me like this: ParametricPlot[Evaluate[{#[[3]][s], #[[1]][s]} & /@ Sol], {s, 0, smax}, PlotRange -> All] $\endgroup$
    – Michael E2
    Jan 22, 2022 at 17:16
  • $\begingroup$ This works fine. Thank you for your help and comments. What if i also wanted to plot another function G[s] which i have defined before i do the NDSolve that is a function of F[s],Δ[s],R[s]. Is it possible? $\endgroup$
    – Agaph
    Jan 22, 2022 at 17:41
  • $\begingroup$ I guess you can try something like Show[plot1,plot2] with plot1 being what @MichaelE2 suggested and plot2=Plot[G[s],{s,0,max},PlotRange->All] $\endgroup$ Jan 22, 2022 at 22:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.