How do I animate a block (say an image) to vibrate at a particular frequency?
3 views (last 30 days)
Show older comments
I want to show how a spring vibrates at its natural frequency. Without using any other models (quarter car or other response based models), I want to show the animation of a spring at a particular frequency, just as a vertical motion. Can I use MATLAB to do this?
For example, assume a car has a front natural frequency of 1.5 Hz and a rear natural frequency of 1.7 Hz. I want to show two springs going up and down at these frequencies so that the user gets an idea of the system. Please let me know if I can write a code for this.
0 Comments
Answers (1)
Jan
on 20 Oct 2016
Yes, you can write code for it. Do you want to obtain the vibration trajectories by a simulation or do you just want an animation?
4 Comments
Jan
on 26 Oct 2016
Compute the positions for a time vector in the wanted resolution. Most likely some simple sin() commands will do this.
Open a figure, then an axes. Create the graphical objects you want in 2D or 3D, e.g. by surf, line, cyclinder etc. Then write a loop and modify the 'XData', 'YData', 'ZData' properties of the created object accoring to the calculated positions.
Search in teh net for examples: Look for "Matlab animation".
Harikrishna Devarajan
on 2 Nov 2016
Edited: Harikrishna Devarajan
on 5 Nov 2016
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!