Follow the steps below to obtain the minimum distance using MATLAB. The symbolic variable t has been created for you*, and code has been provided to define the projectile constants and the point location. 1. Use the projectile constants to define the symbolic functions x(t) and y (t) using the formulas above. 2. Use the point location along with x(t) and y(t) to define the distance function D(t) 3. Use the diff and solve functions to obtain the time of closest approach tmin by solving the critical value equation D'(1) = 0. 4. Evaluate D(t) at tmin to obtain the distance of approach, Dmin. 5. Convert both tmin and Dmin to decimal (numeric) variables using the double function. When you have completed your solution, run it to view the values of tmin and Dmin. If they seem reasonable given the above figure, submit your solution for assessment. Script e A Save C Reset I MATLAB Documentatio syms t 2 % Declare t as a real variable >= 0 to avoid non-physical solutions 3 assume (t>-0); 4 % Projectile motion constants: 5 theta = sym(pi)/4; g = 9.8; ve = 30; 6 % Point location 7 x1 - 30; y1 = 20; 8 9 % Define x(t) and y(t) 10 x(t) = 11 y(t) = 12 % Define D(t) 13 D(t) - 14 % Define dD(t) below 15 dD(t) = 16 % Find the critical time 17 tmin = 18 % Obtain the distance of closest approach 19 Dmin - 20 21 % Display the results 22 fprintf('Mimimum approach distance: %0.2f\nMinimum approach time: %0.2f',Dmin, tmin); Run Script

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1

Applied Optimization: Minimizing the Distance from a Point to a Curve
My Solutions >
Introduction
In this problem you will use Calculus to obtain the distance of the closest approach of a projectile to a fixed point. Recall that distance D(x, y) between a point on a curve (x, y)
and a fixed point (x1, yı) is computed using the distance formula:
D(x, y) = V(x – x1)² + (y – yı)²
To find the distance of closest approach, we would like to use the techniques for finding the extreme values of a function, but these apply only to functions of a single variable and
D is a function of both x and y. Therefore, we must first either:
· Express the curve as a function of x (or y), so that y = f(x) (or x= f(y)), then replace that variable in terms of the formula involving the other, so that D(x, y) becomes
D(x) (or D(y)).
· Express both x and y as functions of a third parameter, t and substitute the expressions x(1) and y(t) for x and y above. In this case D becomes a function of the single
variable t.
Note that the latter method is more general, as a wider variety of curves can be expressed as parametric functions, and we use this approach in the problem below.
Your Task
Consider the problem of finding the distance of closest approach, Dmin: of a projectile to the peak of an obstruction. If the projectile motion is determined by the following
parametric equations:
• x(1) = vot cos (0)
· y(t) = vot sin (0) –
where vo, 0, andg are constant, we can use the method discussed in the introduction to find the closest approach to the obstruction by finding the minimum value of D(t). This
problem is depicted in the image below where the top of the obstruction is located at the point (x), y1) = (40, 20).
25
D(t)
20
15
10
20
40
60
80
100
Transcribed Image Text:Applied Optimization: Minimizing the Distance from a Point to a Curve My Solutions > Introduction In this problem you will use Calculus to obtain the distance of the closest approach of a projectile to a fixed point. Recall that distance D(x, y) between a point on a curve (x, y) and a fixed point (x1, yı) is computed using the distance formula: D(x, y) = V(x – x1)² + (y – yı)² To find the distance of closest approach, we would like to use the techniques for finding the extreme values of a function, but these apply only to functions of a single variable and D is a function of both x and y. Therefore, we must first either: · Express the curve as a function of x (or y), so that y = f(x) (or x= f(y)), then replace that variable in terms of the formula involving the other, so that D(x, y) becomes D(x) (or D(y)). · Express both x and y as functions of a third parameter, t and substitute the expressions x(1) and y(t) for x and y above. In this case D becomes a function of the single variable t. Note that the latter method is more general, as a wider variety of curves can be expressed as parametric functions, and we use this approach in the problem below. Your Task Consider the problem of finding the distance of closest approach, Dmin: of a projectile to the peak of an obstruction. If the projectile motion is determined by the following parametric equations: • x(1) = vot cos (0) · y(t) = vot sin (0) – where vo, 0, andg are constant, we can use the method discussed in the introduction to find the closest approach to the obstruction by finding the minimum value of D(t). This problem is depicted in the image below where the top of the obstruction is located at the point (x), y1) = (40, 20). 25 D(t) 20 15 10 20 40 60 80 100
Follow the steps below to obtain the minimum distance using MATLAB. The symbolic variable t has been created for you*, and code has been provided to define the projectile
constants and the point location.
1. Use the projectile constants to define the symbolic functions x(t) and y (t) using the formulas above.
2. Use the point location along with x(t) and y(t) to define the distance function D(t).
3. Use the diff and solve functions to obtain the time of closest approach tmin by solving the critical value equation D'(t) = 0.
4. Evaluate D(t) at tmin to obtain the distance of approach, Dmin.
5. Convert both tmin and Dmin to decimal (numeric) variables using the double function.
When you have completed your solution, run it to view the values of tmin and Dmin. If they seem reasonable given the above figure, submit your solution for assessment.
Script e
H Save
C Reset
I MATLAB Documentation
1 syms t
2 % Declaret as a real variable >= 0 to avoid non-physical solutions
3 assume (t>=0);
4 % Projectile motion constants:
5 theta = sym(pi)/4; g = 9.8; ve = 30;
6 % Point location
7 x1 - 30; y1 = 20;
8
9 % Define x(t) and y(t)
10 x(t) =
11 y(t) =
12 % Define D(t)
13 D(t) -
14 % Define dD(t) below
15 dD(t) =
16 % Find the critical time
17 tmin =
18 % Obtain the distance of closest approach
19 Dmin -
20
21 % Display the results
22 fprintf('Mimimum approach distance: %0.2f\nMinimum approach time: %0.2f', Dmin, tmin);
Run Script
Transcribed Image Text:Follow the steps below to obtain the minimum distance using MATLAB. The symbolic variable t has been created for you*, and code has been provided to define the projectile constants and the point location. 1. Use the projectile constants to define the symbolic functions x(t) and y (t) using the formulas above. 2. Use the point location along with x(t) and y(t) to define the distance function D(t). 3. Use the diff and solve functions to obtain the time of closest approach tmin by solving the critical value equation D'(t) = 0. 4. Evaluate D(t) at tmin to obtain the distance of approach, Dmin. 5. Convert both tmin and Dmin to decimal (numeric) variables using the double function. When you have completed your solution, run it to view the values of tmin and Dmin. If they seem reasonable given the above figure, submit your solution for assessment. Script e H Save C Reset I MATLAB Documentation 1 syms t 2 % Declaret as a real variable >= 0 to avoid non-physical solutions 3 assume (t>=0); 4 % Projectile motion constants: 5 theta = sym(pi)/4; g = 9.8; ve = 30; 6 % Point location 7 x1 - 30; y1 = 20; 8 9 % Define x(t) and y(t) 10 x(t) = 11 y(t) = 12 % Define D(t) 13 D(t) - 14 % Define dD(t) below 15 dD(t) = 16 % Find the critical time 17 tmin = 18 % Obtain the distance of closest approach 19 Dmin - 20 21 % Display the results 22 fprintf('Mimimum approach distance: %0.2f\nMinimum approach time: %0.2f', Dmin, tmin); Run Script
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY