MATLAB MATLAB problem with Kapitsa pendulum

  • Thread starter Thread starter lahuxixi
  • Start date Start date
  • Tags Tags
    Matlab Pendulum
AI Thread Summary
The discussion focuses on solving the Kapitsa pendulum problem using MATLAB. Key points include deriving the analytical solution for stability criteria based on parameters A and w, with the period of oscillations expressed as 2*pi/sqrt(A^2/(2w^2)-1). Participants seek guidance on finding the trajectory shape in the phase plane and the growth rate of deviation for unstable cases. Additionally, there are inquiries about rewriting the second-order equation as a system of first-order ODEs suitable for MATLAB's ode45 function, along with creating a function file for implementation. The conversation emphasizes the importance of showing attempts at solutions to facilitate assistance.
lahuxixi
Messages
7
Reaction score
0

Homework Equations


Theory for Kapitsa pendulum predicts that the motion consists of 2 parts:
x(t)=X(t)+ x˜(t)
(1)
With fast oscillations:
x˜(t)=−AX(t)sin(wt) /(w^2)
(2)
and a slowly varying motion X(t) which satisfies the following equation,
X''=(1−(A^2)/(2w^2))X
(3)

Homework Statement


1. Find the analytical solution of the equation (3) and derive the criterion of stability of the
point X = 0 in terms of the parameters A and w.For the stable case, nd the period
of oscillations of X(t) in terms of A and w, and the shape of the trajectory in the phase
plane. For the unstable case, nd the growth rate of deviation from the equilibrium point
and nd the trajectory in the (X; X') phase plane.
2. Rewrite the equation x''=x(1+Asin(wt)) as a system of two rst order ODE's so that the Matlab programme ode45 could be used. Create a function le for the right-hand-side of this system to be used by ode45 to solve it.
3.Consider the stable trajectories, with emphasis on the values of w close to the critical value wcrit. Find approximate periods for X(t). For this, you will need to run solutions for different time intervals and find for the interval which leads to the first approximate return of the trajectory to the initial phase-space point (not necessarily an exact return, because recurrence in X does not imply exact recurrence in x). Do these periods agree with the analytical formula you obtained above (in part 1)? What happens to the period when w tends to its critical value?

The Attempt at a Solution


Ok,this is what i currently have:
After solving the first question, i know that:
x(t)=x(0)cos(sqrt(A^2/(2w^2)-1)*t)
I know that if A^2/(2w^2)-1 is less than 0, then it is unstable, otherwise it is stable
The period seems to be 2*pi/sqrt(A^2/(2w^2)-1)
But i don't know how to find the shape of the trajectory in the phase plane, from what i know, i have to insert the formula into Matlab to obtain the graph .
For the unstable case, find the growth rate of deviation(i don't know what the growth rate of deviation is and how to find it) from the equilibrium point and find the trajectory in the (X; X') phase plane.( please help me with this too)

2. Rewrite the equation x''=x(1+Asin(wt)) as a system of two rst order ODE's so that the Matlab programme ode45 could be used.
For this, i can split it into two part:
x'=y
y'=x(1+Asin(wt))
But i don't know how to create a function file for the right-hand-side of this system to be used by ode45 to solve it.
 
Last edited:
Physics news on Phys.org
Hi lahuxixi.

Welcome to the forums!

You need to show an attempt at a solution before we can help you. Why don't you start by doing part 1 and the first half of 2. Those parts of the question have nothing to do with computers.
 
Ok,this is what i currently have:
After solving the first question, i know that:
x(t)=x(0)cos(sqrt(A^2/(2w^2)-1)*t)
I know that if A^2/(2w^2)-1 is less than 0, then it is unstable, otherwise it is stable
The period seems to be 2*pi/sqrt(A^2/(2w^2)-1)
But i don't know how to find the shape of the trajectory in the phase plane, from what i know, i have to insert the formula into Matlab to obtain the graph .
For the unstable case, find the growth rate of deviation(i don't know what the growth rate of deviation is and how to find it) from the equilibrium point and find the trajectory in the (X; X') phase plane.( please help me with this too)

2. Rewrite the equation x''=x(1+Asin(wt)) as a system of two rst order ODE's so that the Matlab programme ode45 could be used.
For this, i can split it into two part:
x'=y
y'=x(1+Asin(wt))
But i don't know how to create a function file for the right-hand-side of this system to be used by ode45 to solve it.
 
The best thing to do when you're learning MATLAB is to find an example online and change it. So here is an example I found for ode45. In MATLAB go to file -> new -> function and then copy and past the below code into the file that comes up and save it as F.m. Of course you'll need to change the actual function to suit your needs.

Code:
function xp=F(t,x)
xp=zeros(2,1); % since output must be a column vector
xp(1)=x(2);
xp(2)=-t*x(1)+exp(t)*x(2)+3*sin(2*t); % don’t forget ; after each line
 
lahuxixi said:
But i don't know how to find the shape of the trajectory in the phase plane, from what i know, i have to insert the formula into Matlab to obtain the graph .

The command for plotting in MATLAB is 'plot'. Why don't you try finding a plotting example online and see if you can change it to suit your needs. If you run into trouble go ahead and post.
 

Similar threads

Replies
4
Views
1K
Replies
5
Views
2K
Replies
1
Views
2K
Replies
18
Views
4K
Replies
1
Views
3K
Replies
16
Views
14K
Back
Top