Clear Filters
Clear Filters

why i am getting weird results when giving input as a chirp signal ?

3 views (last 30 days)
Hello,
I am doing simulation with chirp signal. I am giving chirp signal as an external input to adaptive hopf oscillator.
first time i have set F0 = 100 hz and F1 = 400 hz and for 0 to 20 secs i have simulated. The initial condition i have given for hopf oscillator frequency is 90 hz ... ok results are satisfactory but when i am changing parameters like starting frequency or target frequency or simulation time ... results are changing.. for example if i am giving F0 = 100 hz and F1 = 300 hz then the graph is showing some weird results. Its not adapting frequency. why this is happening ? its not adapting frequency when parameter change ...
the folloing is my code ...
***************************
Tspan= 0:0.001:20; % time vector
f0=100;
f1=400;
fi = chirp(Tspan,f0,20,f1,'linear');
ti=Tspan;
[T,Y]=ode45(@(t,y) myeqd1(t,y,ti,fi),Tspan,[1;1;90]);
plot (T,Y(:,3));
************************************************
function
**********************************************
function dz = myeqd1(t,y,ti,fi)
dz = zeros(3,1);
mu=0.3;
r= sqrt(y(1)^2 + y(2)^2);
K=500;
F=interp1(ti,fi,t);
dz(1)= (mu - r^2)*y(1) - y(3)*y(2) +K*F;
dz(2) = (mu - r^2)*y(2) + y(3)*y(1);
dz(3) = (-K*F) * (y(2)/sqrt(y(1)^2 + y(2)^2));
***************************************************
The following figure showing for F0=100, F1 = 400 for Timespan is 20 secs...the graph showing it is going from 90hz (initial value) to adapted value 400 hz
but the second fugure shows for F0=100 and F1= 300 and simulation time is 20 secs.... the graph is going from 90 hz (initial value) to some wierd value above 1800 hz .

Answers (0)

Community Treasure Hunt

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

Start Hunting!