Lab5
pdf
keyboard_arrow_up
School
Pennsylvania State University *
*We aren’t endorsed by this school
Course
301
Subject
Mechanical Engineering
Date
Feb 20, 2024
Type
Pages
9
Uploaded by LieutenantScorpion3921
BME 301
clc,clear
Problem 1
%B.
%plotting several plots vs time
open_system(
"Lab5_pb1"
)
sol1 = sim(
'Lab5_pb1.slx'
);
figure;
subplot(2,2,1)
plot(sol1.tout,sol1.pb1(:,1))
xlabel(
'Time'
)
ylabel(
'Vin'
)
title(
'V input vs Time'
)
subplot(2,2,2)
plot(sol1.tout,sol1.pb1(:,2))
xlabel(
'Time'
)
ylabel(
'CO'
)
title(
'CO vs Time'
)
subplot(2,2,3)
plot(sol1.tout,sol1.pb1(:,3))
xlabel(
'Time'
)
ylabel(
'MAP'
)
title(
'MAP vs Time'
)
subplot(2,2,4)
plot(sol1.tout,sol1.pb1(:,4))
xlabel(
'Time'
)
ylabel(
'Vout'
)
title(
'V Output vs Time'
)
1
print(
'-sLab5_pb1'
,
'-djpeg'
,
'Lab5_pb1.jpeg'
);
image_1 = imread(
'Lab5_pb1.jpeg'
);
figure;
imshow(image_1);
%C.
open_system(
"Lab5_pb1_partc"
)
open_system(
"Lab5_pb1_partc.slx"
);
sol2 = sim(
'Lab5_pb1_partc.slx'
);
figure;
subplot(3,1,1)
plot(sol2.tout,sol2.pb1p3(:,1))
xlabel(
'Time'
)
ylabel(
'Vin'
)
title(
'V input vs Time'
)
subplot(3,1,2)
2
plot(sol2.tout,sol2.pb1p3(:,2))
xlabel(
'Time'
)
ylabel(
'CO'
)
title(
'CO vs Time'
)
subplot(3,1,3)
plot(sol2.tout,sol2.pb1p3(:,3))
xlabel(
'Time'
)
ylabel(
'MAP'
)
title(
'MAP vs Time'
)
%D.
%In the healthy system, the heart has enough power to pump the blood
%through all of the parts of the body. However, when they have the heart
%failure, the heart is not enough to pump the blood to overall body, that
%some of them are left over in the part of body that is far away from
%heart. One example is feet which is a place that swell happens. Since the
%blood retains in the part of the feet, the tissue absorbs the fluid and it
%is leading to swell.
Problem 2
%A.
del_P = 120-80;
del_V = 130-50;
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
C_A = del_V/del_P;
%B.
%E.
open_system(
"Lab5_pb2_partc"
)
sol3 = sim(
"Lab5_pb2_partc.slx"
);
print(
'-sLab5_pb2_partc'
,
'-djpeg'
,
'Lab5_pb2_partc.jpeg'
);
image_3 = imread(
'Lab5_pb2_partc.jpeg'
);
figure;
imshow(image_3);
4
figure;
plot(sol3.tout,sol3.Pb2_partd(:,1))
xlabel(
'Time'
)
ylabel(
'Aortic Pressrue'
)
title(
'Healthy Model'
)
figure;
plot(sol3.tout,sol3.Pb2_partd(:,2))
xlabel(
'Time'
)
ylabel(
'Aortic Pressrue'
)
title(
'Aortic Aneurysm'
)
5
figure;
plot(sol3.tout,sol3.Pb2_partd(:,3))
xlabel(
'Time'
)
ylabel(
'Aortic Pressrue'
)
title(
'Atherosclerosis'
)
6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
F.
Aortic aneutysm is some part of blood vessel getting bigger cause of weakened blood vessel. I doubled the arterial compliance. It meets my expectation because as I doubled the value, the the pressure value increased.
G.
Atherosclerosis is the disease of size of the artery decreases due to the plague. I doubled the TPR value and halfed the arterial compliance. It meets my expectation because compared to the healthy model, the graph is reversed and the osicllation seems to be halfed.
H.
%I.
R = 19*60;
num = R; %healthy model
num1 = R; %aortic aneurysm
7
num2 = R*2; %Atherosclerosis
denom = [R*0.5, 1]; %healthy model
denom1 = [R*1, 1]; %aortic aneurysm
denom2 = [R*0.25, 1]; %Atherosclerosis
tf_model = tf(num,denom); %healthy model
tf_model1 = tf(num1,denom1); %aortic aneurysm
tf_model2 = tf(num2,denom2); %Atherosclerosis
figure;
bodeplot(tf_model,
"b"
); %healthy model
hold on
bodeplot(tf_model1,
"k:"
) %aortic aneurysm
bodeplot(tf_model2,
"m--"
) %Atherosclerosis
hold off
legend(
'Healthy Model'
,
'Aortic Aneurysm'
,
'Atherosclerosis'
)
J.
For all healthy and 2 diseases, they are going to have the same number of zero and pole but it is just that the location of where the pole is starting is different. If this is a filter, it would be a low-pass filter and first-order. For the stop band, aneurysm is going to be the shortest and atherosclerosis will be the longest.
%K.
figure;
8
step(tf_model,
"b"
); %healthy model
hold on
step(tf_model1,
"k:"
); %aortic aneurysm
step(tf_model2,
"m--"
); %Atherosclerosis
hold off
legend(
'Healthy Model'
,
'Aortic Aneurysm'
,
'Atherosclerosis'
)
L.
For the Aortic Aneurysm, during the curving point, the value is different but after 6000 seconds it shows the same thing as healthy model. However, for atherosclerosis the amplitude is totally different from the normal curve.
9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
I having a problem with my code in MATLAB. In the following code results for r is just a 1x3 matrix. Although inside the while loop r equals to multiple 1x3 matrices. I need r equal to one matrix that is of size 27032x3. So, I just need the multiple r matrices to merge together to get one big matrix. I need that matrix to retain its value outside the while loop as well.
cc=0; % set line counter
JD = 2460626.666667;
fid = fopen('tle_catalog.txt'); % load the TLE
tline2='gg';
while ischar(tline2)
cc = cc+1; % counter
name = fgets(fid);% for the ones with three lines
tline1 = fgets(fid); % collect first line of two line elements
tline2 = fgets(fid); % collect second line of two line elements
if tline2>0 % stop at the end of the file
% initialize the propagation
[satrec, startmfe, stopmfe, deltamin] ...
= twoline2rv(721, tline1, tline2, 'c', 'd');
time_JD = tline1(21:32);
yeardayhour = str2double(regexp(tline1, '(\d{2})(\d{3})(\.\d+)', 'tokens', 'once'));
dn =…
arrow_forward
Use MATLAB please make code for this.
arrow_forward
Please examine how you got answer step by step please
arrow_forward
Don't Use Chat GPT Will Upvote And Give Solution In 30 Minutes Please
arrow_forward
USE MATLAB
(Convolutional Code) The vector representation of a convolutional code is g1=[1 1]and g2=[1 0]. If the received sequence is 11 11 01 10, please use Viterbi Algorithm todecode it. Please show the full trellis diagram, including the updated trellis statemetrics.
arrow_forward
Please follow the instructions and the requirements according to the pictures above and I kinda need the solution quickly. The language of the code is in Matlab, thank you in advance.
arrow_forward
Hello I'm having trouble with this assignment, I don't understand how the plot function works for ordered pairs. I undertand that the points of the line would be the origin(0,0) and (x = cos(theta) . y = sin(theta)).
arrow_forward
HW Matlab 1) Create a variable ftemp to store a temperature in degrees Fahrenheit (F). Write m-file to convert this to degrees Celsius and store the result in a variable ctemp. The conversion factor is C = (F —32) * 5/9. 2) Write m-file to generate a matrix of random integers of size 100 by 100 their values between 15 to 80. 3) Free fall of objects is given by y =5mgt? where a is the acceleration, v is the velocity, y is the distance, m is the mass of the object, g is the gravitational acceleration. Plot the distance and velocity of the object for 15 seconds after its fall from rest (y = 0). Take m = 0.2 kg.
arrow_forward
Please help, this for Matlab the image is the first question with following 2 and 3 they go together.
2. Solving the question by using bisection.m with the stopping criterion at 1%. Report the root and # of iterations.
3. by using newton-Raphson matlab script with the stopping criterion at 0.1%. Report the root and # of iterations.
arrow_forward
Problem 3 (40 points) (CCOs 1 & 3)/MatlabGrader
On Canvas, you will find a Matlab function file process.p that takes as input the variable x and returns as output the result of
a complicated process g (x). Copy the file into your working directory and use it as any other Matlab .m file or build-in intrinsic
Matlab function (just call it using its name process). The only difference between a .p and a .m file is that the source code of the .p
file is not visible.
Find all roots of g(x) in the interval 0 ≤ x ≤ 10 to a tolerance in function of at least 10-10 using mySecant from problem 2.
Recall that any .m or .p function file can be passed as an argument into another function by prefacing the function name by a
@, e.g., @process can be passed as an argument into any Matlab function that uses a function as an input argument, for example
fplot(@process,...) for plotting a function.
Store all found unique roots in a column vector root, the corresponding tolerances in function in a column…
arrow_forward
I need help with simulink. It is my first time using simulink. I am trying to make a simulink program turning on the LED on the board for 10sec for an Arduino Mega 2560. I have attached an image of what I tried to do. After I run, it just says no diagnostic. How do I know if I did this correctly or not?
arrow_forward
This code keeps on generating graphs with different curves. The picture that you see two different graphs comes from the same code but both of them have different curves. I need the curve to look like the picture that only has one graph. I basically need the line to have a slight curve and every time I run the code it will come up as the same graph every time. Use this code on MATLAB and fix it
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Use the 'seed' function instead of 'rng'
seed = 50; % Define your seed here
rand('seed',seed);
% Assumed CO2 emissions for Diesel and Petrol
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves with a reduced degree of 2
pDiesel = polyfit(carPosition, CO2Diesel, 2);
pPetrol = polyfit(carPosition, CO2Petrol, 2);
% Generate points for best fit…
arrow_forward
Motiyo
Add explanation
arrow_forward
permanent-magnet (pm) genera x
Bb Blackboard Learn
L STAND-ALONE.mp4 - Google Dri x
O Google Drive: ülwgjuó jc lis u
O ME526-WindEnergy-L25-Shuja.p x
O File | C:/Users/Administrator/Desktop/KFUPM%20Term%232/ME526/ME526-WindEnergy-L25-Shuja.pdf
(D Page view
A Read aloud
T) Add text
V Draw
Y Highlight
O Erase
17
of 26
Wind Farms
Consider the arrangement of three wind turbines in the following schematic in which wind
turbine C is in the wakes of turbines A and B.
Given the following:
- Uo = 12 m/s
A
-XẠC = 500 m
-XBC = 200 m
- z = 60 m
- Zo = 0.3 m
U.
-r, = 20 m
B
- CT = 0.88
Compute the total velocity deficit, udef(C) and the velocity at wind turbine C, namely Vc.
Activate Windows
Go to Settings to activate Windows.
Wind Farms (Example Answer)
5:43 PM
A 4)) ENG
5/3/2022
I!
arrow_forward
Don't Use Chat GPT Will Upvote And Give Handwritten Solution Please
arrow_forward
I am having trouble with the folloiwng MATLAB code. I am getting an error that says "unrecognized function or variable 'numericalPropogatorOptions". I have the aerospace toolbox and the aerospace blockset added. what add on do I have to download to use that function. How do I make this code work?
% Define Keplerian Elements
a = 29599.8; e = 0.0001; i = 0.9774; Omega = 1.3549; w = 0; M = 0.2645;
[RECI, VECI] = Kepler2RV(a, e, i, Omega, w, M);
initialState = [RECI * 1e3; VECI * 1e3]; % Initial position (m) and velocity (m/s)
% Define constants
mu = 3.986004418e14; % Gravitational constant (m^3/s^2)
earthRadius = 6378.1363 * 1e3; % Earth radius in meters
j2 = 1.08263e-3; % J2 perturbation coefficient
% Define propagator options
propOptions = numericalPropagatorOptions('CentralBody', 'Earth', ...
'GravitationalParameter', mu, ...
'InitialState', initialState, ...
'OutputTimeStep', 300); % Output every 300 seconds
% Add perturbations
addGravityModel(propOptions, 'Degree', 2,…
arrow_forward
Part III Capstone Problem
Interactive Physics - [Lab7Part3.IP]
Eile Edit World View Object Define Measure Script Window Help
Run StoplI Reset
圖|& 品凸?
Time
Length of Spring 22
6.00
dx
Center of Mass of Rectangle 2
5.000
Tension of Rope 3
Jain@
IFI
... N
ot
rot
***lad
Split
4.000
Velocity of Center of Mass of Rectangle 2
Vx Vx
V Vy
MM
Ve
- m/s
m/s
3.00
*** m/s
Vo
..* lad/s
2 00
Center of Mass of Rectangle 1
1.000
tol
rot
*.* rad
EVelocity of Center of Mass of Rectangle 1
Vx Vx
VVy
M
0.000
-m/s
w 30
m/s
w..
MI
Ve
母100
*** m/s
Vo
... rad/s
+
EAcceleration of Center of Mass of Rectangle 1
Ax Ax
A Ay
AUJAI
Ae
--- m/s^2
... m/s^2
-- m/s^2
.-- rad/s^2
3.00
Aø
Mass M1 = 2.25 kg is at the end of a rope that is 2.00 m in length. The initial angle with
respect to the vertical is 60.0° and M1 is initially at rest. Mass M1 is released and strikes M2
= 4.50 kg exactly horizontally. The collision is elastic. After collision, mass M2 is moving on
a frictionless surface, but runs into a rough patch 2.00…
arrow_forward
Create one Simulink embedded function model to simulate the bungee jumper’s distance (x)
vs. t, the velocity (x’) vs. t and acceleration (x’’) vs. t for the first 500 seconds of the jump.
arrow_forward
please write a matlab code
arrow_forward
I want you to draw HGL& EGL
For the first picture using the same method on the second picture
arrow_forward
How do I input this code for this MATLAB problem? Thanks!
arrow_forward
Given: Mass = M,
Radius = R,
Moment of Inertia = I,
Distance = H,
Gravity = g,
Initial timing = 0
Unknown =
How long will the [delta t] process take? (time)
Please keep in mind that almost every variable is unknown! We are given no numbers and are instructed to generate a solution using the variables [ "R, M, g, I and H." ]
Target =
Find an equation that, if we could substitute numbers, would determine how long the process would take.
Newton's second law and torque seem to be relevant based on how the problem is written.
* Also please show drawing based on what we are calculating
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
![Text book image](https://www.bartleby.com/isbn_cover_images/9780190698614/9780190698614_smallCoverImage.gif)
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134319650/9780134319650_smallCoverImage.gif)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781259822674/9781259822674_smallCoverImage.gif)
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9781118170519/9781118170519_smallCoverImage.gif)
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337093347/9781337093347_smallCoverImage.gif)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781118807330/9781118807330_smallCoverImage.gif)
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Related Questions
- I having a problem with my code in MATLAB. In the following code results for r is just a 1x3 matrix. Although inside the while loop r equals to multiple 1x3 matrices. I need r equal to one matrix that is of size 27032x3. So, I just need the multiple r matrices to merge together to get one big matrix. I need that matrix to retain its value outside the while loop as well. cc=0; % set line counter JD = 2460626.666667; fid = fopen('tle_catalog.txt'); % load the TLE tline2='gg'; while ischar(tline2) cc = cc+1; % counter name = fgets(fid);% for the ones with three lines tline1 = fgets(fid); % collect first line of two line elements tline2 = fgets(fid); % collect second line of two line elements if tline2>0 % stop at the end of the file % initialize the propagation [satrec, startmfe, stopmfe, deltamin] ... = twoline2rv(721, tline1, tline2, 'c', 'd'); time_JD = tline1(21:32); yeardayhour = str2double(regexp(tline1, '(\d{2})(\d{3})(\.\d+)', 'tokens', 'once')); dn =…arrow_forwardUse MATLAB please make code for this.arrow_forwardPlease examine how you got answer step by step pleasearrow_forward
- Don't Use Chat GPT Will Upvote And Give Solution In 30 Minutes Pleasearrow_forwardUSE MATLAB (Convolutional Code) The vector representation of a convolutional code is g1=[1 1]and g2=[1 0]. If the received sequence is 11 11 01 10, please use Viterbi Algorithm todecode it. Please show the full trellis diagram, including the updated trellis statemetrics.arrow_forwardPlease follow the instructions and the requirements according to the pictures above and I kinda need the solution quickly. The language of the code is in Matlab, thank you in advance.arrow_forward
- Hello I'm having trouble with this assignment, I don't understand how the plot function works for ordered pairs. I undertand that the points of the line would be the origin(0,0) and (x = cos(theta) . y = sin(theta)).arrow_forwardHW Matlab 1) Create a variable ftemp to store a temperature in degrees Fahrenheit (F). Write m-file to convert this to degrees Celsius and store the result in a variable ctemp. The conversion factor is C = (F —32) * 5/9. 2) Write m-file to generate a matrix of random integers of size 100 by 100 their values between 15 to 80. 3) Free fall of objects is given by y =5mgt? where a is the acceleration, v is the velocity, y is the distance, m is the mass of the object, g is the gravitational acceleration. Plot the distance and velocity of the object for 15 seconds after its fall from rest (y = 0). Take m = 0.2 kg.arrow_forwardPlease help, this for Matlab the image is the first question with following 2 and 3 they go together. 2. Solving the question by using bisection.m with the stopping criterion at 1%. Report the root and # of iterations. 3. by using newton-Raphson matlab script with the stopping criterion at 0.1%. Report the root and # of iterations.arrow_forward
- Problem 3 (40 points) (CCOs 1 & 3)/MatlabGrader On Canvas, you will find a Matlab function file process.p that takes as input the variable x and returns as output the result of a complicated process g (x). Copy the file into your working directory and use it as any other Matlab .m file or build-in intrinsic Matlab function (just call it using its name process). The only difference between a .p and a .m file is that the source code of the .p file is not visible. Find all roots of g(x) in the interval 0 ≤ x ≤ 10 to a tolerance in function of at least 10-10 using mySecant from problem 2. Recall that any .m or .p function file can be passed as an argument into another function by prefacing the function name by a @, e.g., @process can be passed as an argument into any Matlab function that uses a function as an input argument, for example fplot(@process,...) for plotting a function. Store all found unique roots in a column vector root, the corresponding tolerances in function in a column…arrow_forwardI need help with simulink. It is my first time using simulink. I am trying to make a simulink program turning on the LED on the board for 10sec for an Arduino Mega 2560. I have attached an image of what I tried to do. After I run, it just says no diagnostic. How do I know if I did this correctly or not?arrow_forwardThis code keeps on generating graphs with different curves. The picture that you see two different graphs comes from the same code but both of them have different curves. I need the curve to look like the picture that only has one graph. I basically need the line to have a slight curve and every time I run the code it will come up as the same graph every time. Use this code on MATLAB and fix it % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Use the 'seed' function instead of 'rng' seed = 50; % Define your seed here rand('seed',seed); % Assumed CO2 emissions for Diesel and Petrol CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves with a reduced degree of 2 pDiesel = polyfit(carPosition, CO2Diesel, 2); pPetrol = polyfit(carPosition, CO2Petrol, 2); % Generate points for best fit…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY
![Text book image](https://www.bartleby.com/isbn_cover_images/9780190698614/9780190698614_smallCoverImage.gif)
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134319650/9780134319650_smallCoverImage.gif)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9781259822674/9781259822674_smallCoverImage.gif)
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9781118170519/9781118170519_smallCoverImage.gif)
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337093347/9781337093347_smallCoverImage.gif)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781118807330/9781118807330_smallCoverImage.gif)
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY