【发布时间】:2016-05-18 00:34:47
【问题描述】:
我是第一次研究随机微分方程。我正在寻找模拟和求解二维随机微分方程。
型号如下:
dp=F(t,p)dt+G(t,p)dW(t)
地点:
- p 是一个 2×1 向量:p=(theta(t); phi(t))
- F 是一个列向量:F=(sin(theta)+Psi* cos(phi); Psi* cot(theta)*sin(phi))
- G 是一个 2×2 矩阵:G=(D 0;0 D/sin(theta))
- Psi 是参数,D 是扩散常数
我写的代码如下:
function MDL=gyro_2dim(Psi,D)
% want to solve for 2-by-1 vector:
%p=[theta;phi];
%drift function
F=@(t,theta,phi) [sinth(theta)+Psi.*cos(phi)-D.*cot(theta);Psi.*cot(theta).*sin(phi)];
%diffusion function
G=@(t,theta,phi) [D 0;0 D./sin(theta)];
MDL=sde(F,G)
end
然后我使用以下脚本调用该函数:
params.t0 = 0; % start time of simulation
params.tend = 20; % end time
params.dt =0.1; % time increment
D=0.1;
nPeriods=10; % # of simulated observations
Psi=1;
MDL=gyro_2dim(Psi,D);
[S,T,Z]=simulate(MDL, nPeriods,'DeltaTime',params.dt);
plot(T,S)
当我运行代码时,我收到以下错误消息:
初始条件下漂移率无效或模型不一致 尺寸。
知道如何解决这个错误吗?
【问题讨论】:
标签: matlab math stochastic