Mathematica的NDsolve指令怎么用?
m=1;n=1;a1=1;a2=1;r=1;sol=NDSolve[{x1'[N]==-3*x1[N]*(1+m*x1[N]^2-n*x2[N]^2-r*(1+m*x1[...
m = 1; n = 1; a1 = 1; a2 = 1; r = 1;
sol = NDSolve[{x1'[
N] == -3*
x1[N]*(1 + m*x1[N]^2 - n*x2[N]^2 -
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2) -
Sqrt[6]*a1*y1[N]^2/2,
y1'[N] ==
3*y1[N]*(-m*x1[N]^2 + n*x2[N]^2 +
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2 -
a1*Sqrt[6]*x1[N]/6),
x2'[N] == -3*
x2[N]*(1 + m*x1[N]^2 - n*x2[N]^2 -
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2) +
Sqrt[6]*a2*y2[N]^2/2,
y2'[N] ==
3*y2[N]*(-m*x1[N]^2 + n*x2[N]^2 +
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2 -
a2*Sqrt[6]*x2[N]/6), x1[0] == 0.05, y1[0] == 0.75,
x2[0] == 0.05, y2[0] == 0, 75}, {x1[N], y1[N], x2[N], y2[N]}, {N,
0, 10}]
t = 1; Evaluate[{x1[t], y1[t], x2[t], y2[t]} /. sol]
我想计算数值解,但总是不行。
mathematica提示说:ReplaceAll::reps: {<<1>>} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>
____________________
t = 1; Evaluate[{x1[t], y1[t], x2[t], y2[t]} /. sol],这个是用来显示解的值的。请指教。
我已经知道问题的答案在哪了。各位就不用再费劲了~至于悬赏分,就看情况吧。 展开
sol = NDSolve[{x1'[
N] == -3*
x1[N]*(1 + m*x1[N]^2 - n*x2[N]^2 -
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2) -
Sqrt[6]*a1*y1[N]^2/2,
y1'[N] ==
3*y1[N]*(-m*x1[N]^2 + n*x2[N]^2 +
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2 -
a1*Sqrt[6]*x1[N]/6),
x2'[N] == -3*
x2[N]*(1 + m*x1[N]^2 - n*x2[N]^2 -
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2) +
Sqrt[6]*a2*y2[N]^2/2,
y2'[N] ==
3*y2[N]*(-m*x1[N]^2 + n*x2[N]^2 +
r*(1 + m*x1[N]^2 - m*y1[N]^2 - n*x2[N]^2 - n*y2[N]^2)/2 -
a2*Sqrt[6]*x2[N]/6), x1[0] == 0.05, y1[0] == 0.75,
x2[0] == 0.05, y2[0] == 0, 75}, {x1[N], y1[N], x2[N], y2[N]}, {N,
0, 10}]
t = 1; Evaluate[{x1[t], y1[t], x2[t], y2[t]} /. sol]
我想计算数值解,但总是不行。
mathematica提示说:ReplaceAll::reps: {<<1>>} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>
____________________
t = 1; Evaluate[{x1[t], y1[t], x2[t], y2[t]} /. sol],这个是用来显示解的值的。请指教。
我已经知道问题的答案在哪了。各位就不用再费劲了~至于悬赏分,就看情况吧。 展开
3个回答
展开全部
太乱了,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
学问社区——mathematica小组里面好多类似的问题,你可以去看看,挺不错的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-05-28
展开全部
Please replace the ',' to '.'. OK?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询