这个代码怎样才能运行呀?

function [T, Y]=FOLorenz(parameters, orders, TSim, Y0)
%
% Numerical Solution of the Fractional-Order Lorenz's System
%
%   D^q1 x(t) = sigma(y(t)-x(t))
%   D^q2 y(t) = x(t)(rho - z(t)) - y(t)
%   D^q3 z(t) = x(t)y(t) - beta z(t)
%
% function [T, Y] = FOLorenz(parameters, orders, TSim, Y0)
%
% Input:    parameters - model parameters [sigma, rho, beta]
%           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=round(TSim/h);
%orders of derivatives, respectively:
q1=orders(1); q2=orders(2); q3=orders(3);
% constants of Lorenz's system:
sigma=parameters(1); rho=parameters(2); beta=parameters(3);
% 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)=Y0(1); y(1)=Y0(2); z(1)=Y0(3);
% calculation of phase portraits /numerical solution/:
for i=2:n
    x(i)=(sigma*(y(i-1)-x(i-1)))*h^q1 - memo(x, c1, i);
    y(i)=(x(i)*(rho-z(i-1))-y(i-1))*h^q2 - memo(y, c2, i);
    z(i)=(x(i)*y(i)-beta*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;

%                                         


这个代码在参数加在哪里才能运行?求大佬!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值