1. Assume the velocity of a rocket for the first 2 minutes of flight after lifto
ID: 668595 • Letter: 1
Question
1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.1. Assume the velocity of a rocket for the first 2 minutes of flight after liftoff can be
described by
2 v 0.65*t
where v is velocity (m/s) and t is time (sec.). Then it reaches a steady speed at the end of
2 minutes.
1) Using a FOR looping structure, write an Matlab script
that numerically calculates the distance traveled during the
first 2 minutes of flight. Calculate using time intervals of 5,
1 and 0.1 seconds, compare the results and explain the
effect of interval.
2) Do the same using a WHILE structure.
3) Do the same without the use of a looping structure (i.e.
using only vectors).
4) Do the same using the Matlab function " integral ".
5) Compare answers from codes (1-4) to the exact analytic
answer (Yes, I'm asking you to calculate the answer using
paper and pencil—that’s why rocket scientists need to learn
math.). Hint: try to plot all in one graph for comparison
using “hold” functions with “plot” function.
6) Compare the time required to run codes (1-4). Hint: try
the “tic-toc” command or others you think suitable.
7) Assuming a human can withstand 25 g's or more for 2
seconds, would you be willing to ride this rocket ?
Answer each of the above questions and insert your Matlab
function/script and the corresponding results. Clearly state
your answer to each question. Turn in this lab report in
WORD format using this sheet as the cover sheet.v
Explanation / Answer
1. Using For Loop
close all;
clear all;
clc;
step = 5;
vi = 0;
vf = 0;
s_old = 0;
s_total = 0;
for t = step : step : 120
vf = 0.65*t;
a = (vf -vi)/step;
s_total = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total;
end
step = 1;
vi = 0;
vf = 0;
s_old = 0;
s_total_one = 0;
for t = step : step : 120
vf = 0.65*t;
a = (vf -vi)/step;
s_total_one = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total_one;
end
step = 0.1;
vi = 0;
vf = 0;
s_old = 0;
s_total_two = 0;
for t = step : step : 120
vf = 0.65*t;
a = (vf -vi)/step;
s_total_two = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total_two;
end
2. Using While Loop
close all;
clear all;
clc;
step = 5;
vi = 0;
vf = 0;
s_old = 0;
s_total = 0;
t = step;
while (t <= 120)
vf = 0.65*t;
a = (vf -vi)/step;
s_total = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total;
t = t + step;
end
step = 1;
vi = 0;
vf = 0;
s_old = 0;
s_total_one = 0;
t = step;
while (t <= 120)
vf = 0.65*t;
a = (vf -vi)/step;
s_total_one = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total_one;
t = t + step;
end
step = 0.1;
vi = 0;
vf = 0;
s_old = 0;
s_total_two = 0;
t = step;
while (t <= 120)
vf = 0.65*t;
a = (vf -vi)/step;
s_total_two = s_old + (((vf^2)-(vi^2))/(2*a));
vi = vf;
s_old = s_total_two;
t = t + step;
end
3. For using vectors
replace loop and use following algorithm for vector
step = 5;
t = [step : step : 120];
v = 0.65*t;
Distance is same in all cases.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.