mathematica的程序
楼主 · 1 楼
s1=NDSolve[{y'[x]==x^2+y[x]^2,y[0]==0},y,{x,-2,2}]
y = y /. s1[[1]]
Plot[y[x], {x, -2, 2}, AspectRatio -> Automatic, PlotRange -> {-1.5, 1.5}]
在上述程序中,s1[[1]]能否改为s1,为什么?能否写为s1[[2]],为什么?
y = y /. s1[[1]]
Plot[y[x], {x, -2, 2}, AspectRatio -> Automatic, PlotRange -> {-1.5, 1.5}]
在上述程序中,s1[[1]]能否改为s1,为什么?能否写为s1[[2]],为什么?