i need to draw bifurcation and lyapunav for duffing oscillator can anyone help to solve

3 次查看(过去 30 天)
function duffing_oscillator clear all
amp=0.40; % control parameter
alpha=0.5;
beta=-1.0;
gamma=1;
w=1;
tspan = 0:0.1:800; %time step and initial condition
x10 = 0.5021; x20 = 0.17606;
y0 = [x10; x20];
[~,y] = ode45(@(t,x) f(t,x,alpha,beta,gamma,amp,w),tspan,y0);
x1=y(:,1); x2=y(:,2);
plot(x1,x2); %plot the variable x and y
xlabel ('x1');
ylabel ('x2');
title('phase portrait of duffing oscillator');
function dy = f(t,y,alpha,beta,gamma,amp,w)
x1 = y(1); x2 = y(2);
dx1=x2;
dx2=-alpha*x2-beta*x1-gamma*x1^3+amp*sin(w*t);
dy = [dx1; dx2];

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by