I am going to integrate the product of the results of NDsolve
, in fact If x and y are the results as interpolating function, How I can integrate x*y numerically?
Table[{Exp[Integrate[ x[t] /. s, {t, 0, i}]]}, {i, -17.5, 10, 1}]
This line does not work for products of x[t]*y[t] or x[t]^2
.
This is my entire code file:
yy = {10^-4}; rr = {0.999}; xx = {10^-15}; zz = {10^-4}; mm = {10^-4};
yy + rr + xx^2 + zz - mm^2 - zz^2/24 ic = -17.5
s = NDSolve[{D[y[t],
t] == (3 y[t])/5 - (12 m[t]^2 y[t])/5 + (2 r[t] y[t])/
5 - (6 x[t]^2 y[t])/5 + (3 y[t]^2)/5 + (7 y[t] z[t])/
5 - (y[t] z[t]^2)/10,
D[r[t], t] == -((2 r[t])/5) - (12 m[t]^2 r[t])/5 + (2 r[t]^2)/
5 - (6 r[t] x[t]^2)/5 + (3 r[t] y[t])/5 + (7 r[t] z[t])/
5 - (r[t] z[t]^2)/10,
D[x[t], t] == (9 x[t])/5 - (6 m[t]^2 x[t])/5 + (r[t] x[t])/
5 - (3 x[t]^3)/5 + (3 x[t] y[t])/10 + (x[t] z[t])/
5 - (x[t] z[t]^2)/20,
D[z[t], t] ==
12/5 + (12 m[t]^2)/5 - (12 r[t])/5 - (24 x[t]^2)/5 - (18 y[t])/
5 - (18 z[t])/5 - (6 m[t]^2 z[t])/5 + (r[t] z[t])/
5 - (3 x[t]^2 z[t])/5 + (3 y[t] z[t])/10 + (13 z[t]^2)/10 -
z[t]^3/20,
D[m[t], t] == -2 Sqrt[3] - (6 m[t])/5 -
2 Sqrt[3] m[t]^2 - (6 m[t]^3)/5 +
2 Sqrt[3] r[t] + (m[t] r[t])/5 +
2 Sqrt[3] x[t]^2 - (3 m[t] x[t]^2)/5 +
2 Sqrt[3] y[t] + (3 m[t] y[t])/10 +
2 Sqrt[3] z[t] + (6 m[t] z[t])/5 -
z[t]^2/(4 Sqrt[3]) - (m[t] z[t]^2)/20, x[ic] == xx, y[ic] == yy,
m[ic] == mm, z[ic] == zz, r[ic] == rr}, {x, y^2, z, m, r}, {t, ic,
10}]
Table[{Exp[Integrate[x[t] /. s, {t, 0, i}]]}, {i, -17.5, 10, 1}]
Comments
Post a Comment