0
|
2069 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
GROUPS:

# Problem with NDSolve

Posted 11 years ago
 Clear["Global'*"]; nut = 46; khi = 100; kmrs = 70; kisu = 1.4; kmp = 1.0; kres = 25; kccc1 = 40; k23 = 16; kvp = .04; kc = 50; nc = 5; km1 = 24; nm1 = 3; km2 = 46; nm2 = 4; kv1 = 24; nv1 = 9; kv2 = 200; nv2 = 4; k32 = 18; \ n32 = 9; a = .5; odec = -(a c[t]) - (    kccc1 c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/((f3[t]/kv2)^nv2 + 1) - (    kmrs c[t])/((fs[t]/km2)^nm2 + 1) + (khi nut)/((fs[t]/kc)^nc + 1); odefm = -(a fm[t]) + (kmrs c[t])/((fs[t]/km2)^nm2 + 1) - kisu fm[t] -    kmp fm[t];odefs = kisu fm[t] - a fs[t];odemp = kmp fm[t] - a mp[t];odef2 = -(a f2[t]) - k23 f2[t] (1 - 1/((c[t]/k32)^n32 + 1)) + (   kccc1 c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/((f3[t]/kv2)^nv2 + 1);odef3 = -(a f3[t]) + k23 f2[t] (1 - 1/((c[t]/k32)^n32 + 1)) -    kvp f3[t];odevp = kvp f3[t] - a vp[t];vars = {c[t], f2[t], f3[t], fm[t], fs[t], mp[t], vp[t]};solution =   NDSolve[{Derivative[1][c][t] == odec, Derivative[1][f2][t] == odef2,     Derivative[1][f3][t] == odef3, Derivative[1][fm][t] == odefm,     Derivative[1][fs][t] == odefs, Derivative[1][mp][t] == odemp,     Derivative[1][vp][t] == odevp, c[0] == 30, f2[0] == 100,     f3[0] == 100, fm[0] == 50, fs[0] == 50, mp[0] == 0 vp[0] == 100},    vars, {t, 0, 31}];vars;vars /. solution /. t -> 31;Having some trouble with this code again. I had it working until this morning when I decided to get rid of an equation. Then I let the code run and it returned errors that I was getting before (Equation or list of equations expected in argument). Anyone with an idea? I will post my original code as well for anyone looking to compare. I don't see an issue but maybe some fresh eyes will help.
3 Replies
Sort By:
Posted 11 years ago
 Clear["Global'*"]; nut = 46; khi = 50; ro2 = 3400; kmrs = 70; kisu = 1.4; kmp = 1.0; \ kres = 25; kccc1 = 40; k23 = 16; kvp = .04; kc = 21; nc = 5; km1 = 24; nm1 = 3; km2 = 46; nm2 = 4; kv1 = 24; nv1 = 9; kv2 = 200; nv2 = 4; k32 = 18; \ n32 = 9; a = .5; odec = -(a c[t]) - (    kccc1 c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/((f3[t]/kv2)^nv2 + 1) - (    kmrs c[t])/((fs[t]/km2)^nm2 + 1) + (khi nut)/((fs[t]/kc)^nc + 1);odefm = -(a fm[t]) + (kmrs c[t])/((fs[t]/km2)^nm2 + 1) - kisu fm[t] -    kmp fm[t] o2[t];odefs = kisu fm[t] - a fs[t];odemp = kmp fm[t] o2[t] - a mp[t];odeo2 = -(kmp fm[t] o2[t]) - kres fs[t] o2[t] +    ro2/((o2[t]/245)^9 + 1);odef2 = -(a f2[t]) - k23 f2[t] (1 - 1/((c[t]/k32)^n32 + 1)) + (   kccc1 c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/((f3[t]/kv2)^nv2 + 1);odef3 = -(a f3[t]) + k23 f2[t] (1 - 1/((c[t]/k32)^n32 + 1)) -    kvp f3[t];odevp = kvp f3[t] - a vp[t];vars = {c[t], f2[t], f3[t], fm[t], fs[t], mp[t], o2[t], vp[t]};solution =   NDSolve[{Derivative[1][c][t] == odec, Derivative[1][f2][t] == odef2,     Derivative[1][f3][t] == odef3, Derivative[1][fm][t] == odefm,     Derivative[1][fs][t] == odefs, Derivative[1][mp][t] == odemp,     Derivative[1][o2][t] == odeo2, Derivative[1][vp][t] == odevp,     c[0] == 30, f2[0] == 100, f3[0] == 100, fm[0] == 50, fs[0] == 50,     mp[0] == 0, o2[0] == 100, vp[0] == 100}, vars, {t, 0, 31}];varsvars /. solution /. t -> 31Here is the original code. I deleted the odeo2 term and any o2 related terms from the other equations to get to the first run. Any suggestions would be appreciated.
Posted 11 years ago
 Put a comma in between mp[ 0 ] == 0 and vp[ 0 ] == 100If you had read the error message carefully it told you there was an error in the arguments to NDSolve and it expected a list of equations instead of False and you could have checked off the items in the error message list against the arguments in your code until you got down to False where your code shows mp[ 0 ] == 0 vp[ 0 ] == 100 and that pointed at the error. The only thing it might have done better was to make mp[ 0 ] == 0 vp[ 0 ] == 100 blinking red in the original code.
Posted 11 years ago
 Thanks Bill. Was a little out of it this morning looking and I feel really stupid for missing that.
Community posts can be styled and formatted using the Markdown syntax.