how to solve non linear differential equations

조회 수: 3 (최근 30일)
nune pratyusha
nune pratyusha . 2021년 3월 3일
댓글: Bjorn Gustavsson . 2021년 3월 5일
r = 1430;
a = -0.0683;
b = 0.0676;
c = 36*10^-9;
g = -0.0676;
i want to plot phase portrait of (x(t),y(t)) and plots for (t,x(t)),(t,y(t))

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 3월 3일
편집: Bjorn Gustavsson 님. 2021년 3월 4일
Have a look at the help and documentation of ode45 and the numerous ode-examples.
In brief to solve this ODE-system write a matlab-function for the derivatives:
function dxdtdydt = your_ode(t,xy,pars)
r = pars(1);
a = pars(2);
b = pars(3);
c = pars(4);
g = pars(5);
l = pars(6);
y = xy(2);
x = xy(1);
dxdt = xy(2);
dydt = -(1/r+g+a+b*abs(x)*y/c-x/(l*c));
dxdtdydt = [dxdt;
That ode you then integrate from some initial state over some time-period of interest
r = 1430;
a = -0.0683;
b = 0.0676;
c = 36*10^-9;
g = -0.0676;
pars = [r,a,b,c,g,l];
t = -0.05:0.01:0.05;
x0y0 = [0,1]; % I wouldn't know.
[t,xy] = ode45(@(t,xy) your_ode(t,xy,pars),t,x0y0);
  댓글 수: 13
Bjorn Gustavsson
Bjorn Gustavsson 2021년 3월 5일
Well the solution does not look like a sine-wave. That is because I have yet another typo in the ODE, you will surely find it if you look close and read the code, and think about what you need to obtain an oscillating solution.

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by