Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'About CompareMethods of NDSolve' topicStudent Support Forum > General > Archives > "About CompareMethods of NDSolve"

Help | Reply To Topic
Author Comment/Response
Shawn CHANG
04/17/13 06:55am

Hi, I use NDSolve for HIV model, I want to select the best order, Here my code:
Clear["`*"]
Needs["DifferentialEquations`NDSolveProblems`"];
Needs["DifferentialEquations`NDSolveUtilities`"];
eqn1 = D[tu[t], t] == \[Lambda] - \[Rho]*tu[t] - \[Eta]*tu[t]*v[t];
eqn2 = D[ti[t], t] == \[Eta]*tu[t]*v[t] - \[Delta]*ti[t];
eqn3 = D[v[t], t] == n*\[Delta]*ti[t] - c*v[t];
init1 = tu[0] == 600;
init2 = ti[0] == 30;
init3 = v[0] == 105;
params = {\[Lambda] -> 7, \[Rho] -> 0.108, \[Eta] ->
9*10^-6, \[Delta] -> 0.5, n -> 5, c -> 5};
system =
NDSolveProblem[{{eqn1, eqn2, eqn3} /. params, {init1, init2,
init3}, {tu, ti, v}, {t, 0, 20}, {}, {}, {}}];
sol = NDSolve[system, Method -> "StiffnessSwitching"]
refsol = First[FinalSolutions[system, sol]]
orders = Join[Range[2, 9], {Automatic}];
methods =
Table[{"ExplicitRungeKutta", "DifferenceOrder" -> i,
"StiffnessTest" -> False}, {i, orders}];
data = CompareMethods[system, refsol, methods]
...
My question is I want the data is numerical solution, how to do it?
Thank you. I'm sorry to my bad English.

URL: ,
Help | Reply To Topic