新手,求如何将c[t]循环十次在t=10处的值弄到数组里,跪谢
mathematica吧
全部回复
仅看楼主
level 1
刚学Mathematica,编了下面的程序,想把循环了十次、t=10时的十个c[t]的值放到一个数组里,用了ReplacePart发现不好用,求怎么办,程序如下,跪谢大佬们
Clear["Global`*"]
f[0] = Table[0, 10]
For[j = 1, j < 11, j++,
s = NDSolve[{
D[a[t], t] ==
j*1*^0 (b[t] - a[t]) + 5*^0 (1 - a[t] - b[t] - c[t]),
D[b[t], t] == -j*1*^0 (b[t] - a[t]) - 5*^0 b[t],
D[c[t], t] ==
5*^0 b[t] +
5*^1 Round[(t + 1)/10] (1 - a[t] - b[t] - 2 c[t]) - (1*^-4 +
1*^-5) c[t],
a[0] == 1,
b[0] == 0,
c[0] == 0},
{a[t], b[t], c[t]}, {t, 0, 10}]
]
2020年02月26日 08点02分 1
吧务
level 10
c[10] /. Table[First@NDSolve[eqns, {a,b,c}, {t,0,10}], {j, 10}]
2020年02月28日 05点02分 2
吧务
level 15
这个用ParametricNDSolve更方便。
2020年02月29日 03点02分 3
1