天津大学张琪昌等编的<分岔与混沌理论及应用>中Mathematica程序1
一维:aa = Table, {i, remainder}, {j, 2, korder}];
hx = Table;
Do = Sum
x^j, {j, 2, korder}] + O]^(korder + 1), {i, 1, remainder}];
my = Table;
Do, {i, 1, remainder}];
Do, x] dx - dy == 0; my[] = LogicalExpand, {i,
1, remainder}];
myok = Flatten;
aij1 = Flatten;
my2 = Solve;
my2 = Flatten;
dx = Simplify /. my2];
dx = Normal];
centermaniford = {}
Do = dx;
dx = Expand];
len = Length];
eff = Table;
Do[];
ee = 0; Do[
eii = Exponent];
ee = ee + eii;
, {ii, 1, centerdimension}];
If = eff[], eff[] = eff[] + item];
, {i, 1, len}];
dx = 0;
len1 = Length;
Do[
dx = dx + eff[];
, {i, 1, len1}];
centermaniford = Join[{dx}, centermaniford];
, {jj, 1, centerdimension}]
centermaniford = Reverse
centermaniford = Simplify
天津大学张琪昌等编的<分岔与混沌理论及应用>中Mathematica程序2
remainder = total - centerdimension;ahij2 = {};
Do[
Do[
Do[
i = l - j; ahij2 = Join[{a}, ahij2]
, {j, 0, l}]
, {l, 2, korder}]
, {h, 1, remainder}];
Do[
hyx = 0;
Sum x^i x^
j, {j, 0, l}], {l, 2, korder}];
y = hyx
, {h, 1, remainder}];
nx = Table;
coe = {};
Do[
nx[] = Sum, x] dx, {ii, 1, centerdimension}] - dy
, {h, 1, remainder}];
Do[
Do[
Do[
i = ip - j;
mycoe = Coefficient], x, i];
mycoe = Coefficient, j] /. {x -> 0, x -> 0};
coe = Join[{mycoe == 0}, coe]
, {j, 0, ip}]
, {ip, 2, korder}]
, {h, 1, remainder}];
me = Solve;
me = Flatten;
Do[
y = y /. me
, {i, 1, remainder}];
centermaniford = {}
Do[
dx = dx;
dx = Expand];
len = Length];
eff = Table;
Do[
item = dx[];
ee = 0;
Do[
eii = Exponent];
ee = ee + eii;
, {ii, 1, centerdimension}];
If = eff[], eff[] = eff[] + item];
, {i, 1, len}];
dx = 0;
len1 = Length;
Do[
dx = dx + eff[];
, {i, 1, len1}];
centermaniford = Join[{dx}, centermaniford];
, {jj, 1, centerdimension}]
centermaniford = Reverse
centermaniford = Simplify
天津大学张琪昌等编的<分岔与混沌理论及应用>中Mathematica程序3
remainder = total - centerdimension;ahij2 = {};
Do[
Do[
Do[
i = l - j; ahij2 = Join[{a}, ahij2]
, {j, 0, l}]
, {l, 2, korder}]
, {h, 1, remainder}];
Do[
hyx = 0;
Sum x^i x^
j, {j, 0, l}], {l, 2, korder}];
y = hyx
, {h, 1, remainder}];
nx = Table;
coe = {};
Do[
nx[] = Sum, x] dx, {ii, 1, centerdimension}] - dy
, {h, 1, remainder}];
Do[
Do[
Do[
i = ip - j;
mycoe = Coefficient], x, i];
mycoe = Coefficient, j] /. {x -> 0, x -> 0};
coe = Join[{mycoe == 0}, coe]
, {j, 0, ip}]
, {ip, 2, korder}]
, {h, 1, remainder}];
me = Solve;
me = Flatten;
Do[
y = y /. me
, {i, 1, remainder}];
centermaniford = {}
Do[
dx = dx;
dx = Expand];
len = Length];
eff = Table;
Do[
item = dx[];
ee = 0;
Do[
eii = Exponent];
ee = ee + eii;
, {ii, 1, centerdimension}];
If = eff[], eff[] = eff[] + item];
, {i, 1, len}];
dx = 0;
len1 = Length;
Do[
dx = dx + eff[];
, {i, 1, len1}];
centermaniford = Join[{dx}, centermaniford];
, {jj, 1, centerdimension}]
centermaniford = Reverse
centermaniford = Simplify
天津大学张琪昌等编的<分岔与混沌理论及应用>中Mathematica程序规范形
remainder = total - centerdimension;ahij2 = {};
Do[
Do[
Do[
i = l - j; ahij2 = Join[{a}, ahij2]
, {j, 0, l}]
, {l, 2, korder}]
, {h, 1, remainder}];
Do[
hyx = 0;
Sum x^i x^
j, {j, 0, l}], {l, 2, korder}];
y = hyx
, {h, 1, remainder}];
nx = Table;
coe = {};
Do[
nx[] = Sum, x] dx, {ii, 1, centerdimension}] - dy
, {h, 1, remainder}];
Do[
Do[
Do[
i = ip - j;
mycoe = Coefficient], x, i];
mycoe = Coefficient, j] /. {x -> 0, x -> 0};
coe = Join[{mycoe == 0}, coe]
, {j, 0, ip}]
, {ip, 2, korder}]
, {h, 1, remainder}];
me = Solve;
me = Flatten;
Do[
y = y /. me
, {i, 1, remainder}];
centermaniford = {}
Do[
dx = dx;
dx = Expand];
len = Length];
eff = Table;
Do[
item = dx[];
ee = 0;
Do[
eii = Exponent];
ee = ee + eii;
, {ii, 1, centerdimension}];
If = eff[], eff[] = eff[] + item];
, {i, 1, len}];
dx = 0;
len1 = Length;
Do[
dx = dx + eff[];
, {i, 1, len1}];
centermaniford = Join[{dx}, centermaniford];
, {jj, 1, centerdimension}]
centermaniford = Reverse
centermaniford = Simplify 能不能介绍一下这三个程序? 原帖由 ieluxinhua 于 2006-11-14 15:54 发表
能不能介绍一下这三个程序?
自己找《分岔与混沌理论及应用》对照看一下就行了 将这个程序用来计算实际问题时,无法得到正确结果,我试过几个"centerdimension=2"的例子,不知是何原因。
看来这个程序只能计算张琪昌<分岔与混沌理论及应用>书中的例4.4.1,输出正确的结果,其它问题的计算均报错。 应该不会吧,我都试过啊 原帖由 yzsldj 于 2006-11-18 11:05 发表
将这个程序用来计算实际问题时,无法得到正确结果,我试过几个"centerdimension=2"的例子,不知是何原因。
看来这个程序只能计算张琪昌<分岔与混沌理论及应用>书中的例4.4.1,输出正确的结果, ...
可以把你的例子给一下,大家看看 我的问题是:
centerdimension=3;
dx=y+x*z;
dy=-x+y*z-x*w;
dz=0;
dw=-w+alpha*x^2;
korder=5;
total1=4;
要么出错,要么无输出结果。
我把代码也附上,请大家看看问题出在哪里。
This program is to compute the centermaniford
ReadList["e:\center1.txt"]
remainder=total1-centerdimension
"******************************"
"To compute the zero space of the stable maniford and y"
"******************************"
If [centerdimension==1,
aa=Table,{i,remainder},{j,2,korder}];
hx=Table;
Do[
hx[]=Sum x^j,{j,2,korder}]+O]^(korder+1),{i,1, remainder }];
my=Table;
Do[
y=hx[],{i,1,remainder}];
Do[
nx=D],x] dx-dy==0;
my[]=LogicalExpand
,{i,1,remainder}];
myok=Flatten;
aij1=Flatten;
my2=Solve;
my2= Flatten ;
dx=Simplify/.my2];
dx=Normal];
]
If[centerdimension==2,
ahij2={};
Do[
Do[
Do[
i=l-j; ahij2=Join[{a},ahij2]
,{j,0,l}]
,{l,2,korder}]
,{h,1,remainder}];
Do[
hyx=0;
Sum x^i x^j,{j,0,l}],{l,2,korder}];
y=hyx
,{h,1,remainder}] ;
nx=Table ;
coe={};
Do[
nx[]=Sum,x] dx,{ii,1,centerdimension}]-dy
,{h,1,remainder}];
Do[
Do[
Do[
i=ip-j;
mycoe=Coefficient],x,i];
mycoe=Coefficient,j]/.{x->0,x->0} ;
coe=Join[{mycoe==0},coe]
,{j,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
me=Solve;
me=Flatten;
Do[
y=y/.me
,{i,1,remainder}];
]
If[centerdimension==3,
ahijp3={};
Do[
Do[
Do[
Do[
p=ip-i-j;
ahijp3=Join[{a},ahijp3]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
Do[
hyx=0;
Do[
Do[
Do[
p=ip-i-j;
hyx=hyx+a x^i x^j x^p
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}];
y=hyx;
,{h,1,remainder}];
nx=Table;
coe={};
Do[
nx[]=Sum,x] dx,{ii,1,centerdimension}]-dy
,{h,1,remainder}];
Do[
Do[
Do[
Do[
p=ip-i-j ;
mycoe=Coefficient],x,i];
mycoe=Coefficient,j] ;
mycoe=Coefficient,p]/.{x->0,x->0,x->0};
coe=Join[{mycoe==0},coe]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
me=Solve;
me=Flatten;
Do=y/.me,{i,1,remainder}];
]
If[centerdimension==4,
ahijpl4={};
Do[
Do[
Do[
Do[
Do[
l=ip-i-j-p;
ahijp14=Join[{a},ahijpl4]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
Do[
hyx=0;
Do[
Do[
Do[
Do[
l=ip-i-j-p;
hyx=hyx+a x^i x^j x^p x^l;
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}];
y=hyx;
,{h,1,remainder}];
nx=Table ;
coe={} ;
Do[
nx[]=Sum,x] dx,{ii,1,centerdimension}]-dy
,{h,1,remainder}] ;
Do[
Do[
Do[
Do[
Do[
l=ip-i-j-p;
mycoe=Coefficient],x,i];
mycoe=Coefficient,j] ;
mycoe=Coefficient,p] ;
mycoe=Coefficient,l]/.{x->0,x->0,x->0,x->0};
coe=Join[{mycoe==0},coe]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}] ;
me=Solve ;
me=Flatten;
Do[
y=y/.me
,{i,1,remainder}];
]
If[centerdimension==5,
ahijplm5={};
Do[
Do[
Do[
Do[
Do[
Do[
m=ip-i-j-p-l;
ahijplm5=Join[{a},ahijplm5]
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
Do[
hyx=0;
Do[
Do[
Do[
Do[
Do[
m=ip-i-j-p-l;
hyx=hyx+a x^i x^j x^p x^l x^m;
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}];
y=hyx;
,{h,1,remainder}];
nx=Table ;
coe={} ;
Do[
nx[]=Sum,x] dx,{ii,1,centerdimension}]-dy
,{h,1,remainder}] ;
Do[
Do[
Do[
Do[
Do[
Do[
m=ip-i-j-p-l;
mycoe=Coefficient],x,i];
mycoe=Coefficient,j] ;
mycoe=Coefficient,p] ;
mycoe=Coefficient,l] ;
mycoe=Coefficient,m]/.{x->0,x->0,x->0,x->0,x->0} ;
coe=Join[{mycoe==0},coe]
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}] ;
Print[ "To solve the equation"];
me=Solve ;
me=Flatten;
Do[
y=y/.me,
{i,1,remainder}];
]
If[centerdimension==6,
ahijplmn6={};
Do[
Do[
Do[
Do[
Do[
Do[
Do[
n=ip-i-j-p-l-m;
ahijplmn6=Join[{a},ahijplmn6];
,{m,0,ip-i-j-p-l}]
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}];
Do[
hyx=0;
Do[
Do[
Do[
Do[
Do[
Do[
n=ip-i-j-p-l-m;
hyx=hyx+a x^i x^j x^p x^l x^m x^n;
,{m,0,ip-i-j-p-l}]
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}];
y=hyx;
,{h,1,remainder}];
nx=Table ;
coe={} ;
Do[
nx[]=Sum,x] dx,{ii,1,centerdimension}]-dy
,{h,1,remainder}] ;
Do[
Do[
Do[
Do[
Do[
Do[
Do[
n=ip-i-j-p-l-m;
mycoe=Coefficient],x,i];
mycoe=Coefficient,j] ;
mycoe=Coefficient,p] ;
mycoe=Coefficient,l] ;
mycoe=Coefficient,m] ;
mycoe=Coefficient,n]/.{x->0,x->0,x->0,x->0,x->0,x->0} ;
coe=Join[{mycoe==0},coe]
,{m,0,ip-i-j-p-l}]
,{l,0,ip-i-j-p}]
,{p,0,ip-i-j}]
,{j,0,ip-i}]
,{i,0,ip}]
,{ip,2,korder}]
,{h,1,remainder}] ;
Print[ "To solve the equation "];
me=Solve ;
me=Flatten;
Do[
y=y/.me,{i,1,remainder}];
]
"******************************"
"To compute the centermaniford and crop the higher order items"
"******************************"
centermaniford={}
Do[
dx=dx;
dx=Expand];
len=Length];
eff=Table;
Do[
item=dx[];
ee=0;
Do[
eii=Exponent];
ee=ee+eii;
,{ii,1,centerdimension}];
If]=eff[],eff[]=eff[]+item];
,{i,1,len}];
dx=0;
len1=Length;
Do[
dx=dx+eff[];
,{i,1,len1}];
centermaniford=Join[{dx},centermaniford];
,{jj,1,centerdimension}]
centermaniford=Reverse>>e:\center.out
centermaniford=Simplify
Print["This is the end of the program"] 一个不错的东西,顶上来!希望需要的人参考。程序中确实存在问题。有兴趣的可以一起研究一下! 这本书我看了一两遍了,后面的程序还没有算过,我还打算用这些程序出点结果呢,不会真的有问题吧,我也拿例子试试看! 试一下,才知道真正的问题在那里 我算了一下书上的例4.4.1,为什么出来的结果是这样子的啊? 原帖由 octopussheng 于 2007-6-28 21:05 发表 http://www.chinavib.com/forum/images/common/back.gif
我算了一下书上的例4.4.1,为什么出来的结果是这样子的啊?
没有这本书,能够把详细内容贴一下?