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...
-
At the end of the spring semester, the Dean of Students sent a survey to the entire freshman class. One question asked the students how much weight they had gained or lost since the beginning of the...
-
In a contract dispute between a US company and a Canadian company, the contract itself referred to provisions of the Uniform Commercial Code. Do these references alone preempt the contract from being...
-
In an audit of the Marco Corporation as of December 31, 2011, the following situations exist. No entries have been made in the accounting records in relation to these items. 1. During the year 2011,...
-
An express train service travels from London to Paris are an average speed of 200km/h and returns to London at an average speed of 160km/h. Each day the train travels 4 trips from London to Paris and...
-
We take 6 pairs of siblings and we measure their IQ. We get the following data: First born kid: 130, 118, 132, 100, 140, 145 . Second born kid: 110, 120, 118, 106, 122, 119 where we list siblings in...
-
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...
-
What two factors determine the amount of federal withholding taxes that will be deducted from gross earnings each pay period? Explain.
-
create a class called faculty: Declare variables: facultyId, facultyName, facultyDept, facultySalary and create their getters. Create a static ArrayList for faculty: It should display something like...
-
The average utility bill of 55 r/s California households was$88.32 last month. Assume that the s.d. of all Californiahouseholds utility bills last month was $12.45. (a) Construct a98% confidence...
-
Why does professional leagues establish rules governing the financial operation of individual franchises?
-
Create a Java Project that exhibits the following properties. Create package in the LibrarySystem. Name the package methodsInClassConstructors Create the following classes Book Author Modify the...
-
"Scenario A: At age 19 you make a one-time investment of $11,000 that earns 3.0% per year; Scenario B: At age 38 you make a one-time investment of $17,700 that earns 6.0% per year; Under which...
-
Discuss some alternative strategies available to the manufacturer contemplating the passing of price increases through the channel.
-
Suppose that you are part of a virtual team and must persuade other team members on an important matter (such as switching suppliers or altering the project deadline). Assuming that you cannot visit...
-
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.
-
2. Consider the reinforced concrete beam shown below. It is placed in a testing frame and a load, P, is gradually applied to it at midspan using a hydraulic jack. Solve using gross section properties...
-
Suppose you buy a $40,000 car and you 'put down' $5,000 and finance the rest for 72 months at 3.75% annual rate. Over the entire life of the loan, how much will you have paid in Interest on the loan?
-
c) Your recent research into The Coca Cola company reveals the following information: B=-0.29749 Market return 0.93% Risk-free rate = 0.5% 1) Using the CAPM equation, populate the table below. Beta...
Study smarter with the SolutionInn App