Chapter 9: Problem 83
Using MATLAB, plot Eq. (9.94) for \(\zeta=0,0.25,0.5,0.75\), and 1 over the range \(0 \leq r \leq 3\).
Short Answer
Expert verified
Define the range of \(r\) using `linspace` function and the damping ratios \(\zeta\) as an array. Create a function handle `eqn_9_94` for the equation (9.94). Then, use a for loop to iterate through the damping ratios, calculate the amplitude ratio, and plot the results using MATLAB's `plot` function with each curve labeled by its damping ratio.
Step by step solution
01
Define the range of r
To define the range of \(r\) from 0 to 3 in MATLAB, use the linspace function. This function creates an equally spaced array of values between the given limits.
```matlab
r = linspace(0, 3, 1000);
```
Here, we create an array of 1000 equally spaced values between 0 and 3.
02
Define the values for the damping ratio \(\zeta\)
Create an array of the desired damping ratios (0, 0.25, 0.5, 0.75, and 1)
```matlab
zeta = [0, 0.25, 0.5, 0.75, 1];
```
03
Define the equation (9.94)
Define the equation (9.94) as a function handle in MATLAB. The function should accept inputs for \(r\) and \(\zeta\) and return the result of the equation.
```matlab
eqn_9_94 = @(r, zeta) (1 - zeta.^2)./sqrt((1 - 2*zeta.*r + r.^2).^2 + 4*zeta.^2.*(1 - r.^2).^2);
```
04
Plot the results
Use a for loop to iterate through the various damping ratios (\(\zeta\)), evaluate the equation for each of the given values of \(r\), and plot the result. Use the `hold on` command to overlay multiple plots on the same graph.
```matlab
figure;
for i = 1:length(zeta)
y = eqn_9_94(r, zeta(i));
plot(r, y, 'DisplayName', ['\(\zeta\) = ', num2str(zeta(i))]);
hold on;
end
xlabel('Frequency ratio, \(r\)')
ylabel('Amplitude ratio')
title('Amplitude ratio vs. frequency ratio for various damping ratios')
legend('show')
grid on;
```
This will generate the desired plot with the given equation for the various damping ratios \(\zeta\) and the specified range of \(r\).
Unlock Step-by-Step Solutions & Ace Your Exams!
-
Full Textbook Solutions
Get detailed explanations and key concepts
-
Unlimited Al creation
Al flashcards, explanations, exams and more...
-
Ads-free access
To over 500 millions flashcards
-
Money-back guarantee
We refund you if you fail your exam.
Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!
Key Concepts
These are the key concepts you need to understand to accurately answer the question.
Damping Ratio
The damping ratio, often represented by the symbol \( \zeta \), is a dimensionless measure that describes how oscillations in a system decay after a disturbance. In the context of this exercise, the damping ratio affects how quickly the amplitude of vibrations decreases. A system with a damping ratio of zero means there is no damping, and the system will continue to oscillate indefinitely. Conversely, a damping ratio of one represents critical damping, where the system returns to equilibrium as quickly as possible without oscillating.
In real-world applications, different systems may require various damping levels to function optimally. For instance:
In real-world applications, different systems may require various damping levels to function optimally. For instance:
- In automobiles, shock absorbers use damping to provide a smoother ride by absorbing the energy from road bumps.
- In buildings, dampers can be used in structural engineering to reduce vibrations from earthquakes or wind.
Frequency Ratio
The frequency ratio, denoted as \( r \), is the ratio of the excitation frequency to the natural frequency of a system. It plays a vital role in determining how a system responds to different frequencies. In the given exercise, as the frequency ratio \( r \) varies from 0 to 3, it helps us understand how the amplitude of the system's response changes.
Here's what different ranges of the frequency ratio can imply:
Here's what different ranges of the frequency ratio can imply:
- \( r < 1 \): The system is excited below its natural frequency, which often results in a reduced amplitude response.
- \( r = 1 \): The excitation frequency matches the natural frequency, and this can lead to resonance, where amplitude becomes very large.
- \( r > 1 \): The system is excited above its natural frequency, and the amplitude response typically decreases again.
Equations in MATLAB
When tackling engineering and scientific problems, MATLAB offers a powerful platform for defining and manipulating mathematical equations. In this exercise, Equation (9.94) is defined using a function handle, which is a crucial part of scripting in MATLAB. A function handle allows us to define a function's behavior in terms of input and output.
For creating this equation to be used multiple times, we define it as:\[ eqn\_9\_94 = @ (r, \zeta) \frac{1 - \zeta^2}{\sqrt{(1 - 2\zeta r + r^2)^2 + 4\zeta^2(1 - r^2)^2}}\]This mathematical equation will be executed efficiently for each value of \( r \) and \( \zeta \) in the array, thanks to MATLAB's array-centric design. Understanding how to create and utilize function handles is significant for users needing to solve real-world problems where multiple parameters and calculations are involved.
For creating this equation to be used multiple times, we define it as:\[ eqn\_9\_94 = @ (r, \zeta) \frac{1 - \zeta^2}{\sqrt{(1 - 2\zeta r + r^2)^2 + 4\zeta^2(1 - r^2)^2}}\]This mathematical equation will be executed efficiently for each value of \( r \) and \( \zeta \) in the array, thanks to MATLAB's array-centric design. Understanding how to create and utilize function handles is significant for users needing to solve real-world problems where multiple parameters and calculations are involved.
Step-by-step MATLAB Tutorial
Creating complex plots in MATLAB starts with breaking down the task into clear, manageable steps. This tutorial walks you through creating a plot to compare how different damping ratios affect amplitude across a frequency range.
1. **Define the Range of \( r \):** Use `linspace` to create an array of values from 0 to 3. ```matlab r = linspace(0, 3, 1000); ``` This generates 1000 equally spaced values, giving a detailed representation of the range.
2. **Set Damping Ratios:** Define the values of \( \zeta \) you wish to investigate. ```matlab zeta = [0, 0.25, 0.5, 0.75, 1]; ``` These are stored in an array for easy iteration.
3. **Define the Equation:** Create a function handle that expresses Equation (9.94). ```matlab eqn_9_94 = @(r, zeta) (1 - zeta.^2)./sqrt((1 - 2*zeta.*r + r.^2).^2 + 4*zeta.^2.*(1 - r.^2).^2); ``` The `@` symbol in MATLAB signifies a function handle.
4. **Plot The Results:** Loop over each \( \zeta \), evaluate and plot the equation result. ```matlab figure; for i = 1:length(zeta) y = eqn_9_94(r, zeta(i)); plot(r, y, 'DisplayName', ['\zeta = ', num2str(zeta(i))]); hold on; end xlabel('Frequency ratio, \(r\)') ylabel('Amplitude ratio') title('Amplitude ratio vs. frequency ratio for various damping ratios') legend('show') grid on; ```This step-by-step process helps break down complex tasks into simpler ones, making it easier to tackle challenges systematically.
1. **Define the Range of \( r \):** Use `linspace` to create an array of values from 0 to 3. ```matlab r = linspace(0, 3, 1000); ``` This generates 1000 equally spaced values, giving a detailed representation of the range.
2. **Set Damping Ratios:** Define the values of \( \zeta \) you wish to investigate. ```matlab zeta = [0, 0.25, 0.5, 0.75, 1]; ``` These are stored in an array for easy iteration.
3. **Define the Equation:** Create a function handle that expresses Equation (9.94). ```matlab eqn_9_94 = @(r, zeta) (1 - zeta.^2)./sqrt((1 - 2*zeta.*r + r.^2).^2 + 4*zeta.^2.*(1 - r.^2).^2); ``` The `@` symbol in MATLAB signifies a function handle.
4. **Plot The Results:** Loop over each \( \zeta \), evaluate and plot the equation result. ```matlab figure; for i = 1:length(zeta) y = eqn_9_94(r, zeta(i)); plot(r, y, 'DisplayName', ['\zeta = ', num2str(zeta(i))]); hold on; end xlabel('Frequency ratio, \(r\)') ylabel('Amplitude ratio') title('Amplitude ratio vs. frequency ratio for various damping ratios') legend('show') grid on; ```This step-by-step process helps break down complex tasks into simpler ones, making it easier to tackle challenges systematically.