[MATLAB] Simple Undamped Forced Vibration Problem

  • Context: MATLAB 
  • Thread starter Thread starter bugatti79
  • Start date Start date
  • Tags Tags
    Matlab Vibration
Click For Summary
SUMMARY

The discussion focuses on solving a simple undamped forced vibration problem using MATLAB, specifically the equation \(\ddot x + \frac{k}{m}x = \frac{F_o}{m} \sin w_ot\). The user implements this using the ODE solver ode45 and defines the system with initial conditions and parameters such as mass m=20 and stiffness k=800. The user seeks clarification on whether MATLAB's ode45 accounts for both the complementary and particular solutions in its output. The theoretical solution includes terms for both the complementary and particular solutions, which the user is unsure how to implement correctly in MATLAB.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with MATLAB programming and syntax
  • Knowledge of forced vibration theory and its mathematical representation
  • Experience with MATLAB's ode45 function for numerical solutions
NEXT STEPS
  • Review MATLAB documentation on ode45 for solving ODEs
  • Study the implementation of complementary and particular solutions in forced vibration problems
  • Explore MATLAB plotting functions to visualize the output of ODE solutions
  • Investigate boundary conditions and their effects on particular solutions in differential equations
USEFUL FOR

Engineers, physicists, and students involved in mechanical vibrations, particularly those using MATLAB for numerical simulations of dynamic systems.

bugatti79
Messages
786
Reaction score
4
Hi Folks,

I am trying to replicate a solution in Matlab for the following problem ##\displaystyle \ddot x + \frac{k}{m}x = \frac{F_o}{m} \sin w_ot##

using 2 first order linear differential equations in Matlab as shown below


tspan=[0 4];
y0=[.02;1]; %Initial Conditions for y(1)=x and y(2)= x dot
[t,y]=ode45(@forced1,tspan,y0); %Calls forced1.m
plot(t,y(:,2)); %y(:,1) represents the displacement and y(:,2) the velocity
grid on
xlabel('time')
ylabel('Displacement')
title('Displacement Vs Time')
hold on;

function yp = forced1(t,y)

m=20;
k=800;
f=8;
w=8;
yp = [y(2);(((f/m)*sin(w*t))-((k/m)*y(1)))];

The problem is I don't know whether Matlab considers both the complementary and particular solution. THe theoretical solution is given as

##\displaystyle x=A \sin w_nt +B \cos w_nt+ \frac{\frac{F_o}{k}}{1-(\frac{w_o}{w_n})^2} \sin w_ot##

where the 3rd term is the particular solution assumed of the form ##x_p=C \sin w_o t##. I am not sure how to implement this correctly in Matlab

Any ideas?

Thanks
 
Physics news on Phys.org
Have you confirmed that MATLAB isn't giving you this answer back? It should be easy to check the output of ode45 against that form with a few plots.

Does that particular solution arise as a result of boundary conditions?
 

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 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K