Message Boards Message Boards

[✓] Interpolate values from "InterpolatingFunction" solution?

GROUPS:

Hello everyone, I solved a two PDE simultaneously with "method of lines" using NDSolve command. Here is the code part of it:

lines = NDSolve[{eqns, eqns2, initc1, initc2, initc3}, V[t], {t, 0, 5}, MaxSteps -> \[Infinity]]

V[t_] = Table[v[i][t], {i, 0, n}];

I have obtained "InterpolatingFunction" solution: solution

I want to obtain specific value of v[i][t], for example v[5][2] and also I want to obtain max. value of v[i][t] so max.v[3][t],max.v[2][t] etc. then plot a graphic with max. values respect the "i".How do I do this. Thank you

POSTED BY: tarik balci
Answer
16 days ago

Perhaps the syntax of NDSolveValue is easier to undestand:

Clear[V]
V = NDSolveValue[{V'[t] == V[t], V[0] == {1, 2, 3, 4, 5}}, 
  V, {t, 0, 5}]
V[2]
Maximize[{V[t][[1]], 0 <= t <= 5}, t]
Plot[V[t], {t, 0, 5}]
Plot[V[t][[1]], {t, 0, 5}]
POSTED BY: Gianluca Gorni
Answer
16 days ago

Thank you Gianluca, I will try this command, I hope it works

POSTED BY: tarik balci
Answer
15 days ago

Group Abstract Group Abstract