Timeline for How to solve in principle such coupled ODEs
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 27, 2016 at 18:38 | comment | added | Chris K |
int2[2, 1] gives {1.32159} not 1.32159 -- you have to strip off a level with [[1]] . That is, int2[t_?NumericQ, z_?NumericQ] := h[1] /. NDSolve[{h'[v] == Exp[-f[t]*z*v^2], h[0] == 0}, h, {v, 0, 1}][[1]] works
|
|
Jul 27, 2016 at 9:14 | comment | added | stef |
That's what I was looking for, works fine! However, adding to the above definition of int[t,z] the new def. int2[t_?NumericQ, z_?NumericQ] := h[1] /. NDSolve[{h'[v] == Exp[-f[t]*z*v^2], h[0] == 0}, h, {v, 0, 1}] and calling int2[t,z[t]] in NDSolve produces fatal errors, even though Plot[{int[t, 1], int2[t, 1]}, {t, 0, 5}] shows the same result. Do you know how to do the replacement right?
|
|
Jul 25, 2016 at 19:12 | vote | accept | stef | ||
Jul 25, 2016 at 17:58 | history | answered | Chris K | CC BY-SA 3.0 |