MATLAB problem with Kapitsa pendulum

  • Context: MATLAB 
  • Thread starter Thread starter lahuxixi
  • Start date Start date
  • Tags Tags
    Matlab Pendulum
Click For Summary

Discussion Overview

The discussion revolves around a MATLAB problem related to the Kapitsa pendulum, focusing on the analytical solution of the motion equations, stability criteria, and the implementation of these concepts in MATLAB for numerical solutions and graphical representation.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Technical explanation

Main Points Raised

  • One participant presents the equations governing the motion of the Kapitsa pendulum and outlines the tasks required, including finding stability criteria and period of oscillations.
  • Another participant emphasizes the need for an initial attempt at a solution before receiving further assistance.
  • There is a discussion about the stability of the system, with one participant noting that stability depends on the condition A^2/(2w^2)-1 being less than or greater than zero.
  • Participants express uncertainty about how to find the shape of the trajectory in the phase plane and the growth rate of deviation from equilibrium in the unstable case.
  • One participant suggests rewriting the second-order differential equation as a system of first-order ODEs suitable for MATLAB's ode45 function.
  • A later reply provides a generic example of a MATLAB function for ode45, encouraging adaptation for the specific problem at hand.
  • Another participant reiterates the need for a plotting example in MATLAB to visualize the trajectory in the phase plane.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the methods for finding the trajectory shape or the growth rate of deviation, indicating that multiple approaches and uncertainties remain in the discussion.

Contextual Notes

Participants express limitations in their understanding of certain concepts, such as the growth rate of deviation and the specifics of creating function files in MATLAB. There is also a lack of clarity on how to visualize the phase plane trajectories effectively.

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 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 16 ·
Replies
16
Views
15K