Having a problem with a loop I am running. The second row, last column value should be .130004, not the 10^11 value that I get. Any ideas on what is going on? Copied and pasted the body of code, but not the result table.
Clear["Global'*"];
errortablewt =
Table[khi = 64; ro2 = 3400; kmrs = 4; kisu = 1.5; kmp = 0.5;
kres = 25;
kccc1 = 76; k23 = 16; kvp = 0.04; kc = 21; nc = 5;
km2 = 350; nm2 = 6; kv1 = 17; nv1 = 6; kv2 = 700; nv2 = 6; k32 = 18;
n32 = 9; volc = .65; volm = 0.1; volv = 0.25; vhi = 2 khi nut;
kmhi = 2; kfc = 200; nfc = 5; kmmrs = 5; vmrs = 2 kmrs c[t];
vkccc1 = 2 kccc1 c[t]; kmccc1 = 20; a = 0.5;
odec = -(a c[t]) - (vkccc1 volv c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/(
volc (c[t] + kmccc1) ((f3[t]/kv2)^nv2 + 1)) + (nut vhi)/(
volc (kmhi + nut) ((c[t]/kc)^nc + 1) ((fs[t]/kfc)^nfc + 1)) - (
vmrs volm c[t])/(volc (c[t] + kmmrs) ((fs[t]/km2)^nm2 + 1));
odefm = -(a fm[t]) + (vmrs volc c[t])/(
volm (c[t] + kmmrs) ((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)) + (
vkccc1 volc c[t] (1 - 1/((c[t]/kv1)^nv1 + 1)))/(
volv (c[t] + kmccc1) ((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 = {nut, c[t], f2[t], f3[t], fm[t], fs[t], mp[t], o2[t], vp[t],
rmsd};
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}];
vars;
vars1 = vars /. solution /. t -> 31;
vars2 = Flatten[vars1];
If[nut == 4, {feisomito = 480, fef3 = 0.0001, fefm = 33.6,
fefs = 334.2, femp = 48}, {"nut not 4"}];
If[nut == 16, {feisomito = 544, fef3 = 1000, fefm = 152.32,
fefs = 107.09, femp = 310.08}, {"nut not 16"}];
If[nut == 46, {feisomito = 770, fef3 = 1180, fefm = 154, fefs = 213,
femp = 254.1}, {"nut not 46"}];
If[nut == 106, {feisomito = 710, fef3 = 1400, fefm = 170.4,
fefs = 215.8, femp = 191.7}, {"nut not 106"}];
rmsd = (1/
4 (((vars2[[4]] - fef3)/fef3)^2 + ((vars2[[5]] - fefm)/
feisomito)^2 + ((vars2[[6]] - fefs)/
feisomito)^2 + ((vars2[[7]] - femp)/feisomito)^2));
vars2, {nut, {4, 16, 46, 106}}]