高手帮忙分析下(关于matcont的一个问题) 不会占用您多少时间的 谢谢!
高手帮忙分析下(关于matcont的一个问题) 不会占用您多少时间的 谢谢!我完全按照matcont的manual上平衡点的那个例子(bratu) 但是matlab还是报错:
>> =init_EP_EP(@bratu,,p,ap);
??? Error: File: bratu.m Line: 48 Column: 1
The function "bratu" was closed
with an 'end', but at least one other function definition was not.
To avoid confusion when using nested functions,
it is illegal to use both conventions in the same file.
我是新手 哪位愿意和我讨论的 请加我qq:652491109
Error in ==> init_EP_EP at 15
func_handles = feval(odefile);
去掉end后 这项命令可以运行了
但是到最后一步又报错:
>> =cont(@equilibrium,x0,[],opt);
??? Error using ==> feval
Argument must contain a string or function_handle.
Error in ==> cjacp at 11
j = feval(jacobianp, 0, x, p{:});
Error in ==> equilibrium>jacobian at 29
jac = ;
Error in ==> cjac at 52
j = feval(jacobian,x);
Error in ==> newtcorr at 14
B = ); v'];
Error in ==> cont>CorrectStartPoint at 753
= newtcorr(x0, v0);
Error in ==> cont at 208
= CorrectStartPoint(x0, v0);
附程序:bratu.m
function out =bratu
out{1}=@init;
out{2}=@fun_eval;
out{3}=@jacobian;
out{4}=[];
out{5}=@hessians;
out{6}=@hessiansp;
out{7}=[];
out{8}=[];
out{9}=[];
out{10}=@userf1;
end
%-----------------------------------------------------------
function dydt=fun_eval(t,kmrgd,a)
dydt=[-2*kmrgd(1)+kmrgd(2)+a*exp(kmrgd(1));
kmrgd(1)-2*kmrgd(2)+a*exp(kmrgd(2))];
%-----------------------------------------------------------
function =init
tspan=;
y0=;handles=feval(@bratu)
options=odeset('Jacobian',handles(3),'JacobianP','handles(4)','Hessians',handles(5),'Hessiansp',handles(6));
%-----------------------------------------------------------
function jac=jacobian(t,kmrgd,a)
jac=[-2+a*exp(kmrgd(1))1
1 -2+a*exp(kmrgd(2)) ];
%-----------------------------------------------------------
function jacp=jacobianp(t,kmrgd,a)
jacp=[exp(kmrgd(1))
exp(kmrgd(2))];
%-----------------------------------------------------------
function hess=hessians(t,kmrgd,a)
hess1=[;];
hess2=[;];
hess(:,:,1)=hess1;
hess(:,:,2)=hess2;
%-----------------------------------------------------------
function hessp=hessiansp(t,kmrgd,a)
hessp1=[;];
hessp(:,:,1)=hessp1;
%-----------------------------------------------------------
function userfun1=userf1(t,kmrgd,a)
userfun1=a-0.2;
应该输入的命令行:
>> global cds
>> p=0;ap=1;
>> =init_EP_EP(@bratu,,p,ap);
>> opt=contset;opt=contset(opt,'MaxNumPoints',50);
>> opt=contset(opt,'Singularities',1);
>> opt=contset(opt,'Userfunctions',1);
>> UserInfo.name='userf1';UserInfo.state=1;UserInfo.label='u1';
>> opt=contset(opt,'UserfunctionsInfo',UserInfo);
>> =cont(@equilibrium,x0,[],opt);
回复 楼主 cnee 的帖子
matcont是什么东西啊?好像这里懂的人不多啊。回复 楼主 cnee 的帖子
init_EP_EPcontset
cont
这些函数都是LZ自己编的吗? 不懂,如果是你自己的我觉得你的水平比我高 init_EP_EP
contset
cont
这些函数都是matlab自带的
有会的吗 谢谢帮忙了!!!
回复 5楼 cnee 的帖子
这些函数应该不是matlab自带的,用doc init_EP_EP
doc contset
doc cont
显示Reference Page Not Found
页:
[1]