Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2009-06-17, 07:43   #1
jy00295005
初级会员
 
注册日期: 2009-04-23
年龄: 40
帖子: 4
声望力: 0
jy00295005 正向着好的方向发展
默认 求助:ode 运算中matlab busy的问题

我在用ode45时matlab显示busy,不知大家有没有心得,该怎么解决,我把代码贴出来看下,variables比较多。帮忙看下。

function:
function [dy] = rate_equation3(t,y)

dy = zeros(4,1);

Gn = 2.2e-19;
gcf=5.2e-20; %gcf=gain compression factor
cff=0.746; %confinement factor
alpha=6.5; %linewidth enhancemnet factor
q = 1.6e-19; % electron charge
v = 3.75e-14; % modal volume
I = 2.5; %constant input current
tua_p = 2.05e-12; %photo life time
tua_e = 0.126e-9; %carrier life time
N0 = 3.0e21; %carrier density at transparency
g = Gn*(y(2)-N0)*(1-gcf*y(3)); %nonliear gain expression

%E(t)
dy(1)=0.5*(cff*g-1/tua_p)*y(1)+i*alpha/2*(cff*gcf*(y(2)-N0)-tua_p)*y(1);
%N(t)
dy(2)=I/(q*v)-y(2)/tua_e-g*y(3);
%S(t)
dy(3)=abs(y(1).^2);
%phase
dy(4)=unwrap(angle(y(1)));

call function:
clc
clear all
close all


TSPAN = [0 5];
Y0 =[0 0 0 0];

[T,Y] = ODE45(@rate_equation3,TSPAN,Y0);

figure(1)

subplot(2,1,1)
plot(T ,Y(:,1))
title('plot of ')

subplot(2,1,2)
plot(T,Y(:,2))
title('plot of ')

figure(2)
subplot(2,1,1)
plot(T ,Y(:,3))
tittle('plot')

subplot(2,1,2)
plot(T ,Y(:,4))
tittle('plot')
jy00295005 当前离线   回复时引用此帖
回复

主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 16:29


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.