Develop a script to generate the same computations and plots as in Sec. 21.8, but for the
Question:
Develop a script to generate the same computations and plots as in Sec. 21.8, but for the MATLAB peaks function over ranges of both x and y from –3 to 3.
Transcribed Image Text:
21.8 CASE STUDY VISUALIZING FIELDS Background. Beyond the determination of derivatives in one dimension, the gradient function is also quite useful for determining partial derivatives in two or more dimensions. In particular, it can be used in conjunction with other MATLAB functions to produce vi- sualizations of vector fields. To understand how this is done, we can return to our discussion of partial derivatives at the end of Sec. 21.1.1. Recall that we used mountain elevation as an example of a two- dimensional function. We can represent such a function mathematically as z=f(x,y) where z = elevation, x = distance measured along the east-west axis, and y = distance measured along the north-south axis. For this example, the partial derivatives provide the slopes in the directions of the axes. However, if you were mountain climbing, you would probably be much more interested in determining the direction of the maximum slope. If we think of the two partial derivatives as component vectors, the answer is provided very neatly by of Vf=i+ where Vf is referred to as the gradient of f. This vector, which represents the steepest slope. has a magnitude and a direction 0=tan where 0 = the angle measured counterclockwise from the x axis. Now suppose that we generate a grid of points in the x-y plane and used the foregoing equations to draw the gradient vector at each point. The result would be a field of arrows indicating the steepest route to the peak from any point. Conversely, if we plotted the nega- tive of the gradient, it would indicate how a ball would travel as it rolled downhill from any point. Such graphical representations are so useful that MATLAB has a special function, called quiver, to create such plots. A simple representation of its syntax is quiver (x, y,u,v) where x and y are matrices containing the position coordinates and u and v are matrices containing the partial derivatives. The following example demonstrates the use of quiver to visualize a field. Employ the gradient function to determine to partial derivatives for the following two- dimensional function: f(x,y)=y-x-21²-2xy-y²
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (3 reviews)
Certainly Heres a MATLAB script that generates the computations and plots for the given function usi...View the full answer
Answered By
Akshay Saini
I am a teacher by profession and the teaching passion started since I was in primary since I was leading students in discussion when teacher's were not around It made me venture into the field of Education because teaching and tutoring is in me .I can teach all subjects in the 8-4-4 system but my area of professionalism is English and mostly languages. I will be grateful to have a chance to work as a tutor online because also good in Computer
0.00
0 Reviews
10+ Question Solved
Related Book For
Applied Numerical Methods With MATLAB For Engineers And Scientists
ISBN: 9781259027437
3rd Edition
Authors: Steven C. Chapra
Question Posted:
Students also viewed these Mathematics questions
-
In Exercises describe the interval(s) on which the function is continuous. f(x) = [2x - 4, x = 3 (1, x = 3
-
Find a power series representation for the function and determine the radius of convergence. f(x) = x + x (1-x) 3
-
Develop a script to generate the same computations and plots as in Sec. 21.8, but for the following functions (for x = 3 to 3 and y = 3 to 3): (a) f(x, y) = e (x 2 + y 2 ) and (b) f(x, y) = xe (x 2...
-
Colt Division had the following results for the year just ended: Sales..................................$750,000 Contribution margin ..................300,000 Controllable...
-
Gillians Restaurant has an ice-cream counter where it sells two main products, ice cream and frozen yogurt, each in a variety of flavors. The restaurant makes one order for ice cream and yogurt each...
-
Given an initial outlay of -$1,000 at time 0, find the IRR of a project which returns cash flows of $500 in year 1, $400 in year 2, $300 in year 3 and $100 in year 4. Assume a cost of capital of 10%.
-
What is eco-efficiency? How is it measured? Why is it measured? Where is it reported?
-
In 1999, Andreas Halvorsen, David Ott, and Brian Olson formed a hedge fund, Viking Global Investors LLC. The LLC's written agreement provided that the three founders would operate Viking, and divide...
-
I. Calculate the value of Macaulay's duration for a 10-year, $1000 par value bond purchased today at a yield to maturity of 14% and a coupon rate of 10%. ii. From the answer in (i) calculate the...
-
How do the production and sales volume of a new product need to compare to its break-even point to make it worthwhile to introduce the product?
-
Repeat the the same simulations as in Section 22.6 for the Lorenz equations but generate the solutions with the midpoint method. 22.6 CASE STUDY An example of a simple nonlinear model based on...
-
Use a graphing utility to find the derivative of each function at the given number. -x + 1 f(x) at 8 x? + 5x + 7
-
What would you make as your goal as a financial manager if you were the financial manager at Apple or Microsoft?
-
Round any decimals to the nearest penny. Your fixed expenses are $1,763.25/month. You saved 6 months' worth for an emergency fund in a savings account earning a 4.5% APR over 3 years. After 3 years,...
-
How does the possibility of a target restructuring affect the range of the bidder's offer? Discuss.
-
List and Explain the Challenges of both Commercial & Developmental Financial Institutions ( Give examples of sceranio in developing countries in the Caribbean where these challenges are portrayed)
-
How much would a bank receive for $100 fair market value (FMV) in BBB-rated non-financial U.S-dollar-denominated corporate bonds with a remaining maturity of 6 years
-
Starting with the trade model of Figure 3.4 for Nation 1 and assuming that Nation 1 is small, draw a figure analogous to Figure 8.5 showing the general equilibrium effects resulting when Nation 1...
-
At Glass Company, materials are added at the beginning of the process and conversion costs are added uniformly. Work in process, beginning: Number of units Transferred - in costs Direct materials...
-
Develop a user-friendly computer program to implement Liebmanns method for a rectangular plate with Dirichlet boundary conditions. Design the program so that it can compute both temperature and flux....
-
Employ the program from Prob. 29.12 to solve Probs. 29.1 and 29.2.
-
Employ the program from Prob 29.12 to solve Prob. 29.3.
-
Terry transfers two assets to a partnership on the day its created for a 60% partnership interest worth $120,000. She contributed cash = $80,000 and equipment worth $40,000 with an adjusted basis =...
-
X Corp. adopts a plan of complete liquidation. It distributes land held as an investment to its shareholders that has a fair market value of $300,000 and an adjusted basis of $200,000. If the land is...
-
Assessment Task 2: Case Study The resources you will need for this assessment are: 1. Access to the internet2. Your Learning Guide3. PC, Word Processor, Printer4. Relevant legislation, regulations,...
Study smarter with the SolutionInn App