mathematica不显示图像g = 9.8; R = 6.37 10^6; tm = 10s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0,x[0] == 2 R},x[t],{t,0,tm}]x = x /.s[[1]]Plot[x[t],{t,0,tm},PlotStyle -> Thickness[0.004],AxesStyle -> Thickness[0.003]]Clear[g,R,tm,x,t,s]请

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 03:43:55
mathematica不显示图像g = 9.8; R = 6.37 10^6; tm = 10s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0,x[0] == 2 R},x[t],{t,0,tm}]x = x /.s[[1]]Plot[x[t],{t,0,tm},PlotStyle -> Thickness[0.004],AxesStyle -> Thickness[0.003]]Clear[g,R,tm,x,t,s]请

mathematica不显示图像g = 9.8; R = 6.37 10^6; tm = 10s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0,x[0] == 2 R},x[t],{t,0,tm}]x = x /.s[[1]]Plot[x[t],{t,0,tm},PlotStyle -> Thickness[0.004],AxesStyle -> Thickness[0.003]]Clear[g,R,tm,x,t,s]请
mathematica不显示图像
g = 9.8; R = 6.37 10^6; tm = 10
s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0,x[0] == 2 R},
x[t],{t,0,tm}]
x = x /.s[[1]]
Plot[x[t],{t,0,tm},PlotStyle -> Thickness[0.004],
AxesStyle -> Thickness[0.003]]
Clear[g,R,tm,x,t,s]
请问以上代码哪里有误
范围无论怎么取都只有坐标系,另外注意R的表达式是有乘号的
程序也没提示有误,只是没图
mathematica9.0

mathematica不显示图像g = 9.8; R = 6.37 10^6; tm = 10s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0,x[0] == 2 R},x[t],{t,0,tm}]x = x /.s[[1]]Plot[x[t],{t,0,tm},PlotStyle -> Thickness[0.004],AxesStyle -> Thickness[0.003]]Clear[g,R,tm,x,t,s]请

最简单的改法,把NDSolve里面的x[t]改成x,即:

s = NDSolve[{(x'[t])^2 - 2 (g R^2)/x[t] + g R == 0, x[0] == 2 R}, x, {t, 0, tm}]

不过这样子还是和没图差不多,理由嘛,是因为你这个解出来基本就是个常数函数并且因为解的误差的关系还含了小的虚部(对于这个可以用Chop之类的舍掉小的虚部或者直接用Re取实部).唉呀不过说到底没什么意义啊这个,反正画来画去就是一根平的直线.你可以代几个数试一下.