MCS 320 Quiz 8 Friday 21 October 2005
| > | restart; |
1. Give the Maple commands to create a table currency, to exchange US dollars (USD) and UK pounds: 1 USD = 0.563348 GPB and 1 GBP = 1.77510 USD.
Illustrate the use of the currency table to convert 12.45 USD into GBP.
ANSWER :
| > | currency := table([USD = 0.563348*GBP,GPB = 1.77510*USD]); |
| > | 123.45*currency[USD]; |
2. Consider the f(x,y,z) = x^3 + y^2 + z, where (x,y,z) must satisfy g(x,y,z) = x^2 + y^2 + z^2 - 1 = 0.
Give the Maple commands to apply the methods of Lagrange multipliers to count the number of candidate extremal values of f(x,y,z) constrained by g(x,y,z) = 0.
How many candidate extremal values do you count?
ANSWER :
| > | f := x^3 + y^2 + z; |
| > | g := x^2 + y^2 + z^2 - 1; |
| > | s := {g,diff(g,x)-lambda*diff(f,x),diff(g,y)-lambda*diff(f,y),diff(g,z)-lambda*diff(f,z)}; |
| > | gb := Groebner[gbasis]([op(sys)],plex(x,y,z,lambda)); |
![]()
![]()
From the triangular structure of the lexicographic Groebner basis, we see there are seven solutions.