Assignment 3 Instructions
docx
keyboard_arrow_up
School
University of Ontario Institute of Technology *
*We aren’t endorsed by this school
Course
3030U
Subject
Mechanical Engineering
Date
Jan 9, 2024
Type
docx
Pages
5
Uploaded by HighnessGazelle2944
MECE 3030U Computer Aided Design
Assignment 3
Due: December 4, 2023
For the handwritten questions in this assignment, please show your calculations using pencil/pen and paper and draw a box around your final answer. Please use only a simple calculator to complete these questions (as you would for an exam). MATLAB can be used to verify your answers but not to demonstrate your ability to solve the assignment questions. For NX-based questions, please include a .zip file that includes all the files required to open your
parts, assembly, motion analysis and finite element analysis. Please upload your assignment (one .zip file containing a single pdf of your handwritten solutions and all the NX files required to validate your work) by the due date. Question 1
A. (10 marks)
For the control points and weights below, find the parametric equation and the curve’s coordinates at u = 0, u = 0.3, u = 0.7, u = 1, for a Non-Uniform Rational B-Spline of degree 2:
P
1
= [-1, -1]
T
, P
2
= [0, 3]
T
, P
3
= [3, 0]
T
, P
4
= [-2, -2]
T
w
1
= 1, w
2
= 3, w
3
= 1, w
4
= 1
B. (10 marks)
Sketch the NURBS curve and label the tangent vectors at the beginning and end of the curve. Sketch a Bezier Curve that utilizes the same control points. Describe why the Bezier Curve is a special case of a NURBS curve (<50 words). Question 2
A. (10 marks)
A designer selects the following control points to create parametric curves for the front and back of a new car hood. Compute the Bezier Surface equation, P(u,v), that generates the new car hood
from the following control points:
Front of Hood: P
1
= [-1, -1, 2]
T
, P
2
= [0, -2, 3]
T
, P
3
= [1, -1, 2]
T
Back of Hood: P
4
= [-1, 0, -2]
T
, P
5
= [0, 1, -1]
T
, P
6
= [1, 0, -2]
T
B. (10 marks)
Describe and sketch which parameters the designer would need to provide to create a similar surface using the Hermite Bicubic Surface approach (<100 words).
Question 3
A. (10 marks)
A human loads a truss structure with a force F
H
, as shown below. Create the stiffness matrix and create a matrix equation to calculate the reaction forces and node displacements. Assume an elastic modulus of E, element area of A, and element lengths of b and a. Question 4
The lift gate for a redesigned sport utility vehicle is being developed based on a previous model: Hyundai Lift Gate Video: https://www.youtube.com/watch?v=_hbe7WidJqc
The designed components are attached in the .zip file.
Your challenge is to use Siemens NX software to develop a stylish trunk cover using a parametric curve (Studio Spline), and create an assembly, motion analysis, and finite element analysis for the system to determine the system’s range of motion and the trunk frame’s structural integrity. A. (20 marks)
Create a stylish trunk cover, example above, that utilizes Studio Spline parametric curves (in addition to standard lines and arcs) and that mounts to the M5 bolt hole locations on the trunk’s frame (hint: you can start from a duplicate of the trunk frame part to create your cover). Create an assembly for the lift gate system shown above and incorporate your trunk cover. Find a suitable bump stop thickness so the car frame and trunk frame stop when parallel (round to whole numbers). Remodel the car frame part with the correct bump stop thickness.
On your handwritten solutions sheet, state the correct bump stop thickness. Example
Trunk
Cover
Bump Stops
B. (20 marks)
Create a motion analysis showing the trunk opening and closing at 20
o
/s, using the actuator as the
motion driver. On your handwritten solutions sheet, state your method for controlling the actuator’s motion.
Create a motion analysis with a force driver for the actuator. Determine the force required to lift your trunk frame and cover. Ensure your analysis has gravity enabled. Assume your trunk frame and trunk cover are made from Aluminum 6061. On your handwritten solutions sheet, state the force required to lift your trunk. C. (10 marks)
Create a finite element analysis for the car frame to analyze the force of the actuators on their ball joints. Determine the maximum stress on the car frame and if the car frame will yield. Modify the car frame to better distribute loads from the actuator. On your handwritten solutions sheet, state the maximum stress and if your car frame will yield. Explain the geometric changes and feature additions you made to the car frame (<100 words). Your final assignment for CAD, woohoo!
Please reach out for support if desired.
Good luck and enjoy the process, Aaron
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
Equations Sheet
Bezier Curves Bezier Surfaces
P
(
u ,v
)
=
∑
i
=
0
n
∑
j
=
0
m
P
ij
B
i,n
(
u
)
B
j,m
(
v
)
0
≤u≤
1,0
≤ v≤
1
NURBS Curves N
i,
1
=
{
1
u
i
<
u
<
u
i
+
1
0
elsewhere
N
i,k
=
(
u
−
u
i
)
N
i,k
−
1
(
u
i
+
k
−
1
−
u
i
)
+ (
u
i
+
k
−
u
)
N
i
+
1,
k
−
1
(
u
i
+
k
−
u
i
+
1
)
Finite Element Analysis Element stiffness matrix
Hermite Bicubic Surfaces
K
=
[
k
11
k
12
k
21
k
21
]
=
EA
L
[
1
−
1
−
1
1
]
KU
=
R
KU
=
R
Related Documents
Related Questions
I need help with the first part and Matlab for this problem
arrow_forward
No need guideline answer ok. Solve both write RRL. ABOUT THESE 2 ITEMS. NOTE NO NEED EXTRA EXPLANATION ONLY NEED FOR OTH 1 PARAGRAPH EACH PUT REF END POINTS OK. DONT NEED GUIDELINE OKK. IF ANSWER GUIDELINE I WILL DISLIKE OKK
1. height of sweet potato plants;
2. programable speed of a rover: . something that says that a rover is programmed via speed, that it doesn't matter if the weight of the rover is decreasing from time to time. something that says that if you programmed a rover to go 5kph it will remain 5kph even if you put something heavy on it.
arrow_forward
Hi, I need help with the first part of the problem below because I'm very confused about how P1 and P2 should be calculated. If you look at my notes to solve the problem there is already a formula in place as I always thought the Patm should also be multiplied by the Area in the numerator, but it's not if I look at this specific tutorial solution given by my course but it's not explained why. I have done a while ago a very similar problem with using that formula in my notes and it gave me the right results, but it's not working for this one. Could you please help me understand why as I have a test coming soon?
Figure Q3 (see image attached) shows a cylinder and pistonenclosing air, the movement of the pistonbeing restrained by a compression spring ofstiffness 20 kN/m. The air is heated andexpands, the piston moving 0.3 m. Thefree length of the spring is 1.0 m.Calculate the work done by the air duringthe process.If the pressure , volume and internal energyof air are related by the…
arrow_forward
You are a biomedical engineer working for a small orthopaedic firm that fabricates rectangular shaped fracture
fixation plates from titanium alloy (model = "Ti Fix-It") materials. A recent clinical report documents some problems with the plates
implanted into fractured limbs. Specifically, some plates have become permanently bent while patients are in rehab and doing partial
weight bearing activities.
Your boss asks you to review the technical report that was generated by the previous test engineer (whose job you now have!) and used to
verify the design. The brief report states the following... "Ti Fix-It plates were manufactured from Ti-6Al-4V (grade 5) and machined into
solid 150 mm long beams with a 4 mm thick and 15 mm wide cross section. Each Ti Fix-It plate was loaded in equilibrium in a 4-point bending
test (set-up configuration is provided in drawing below), with an applied load of 1000N. The maximum stress in this set-up was less than the
yield stress for the Ti-6Al-4V…
arrow_forward
Hi I need help to make the line change into a different color, I half of the line to be orange and I need the other half of the line towards the end to be purple as shown in the picture. Also I need there be a box saying Diesel, petrol, diesel best fit, petrol best fit. This part is also shown in the graph.
Please use this code and fix it in MATLAB:
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Fix the random seed for reproducibility
rng(50);
% Assumed positions of cars
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
pDiesel = polyfit(carPosition, CO2Diesel, 3);
pPetrol = polyfit(carPosition, CO2Petrol, 3);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Combine the best fit lines
combinedFit =…
arrow_forward
Don't use chatgpt will upvote
arrow_forward
Please critique the attached writing assignment, discussing improtment statergies
arrow_forward
Solve correctly
arrow_forward
I was going over the equations for the notes in class and I had a thought. Based on the equations in the image, you could get negative propellant mass. So, I coded it in matlab and I got negative mass. How is that possible? I think I used practical values for the velocity and mass ratio and so on. Did I do something wrong?
arrow_forward
please help solve A-F. thank you
You are an engineer working on a project and your prototype has failed prematurely. You question whether or not a key component of the prototype was manufactured with the correct material. There are two way to check for the material properties. The first way is to have a material certification done to confirm the exact material composition. This will take some time. The second method to confirm the material properties is to make an ASTM test sample and test for the material properties. This tensile test was completed on a test sample with an initial diameter of .501” and an initial length of 2”. The Load-Deflection data for this tensile test is below. Use this data to answer the first set of questions on the Final Exam in eLearning. A. Determine the Ultimate Tensile Strength B. Determine the 0.2% Offset Yield Strength C. Determine the value of the Proportional Limit D. Determine the Modulus of Elasticity E. Determine the Strain at Yield F. Calculate %…
arrow_forward
I need help with the purple line the line that you see one the graph on the picture needs to be on the graph.
Use this code to add the purple line and make sure it’s crossing the orange line. Please make sure the lines are positioned the same way it is shown on the picture with the graph.
Use this code on MATLAB and add the purple line.
% 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 lines
fitDiesel = polyval(pDiesel, carPosition);…
arrow_forward
Could you please fix my code it’s supposed to look like the graph that’s on the picture. But the lines do not cross eachother at the beginning. Could you make the lines look like the lines on the graph?
Use this code in MATLAB and fix it.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Define your seed here
seed = 50;
rand('seed',seed); % Set the seed for reproducibility
% 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 lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Plotting the data
figure;
hold on;
% Plot Diesel best fit line…
arrow_forward
I need problems 6 and 7 solved.
I got it solved on 2 different occasions and it is not worded correctly.
NOTE: Problem 1 is an example of how it should be answered. Below are 2 seperate links to same question asked and once again it was not answered correctly. 1. https://www.bartleby.com/questions-and-answers/it-vivch-print-reading-for-industry-228-class-date-name-review-activity-112-for-each-local-note-or-c/cadc3f7b-2c2f-4471-842b-5a84bf505857
2. https://www.bartleby.com/questions-and-answers/it-vivch-print-reading-for-industry-228-class-date-name-review-activity-112-for-each-local-note-or-c/bd5390f0-3eb6-41ff-81e2-8675809dfab1
arrow_forward
I need answers to problems 7, 8, and 9.
NOTE: Please stop wasting my time and yours by rejecting my question because it DOES NOT REQUIRE YOU TO DRAW anything at all. They are simple questions pertaining to the print provided. READ THE INSTRUCTIONS of the assignment before you just reject it for a FALSE reason or leave it for someone to answer that actually wants to do their job. Thanks.
arrow_forward
Help me solve this ENGINEERING GRAPHICS question
Use 0.25 cartesian paper or 0.25 Isometric paper please.
arrow_forward
Help!!! Answer all parts correctly!! Please
arrow_forward
Learning Goal:
To use transformation equations to calculate the plane state of stress in a rotated coordinate system.
The normal and shear stresses for a state of stress depend on the orientation of the axes. If the stresses are
given in one coordinate system (Figure 1), the equivalent stresses in a rotated coordinate system (Figure 2) can
be calculated using a set of transformation equations. Both sets of stresses describe the same state of stress.
In order to use the transformation equations, a sign convention must be chosen for the normal stresses, shear
stresses, and the rotation angle. For the equations below, a positive normal stress acts outward on a face. A
positive Try acts in the positive y-direction on the face whose outward normal is in the positive x-direction. The
positive direction for the rotation is also shown in the second figure.
The stresses in the rotated coordinate system are given by the following equations:
στ
σy
+
cos 20+Try sin 20
2
2
σετ συ
=
σy'
cos 20-Try…
arrow_forward
Hello I’m trying to make the graph that you see in the picture, I’m trying the exact copy of that graph using this code but I’m having a hard time doing that. Could you change the code so that it looks like the graph that you see on the picture using MATLAB, please send the code when you are finished.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Fix the random seed for reproducibility
rng(45);
% Assumed positions of cars
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
pDiesel = polyfit(carPosition, CO2Diesel, 3);
pPetrol = polyfit(carPosition, CO2Petrol, 3);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Plotting the data
figure; hold on;
scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1 0.5…
arrow_forward
Full Answer PLEASE!.
Answer Q 3 and 4 PLease
Don't copy from the internet. PLEASE WRITE YOUR OWN WORDS
THANK YOU
arrow_forward
Suppose a flu epidemic has broken out in all math 1215
courses at your school. Assume a total of 24 people have the
flu as of today and that each day the total number people
who have the flu double. Let f(t) represent the number of
people who have the flu at t days since today.
Estimate numerically when the number of people will reach
768. {your final answer just number}
arrow_forward
-The exam is open adopted textbook, open class notes (posted notes and solutions on the class' Canvas site only) and you may use
Matlab's build-in help system, but only to look up Matlab syntax questions;
- no collaboration is allowed; no help, including the tutoring center, may be sought to solve the problems;
- exam questions may only be asked to the instructor via private Ed Discussion posts or during the instructor's office hours;
- for non Matlab Grader problems, document all steps you took to solve the problem. This can be handwritten, but must be legible
for credit. If the problem states 'By hand', do not use any script/function to actually solve the problem, however, you may use a
non-programmable calculator or script/functions coded in this class to help in verifying the numerical results of individual steps;
- on Gradescope associate/select your answer pages with the corresponding problem numbers. Failure to do so may result in
no points given initially and will require a…
arrow_forward
Please make the exact graph that you see in the picture, along with the graph are numbers that are data. Please make the exact graph do not make anything thing different, the blue and orange circles should be there and the lines should be the same including the titles. Please make sure everything is exactly the same. Use MATLAB, and send the code and please make sure no error signs comes up. Take your time please I need help.
arrow_forward
3. (Make a MatLab code) You have invested money in a bank account that
compounds annually. The interest rate is 6.4%. You want to know the balance of
the account after 5 years. Use an initial balance of $1000.
arrow_forward
hello i hope you are fineI need your help by solving the question below. Please, please, please quickly,because I am studying now and I have exams in the coming days, so I need to do this homework in order to understand the study material and I do not have much time. I need to solve within half an hour or a little more.please please please
arrow_forward
Keep the same colors the same graph, basically keep everything the same just make the line with a small curve just as shown on the picture
Keep everything the same just make the line less curvy please do not change the colors of the line and the circles do not change anything besides the curve of the line.
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 lines
fitDiesel = polyval(pDiesel, carPosition);…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you

Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press

Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON

Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education

Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY

Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning

Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Related Questions
- I need help with the first part and Matlab for this problemarrow_forwardNo need guideline answer ok. Solve both write RRL. ABOUT THESE 2 ITEMS. NOTE NO NEED EXTRA EXPLANATION ONLY NEED FOR OTH 1 PARAGRAPH EACH PUT REF END POINTS OK. DONT NEED GUIDELINE OKK. IF ANSWER GUIDELINE I WILL DISLIKE OKK 1. height of sweet potato plants; 2. programable speed of a rover: . something that says that a rover is programmed via speed, that it doesn't matter if the weight of the rover is decreasing from time to time. something that says that if you programmed a rover to go 5kph it will remain 5kph even if you put something heavy on it.arrow_forwardHi, I need help with the first part of the problem below because I'm very confused about how P1 and P2 should be calculated. If you look at my notes to solve the problem there is already a formula in place as I always thought the Patm should also be multiplied by the Area in the numerator, but it's not if I look at this specific tutorial solution given by my course but it's not explained why. I have done a while ago a very similar problem with using that formula in my notes and it gave me the right results, but it's not working for this one. Could you please help me understand why as I have a test coming soon? Figure Q3 (see image attached) shows a cylinder and pistonenclosing air, the movement of the pistonbeing restrained by a compression spring ofstiffness 20 kN/m. The air is heated andexpands, the piston moving 0.3 m. Thefree length of the spring is 1.0 m.Calculate the work done by the air duringthe process.If the pressure , volume and internal energyof air are related by the…arrow_forward
- You are a biomedical engineer working for a small orthopaedic firm that fabricates rectangular shaped fracture fixation plates from titanium alloy (model = "Ti Fix-It") materials. A recent clinical report documents some problems with the plates implanted into fractured limbs. Specifically, some plates have become permanently bent while patients are in rehab and doing partial weight bearing activities. Your boss asks you to review the technical report that was generated by the previous test engineer (whose job you now have!) and used to verify the design. The brief report states the following... "Ti Fix-It plates were manufactured from Ti-6Al-4V (grade 5) and machined into solid 150 mm long beams with a 4 mm thick and 15 mm wide cross section. Each Ti Fix-It plate was loaded in equilibrium in a 4-point bending test (set-up configuration is provided in drawing below), with an applied load of 1000N. The maximum stress in this set-up was less than the yield stress for the Ti-6Al-4V…arrow_forwardHi I need help to make the line change into a different color, I half of the line to be orange and I need the other half of the line towards the end to be purple as shown in the picture. Also I need there be a box saying Diesel, petrol, diesel best fit, petrol best fit. This part is also shown in the graph. Please use this code and fix it in MATLAB: % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Fix the random seed for reproducibility rng(50); % Assumed positions of cars 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 pDiesel = polyfit(carPosition, CO2Diesel, 3); pPetrol = polyfit(carPosition, CO2Petrol, 3); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Combine the best fit lines combinedFit =…arrow_forwardDon't use chatgpt will upvotearrow_forward
- Please critique the attached writing assignment, discussing improtment statergiesarrow_forwardSolve correctlyarrow_forwardI was going over the equations for the notes in class and I had a thought. Based on the equations in the image, you could get negative propellant mass. So, I coded it in matlab and I got negative mass. How is that possible? I think I used practical values for the velocity and mass ratio and so on. Did I do something wrong?arrow_forward
- please help solve A-F. thank you You are an engineer working on a project and your prototype has failed prematurely. You question whether or not a key component of the prototype was manufactured with the correct material. There are two way to check for the material properties. The first way is to have a material certification done to confirm the exact material composition. This will take some time. The second method to confirm the material properties is to make an ASTM test sample and test for the material properties. This tensile test was completed on a test sample with an initial diameter of .501” and an initial length of 2”. The Load-Deflection data for this tensile test is below. Use this data to answer the first set of questions on the Final Exam in eLearning. A. Determine the Ultimate Tensile Strength B. Determine the 0.2% Offset Yield Strength C. Determine the value of the Proportional Limit D. Determine the Modulus of Elasticity E. Determine the Strain at Yield F. Calculate %…arrow_forwardI need help with the purple line the line that you see one the graph on the picture needs to be on the graph. Use this code to add the purple line and make sure it’s crossing the orange line. Please make sure the lines are positioned the same way it is shown on the picture with the graph. Use this code on MATLAB and add the purple line. % 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 lines fitDiesel = polyval(pDiesel, carPosition);…arrow_forwardCould you please fix my code it’s supposed to look like the graph that’s on the picture. But the lines do not cross eachother at the beginning. Could you make the lines look like the lines on the graph? Use this code in MATLAB and fix it. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Define your seed here seed = 50; rand('seed',seed); % Set the seed for reproducibility % 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 lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Plotting the data figure; hold on; % Plot Diesel best fit line…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

Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press

Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON

Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education

Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY

Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning

Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY