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...
-
Dan Partridge is a risk averter who tries to maximize the expected value of c, where c is his wealth. Dan has $50,000 in safe assets and he also owns a house that is located in an area where there...
-
Review the social and emotional competencies in Exhibit 2.2 and consider them in the context of your best leadership experience. Which of these competencies did you demonstrate? How did you...
-
At the beginning of its fiscal year 2006, an analyst made the following forecast for General Mills, Inc., the consumer foods company, for 2006-2009 (in millions of dollars): General Mills reported...
-
ThomGav Corporation manufactures Alps, Betz, and Gams from a joint process. The production for the month of July production is 9,009 Alps; 12,446 Betz; and 14,298 Gams, and the respective per unit...
-
Briefly explain whether each of the following statements describes a change in supply or a change in quantity supplied. a. To take advantage of high prices for snow shovels during a snowy winter,...
-
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...
-
When giving your presentation, avoid speaking too ___________. (a) loud (b) loudly Choose the correct option.
-
Simon Company's year-end balance sheets follow. At December 31 Assets Cash Accounts receivable, net Merchandise inventory Prepaid expenses Plant assets, net Total assets Liabilities and Equity...
-
Openthe Phetsimulation Charges and Field from this link: ( https://phet.colorado.edu/en/simulation/charges-and-fields ) . In this simulation, a little different model is used: the little yellow "E...
-
A particle of mass m that is moving along the x-axis is experiencing a restoring force of the form F = -k+x, where kf is the spring constant. The Hamiltonian for this system is given as: = d 2m dx +...
-
Distinguish carefully between the following terms: i) Resolution and Sensitivity. ii) Type A and Type B evaluations of measurement uncertainty. [30%] (b) Describe two common schemes used for the...
-
Write out the form of the partial fraction decomposition of the function (See Example). Do not determine the numerical values of the coefficients. (a) +3 x5 + 2x3 A B C x Dx + E ++++ 2+2 6 (b)...
-
Refer to the October 2015 sanitation levels of cruise ships, Exercise 2.81 (p. 87). a. Give a measure of relative standing for the TSS Oceanic score of 73. Interpret the result. b. Give a measure of...
-
True & False The basis of an asset must be reduced by the depreciation allowable, 2. Adjusted gross income (AGI) is the basis for a number of phase-outs of deductions. 3. A change to adjusted gross...
-
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.
-
A project will generate annual cash flows of $237,600 for each of the next three years, and a cash flow of $274,800 during the fourth year. The initial cost of the project is $749,600. What is the...
-
You want to invest annual amounts over the next 15 years. If your goal is to have $15,000 at the end of that time and if you can earn 8 percent on your invested funds, how much do you need to invest...
-
please explain thoroughly how to do in excel 1. Find the number of units to ship from each factory to each customer that minimizes total cost
Study smarter with the SolutionInn App