24小时热门版块排行榜    

查看: 252  |  回复: 3

我要飞

铁虫 (正式写手)

[求助] 为何出错?

请大家看看这个程序为何出错?如何修改?谢谢了!
function [T, Y]=FOChen(parameters, orders, TSim, Y0)
%
format long e
% Numerical Solution of the Fractional-Order Chen's System
%
%   D^q1 x(t) = a(y(t)-x(t))
%   D^q2 y(t) = dx(t) - x(t)z(t) + cy(t)
%   D^q3 z(t) = x(t)y(t) - bz(t)
%
% function [T, Y] = FOChen(parameters, orders, TSim, Y0)
%
% Input:    parameters - model parameters [a, b, c, d]
%           orders - derivatives orders [q1, q2, q3]
%           TSim - simulation time (0 - TSim) in sec
%           Y0 - initial conditions [Y0(1), Y0(2), Y0(3)]
%
% Output:   T - simulation time (0 : Tstep : TSim)
%           Y - solution of the system (x=Y(1), y=Y(2), z=Y(3))
%
% Author:  (c) Ivo Petras (ivo.petras@tuke.sk), 2010.
%

% time step:
h=0.005;
% number of calculated mesh points:
n=100/h;
%orders of derivatives, respectively:
q1=0.99; q2=0.96; q3=0.92;
% constants of Chen's system:
a=10; b=1;
c=1; d=5;
% binomial coefficients calculation:
cp1=1; cp2=1; cp3=1;
for j=1:n
    c1(j)=(1-(1+q1)/j)*cp1;
    c2(j)=(1-(1+q2)/j)*cp2;
    c3(j)=(1-(1+q3)/j)*cp3;
    cp1=c1(j); cp2=c2(j); cp3=c3(j);
end
% initial conditions setting:
x(1)=0.5; y(1)=0.6; z(1)=0.1;
% calculation of phase portraits /numerical solution/:
for i=2:n
    x(i)=(a*(y(i-1)-x(i-1)))*h^q1 - memo(x, c1, i);
    y(i)=(-d*x(i)-x(i)*z(i-1)+c*y(i-1))*h^q2 - memo(y, c2, i);
    z(i)=(x(i)*y(i)-b*z(i-1))*h^q3 - memo(z, c3, i);
end
for j=1:n
    Y(j,1)=x(j);
    Y(j,2)=y(j);
    Y(j,3)=z(j);
end
T=h:h:TSim;
%

[ Last edited by 我要飞 on 2011-11-18 at 10:00 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

引用回帖:
1楼: Originally posted by 我要飞 at 2011-11-18 09:34:21:
请大家看看这个程序为何出错?如何修改?谢谢了!
function [T, Y]=FOChen(parameters, orders, TSim, Y0)
%
format long e
% Numerical Solution of the Fractional-Order Chen's System
%
%   D^q1 ...

我估计运行时,可能会缺少某些函数,例如memo没有定义
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2011-11-18 10:18:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

我要飞

铁虫 (正式写手)

引用回帖:
2楼: Originally posted by dbb627 at 2011-11-18 10:18:17:
我估计运行时,可能会缺少某些函数,例如memo没有定义

请问这个如何修改就可以了?谢谢了
3楼2011-11-18 10:25:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

这个需要你看这个程序的出处,找到完整的程序代码。包括这个程序里面所用其他函数,主要是memo

[ Last edited by dbb627 on 2011-11-18 at 10:31 ]
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
4楼2011-11-18 10:30:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 我要飞 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +4 Tide man 2026-08-11 4/200 2026-08-12 00:39 by liuqidi
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 9/450 2026-08-11 22:12 by 医学老男孩
[基金申请] 有时候,自然基金真的不能太认真 (我的申报经验) +3 majunge000 2026-08-11 4/200 2026-08-11 20:13 by lch2012
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[硕博家园] 读博的好处 +3 lnee 2026-08-11 3/150 2026-08-11 18:10 by 希望我好好的
[论文投稿] 职称评审,求友友推荐见刊最快的期刊 +3 工厂打螺丝 2026-08-08 3/150 2026-08-11 13:42 by 会议编辑
[基金申请] 听说今天filecode变了 +26 布布和一二 2026-08-06 49/2450 2026-08-11 13:18 by WH3796
[基金申请] filecode +9 documentary 2026-08-10 9/450 2026-08-11 10:08 by wk7465
[基金申请] 关于代码变化问题,想知道的进来 +17 且听虎啸 2026-08-07 24/1200 2026-08-10 18:35 by zhangduo2008
[基金申请] 静等基金结果 +5 gjjjzhong 2026-08-10 16/800 2026-08-10 17:19 by Tide man
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
信息提示
请填处理意见