Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide the MatLab code Problem # 1: You are given a function u(x,y) where u(x,y)=3(13x)2e3x2(3y+1)210[(3/5)x27x3243y5]e5x29y2(1/3)e(3x+1)29y2+x2+y21 The surface described by z=u(x,y) represents the elevation throughout

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

Please provide the MatLab code

Problem \# 1: You are given a function u(x,y) where u(x,y)=3(13x)2e3x2(3y+1)210[(3/5)x27x3243y5]e5x29y2(1/3)e(3x+1)29y2+x2+y21 The surface described by z=u(x,y) represents the elevation throughout a national park at each point (x,y) in the park. The park boundaries are at x=1,y=1,x=1 and y=1. Create a contour plot of u(x,y) with 20 isoclines and a suitable color bar. Use a 100100 grid. Add to your plot, the field of gradient vectors given by u(x,y), for each of the points on a uniform 2020 grid. Here is the code for u, which you can simply copy and paste directly into your script file: 3(13x)2exp(3x2(3y+1)2)10(3x/527x243y5)exp(5x29y2)1/3exp((3x+1)29y2)+(x2+y2)1; Use your First Name, Last Name, and Student Number as the title for the graph (e.g., 'Johnny Good, 1234567'). Then save the graph as a Portable Network Graphics (.png) file, and upload it. There is a stream in the park of Problem \#1 above. The stream follows a path given by r(t)=x(t),y(t)>. One feature about water is that it flows down a path of steepest descent, so that r(t)=u(x,y). If the river begins at a location r(0)=0.43,0.2> determine the path of the stream along the surface of the park for values of t between 0 and 5, with a stepsize of 0.001 . To do that use [0:0.001:5.0] as the second argument of the function ode 45. Note: The Matlab code for the required partial derivatives ux and uy are given by the following two expressions, respectively (which could be produced using Matlab's Symbolic Toolbox, if you have it): (18(13x))exp(3x2(3y+1)2) 6(13x)23xexp(3x2(3y+1)2) (10(3/581x2))exp(5x29y2) +(20((3/5)x27x3243y5))5xexp(5x29y2) (1/3(18x6))exp((3x+1)29y2)+2x 3(13x)2(18y6)exp(3x2(3y+1)2) +12150y4exp(5x29y2) +(20((3/5)x27x3243y5))9yexp(5x29y2) +6yexp((3x+1)29y2)+2y (a) What is the height of the river, z, when t=5 ? (b) What are the components of the position vector r(5) ? Enter the x and y components (in that order) into the answer box below, separated with a comma. Graph the path of the stream, r(t), from Problem \#2 above on your contour plot from Problem \#1 above, with a line thickness of 2 and using a white colour for positive elevations and a black colour for negative elevations. Use your First Name, Last Name, and Student Number as the title for the graph (e.g., 'Johnny Good, 1234567'). Then save the graph as a Portable Network Graphics (.png) file, and upload it. Note: It is possible that you will see a gap between the black part of your trajectory, and the white part. This is because there is a gap in time between the two curves due to the discretization of t, and Matlab won't join lines from the graphs of two separate curves. Problem \# 4: Determine the length of the stream from its source at t=0, to the end point where t=5. Note that you will be measuring the length through three dimensions, using x,y, and z. Problem \#4: Problem \# 5: A straight pipe is run from the end of the stream at t=5, back to the source of the stream at t=0. The pipe runs along a straight line from one end to the other. What is the length of the pipe? Problem \#5: Problem \# 6: For the pipe in Problem \#5 above, what is the (positive) difference in height between one end of the pipe and the other? Problem \#6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions