trying to implement nonlinear ODE equation
Show older comments
i have three nonlinear oscillator equation
1 ) dx/dt = (mu-r^2)x - w*y +K*F
2) dy/dt = (mu-r^2)y + w*x
3) dw/dt = (-K*F)*(y/(sqrt(x^2+y^2)))
here,
F is any input signal
K is coupling strength (K > 0 is any value)
w is oscillator intrinsic frequency
mu is constant (mu > 0 any value)
r is taking as a constant here .. r=1
third equation dw/dt is learning rule for intrinsic frequency (as w learn frequency of input signal F) and i am getting stuck in this part of equation that how could i implement this part and integrate it in matlab code ?
x and y are state variables.
the following is matlab code without third equation and i want to integrate third equation in this code.
*******************************************
function dz = myeqd(t,y,ti,fi)
dz = zeros(2,1);
mu=0.7;
r=1;
K=1;
w=40;
F=interp1(ti,fi,t);
dz(1)= (mu - r^2)*y(1) - w*y(2) +K*F;
dz(2) = (mu - r^2)*y(2) + w*y(1);
********************************************
calling this myeqd function
Tspan= [0.1:0.1:10]; % time vector
t= Tspan;
fi = cos(2*pi*Tspan); % perturbation
ti=Tspan;
[T,Y]=ode45(@(t,y) myeqd(t,y,ti,fi),Tspan,[0;1]);
plot (T,Y)
**********************************************
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!