I am having trouble with this loop I am running. For the second row, the last column should be reading .130004, but instead it is reading a value on the order of 10^11. I believe I have comitted a logic error in assigning something but can’t figure out where I did it. Code is attached as the sample code option for the text body is rather ugly. Any help would be appreciated.
Your original result is
{{4, 11.7091, 199.343, 120.673, 111.059, 333.177, 45.0331, 0.405488, 9.65393, 0.145652},
{16, 17.1087, 70.3552, 808.172, 125.148, 375.443, 45.0331, 0.35984, 64.6538, 3.64047*10^11},
{46, 22.9638, 36.1029, 962.234, 134.625, 403.876, 45.0331, 0.334507, 76.9787, 0.492417},
{106, 27.2876, 35.1191, 1016.53, 139.858, 419.574, 45.0331, 0.321992, 81.3224, 0.144318}}
if the notebook is evaluated for the first time, then the result is (Mathematica 10.0.0, Window 7 64 Bit):
{{4, 11.7091, 199.343, 120.673, 111.059, 333.177, 45.0331, 0.405488, 9.65393, 3.64047*10^11},
{16, 17.1087, 70.3552, 808.172, 125.148, 375.443, 45.0331, 0.35984, 64.6538, 3.64047*10^11},
{46, 22.9638, 36.1029, 962.234, 134.625, 403.876, 45.0331, 0.334507, 76.9787, 0.492417},
{106, 27.2876, 35.1191, 1016.53, 139.858, 419.574, 45.0331, 0.321992, 81.3224, 0.144318}}
if the notebook is evaluated again in the same session, it results in
{{4, 11.7091, 199.343, 120.673, 111.059, 333.177, 45.0331, 0.405488, 9.65393, 0.145652},
{16, 17.1087, 70.3552, 808.172, 125.148, 375.443, 45.0331, 0.35984, 64.6538, 3.64047*10^11},
{46, 22.9638, 36.1029, 962.234, 134.625, 403.876, 45.0331, 0.334507, 76.9787, 0.492417},
{106, 27.2876, 35.1191, 1016.53, 139.858, 419.574, 45.0331, 0.321992, 81.3224, 0.144318}}
which is in fact your result. Further evaluations do not change that.
Next observation: rmsd does not belong to the variables for NDSolve[].
It’s rewritten a bit and now the high value is constantly in the first row, independent from the number of evaluations in a session. The results from the differential equation look similiar to each other, but the fef3 varies wildly: For nut =4 there is fef3 = 0.0001, the other nut’s have fef3’s in the order of 1000. For the first solution the vars2[[4]] is 111.059 and the term with fef3 from rmsd explains your trouble in my eyes:
In[3]:= (111.059/0.0001)^2
Out[3]= 1.23341*10^12
Please find the notebook attached.