Dynamics of a Spring Mass Damper

조회 수: 5 (최근 30일)
Igor Braz Gonzaga
Igor Braz Gonzaga 2022년 3월 18일
답변: Shivam Gothi 2024년 8월 22일
Hi. I am new in Matlab and I am trying to modeling a spring-mass-damper system representing a structural model with an external force F (t ) acting.
The differential equation of the model is : .
where m, c and k are respectively, the modal mass, damping coeficient and stiffness.
I solve this Equation with ODE45 for a sinusoidal external force and it works well, but when I try change F(t) to be a stochastic load (wind loads, earthquakes loads or human walking loads, for example), it does not run.
Does anyone knows which is the problem? or how can I fix it?
  댓글 수: 1
Les Beckham
Les Beckham 2022년 3월 18일
You really need to provide the Matlab code that you say "does not run" and tell us what specific error message or other unexpected results that you are seeing. We can not guess how to fix "it" when you haven't shown us what "it" is.
You can edit your question and attach the code with the paperclip icon. Be sure to provide all of the inputs that your are using to run your code.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shivam Gothi
Shivam Gothi 2024년 8월 22일
Hello,
I understand that you need to simulate a mass-spring damper system when subjected to the stochastic loads such as human walking loads, earthquake loads etc. This is possible using MATLAB ode45 function and stochastic load data.
I have attached the implementation in ‘SpringMass.m’. Please find a more comprehensive description of the code below:
  • In this scenario, "human walking loads" are considered as random loads.
  • The Excel file "Stochastic_load.xls" contains load magnitudes represented as time series data, where Column 1 lists time values and Column 2 provides the corresponding force magnitudes at each time point.
  • A MATLAB script processes reads the file, storing the stochastic load values and time steps in the variables "Force" and "time," respectively.
  • A custom function, "Mass_spring_damper()," is developed to model the system's differential equation.
  • The user-defined function "F()" returns the force magnitude at a given time "t."
  • The model's differential equations are solved using MATLAB's "ode45" function. For further details, please consult the following documentation:
  • As a final step, the position and velocity of mass and stochastic disturbance are plotted as a function of time.
  • Below give are the responses obtained by simulating the system for 10 seconds
  • (Note : Here I have assumed the following values : (“m” = 0.1 kg ; “k” = 0.1 ; “c” = 0.05). You can change them in the script according to your need. (Inside the function Mass_spring_damper( ) )
I hope this solves the issue !

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by