MATLAB Error Message while trying to Plot Magnification Factor

Click For Summary
SUMMARY

The discussion focuses on resolving an error encountered while plotting the magnification factor (MF) of an underdamped vibrating system using MATLAB. The equation used is MF=1/√((1-r^2)^2+(2ζr)^2) with ζ set to 0.01. The key solution identified is the necessity of using element-wise exponentiation by applying ".^" for all instances of the exponentiation operator in the equation. This adjustment allows for successful plotting of the MF against the frequency ratio.

PREREQUISITES
  • Basic understanding of MATLAB programming
  • Familiarity with plotting functions in MATLAB
  • Knowledge of underdamped vibrating systems
  • Understanding of element-wise operations in MATLAB
NEXT STEPS
  • Learn about MATLAB element-wise operations and their syntax
  • Explore MATLAB plotting functions, specifically semilogy
  • Study the behavior of underdamped systems and their frequency response
  • Investigate advanced MATLAB techniques for handling mathematical equations
USEFUL FOR

Students, engineers, and researchers working with MATLAB who are interested in plotting mathematical models, particularly in the context of mechanical vibrations and control systems.

amr55533
Messages
15
Reaction score
0

Homework Statement



I am trying to make a plot of the magnification factor of an underdamped vibrating system versus the frequency ratio using MATLAB. However, my MATLAB skills are very basic and I keep getting an error message.

Basically I am trying to plot:

MF=1/√((1-r^2)^2+(2ζr)^2) where ζ=0.01

I will be making the plot for other values of ζ later.

Homework Equations



MF=1/√((1-r^2)^2+(2ζr)^2) where ζ=0.01

The Attempt at a Solution



http://img198.imageshack.us/img198/7758/matlabw.png

*The x-axis will range from 0 to 3.0

After this, I will use the code semilogy(r,MF); to generate the plot.

Thanks!
 
Last edited by a moderator:
Physics news on Phys.org
Well, element-wise exponentiation is what you want. Did you try using .^ for ALL of the instances of ^ in your equation?
 
I actually just figured that out. I kept leaving out the ".^" in front of the final power of 0.5. Thanks for the help!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K