马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我按照天津大学张琪昌所著《分岔与混沌理论及应用》上给的程序算书上62页的例子4.4.1,
报错,程序所读取的文本文件center.txt必须和程序在同一目录下吗?
代码:
center.txt
[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]
centerdimension=1;
dx[1]=x[1] y[1];
dy[1]=-y[1]+arf*x[1]^2;
korder=5;
total=2;
[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]
[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]
ReadList["center.txt"]
remainder = total - centerdimension
aa = Table[a[i, j], {i, remainder}, {j, 2, korder}];
hx = Table[0, {remainder}];
Do[hx = Sum[a[i, j] x[1]^j, {j, 2, korder}] +
O[x[1]]^(korder + 1), {i, 1, remainder}];
my = Table[0, {remainder}];
Do[y = hx[], {i, 1, remainder}];
Do[nx = D[hx[], x[1]] dx[1] - dy == 0; my[] = LogicalExpand[nx], {i,
1, remainder}];
myok = Flatten[my];
aij1 = Flatten[aa];
my2 = Solve[myok, aij1];
my2 = Flatten[my2];
dx[1] = Simplify[dx[1] /. my2];
dx[1] = Normal[dx[1]];
centermaniford = {}
Do[dx[jj] = dx[jj];
dx[jj] = Expand[dx[jj]];
len = Length[dx[jj]];
eff = Table[0, {len}];
Do[item = dx[jj][];
ee = 0; Do[eii = Exponent[item, x[ii]];
ee = ee + eii;, {ii, 1, centerdimension}];
If[ee > korder, eff[] = eff[], eff[] =
eff[] + item];, {i, 1, len}];
dx[jj] = 0;
len1 = Length[eff];
Do[dx[jj] = dx[jj] + eff[];, {i, 1, len1}];
centermaniford = Join[{dx[jj]}, centermaniford];, {jj, 1, centerdimension}]
centermaniford = Reverse[centermaniford]
centermaniford = Simplify[centermaniford]
[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]
报错: |