non linear differential equation

3 次查看(过去 30 天)
mohan
mohan 2012-11-30
please help me how to solve
dq/dt + q = a1 + b1*u(t) + 1/u(t)^2

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-11-30
编辑:Azzi Abdelmalek 2012-11-30
function dq=myeq(t,q,t1,u1,a1,b1)
u=interp1(t1,u1,t)
dq=-q+a1+b1+1/u^2;
%Then call myeq
a1=1;
b1=2;
q0=0;
t1=1:0.1:10; % vector time
u1=t1.^2 % your vector u
[t q]=ode45(@(t,q) myeq(t,q,t1,u1,a1,b1),t1,q0)
plot(t,q)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by