magiblot

25 Reputation

4 Badges

8 years, 32 days

MaplePrimes Activity


These are answers submitted by magiblot

Finally, I have come up with a script that calculates iteratively all critical points and Lagrange solutions and discards the ones which are out of the domain.

I'm not very familiar with Maple, so there are a few things which are yet to improve:

  • I had to introduce the conditions in two different formats, so that they can both be evaluated and used as parameters for LagrangeMultipliers.
  • I don't know how to avoid writing the function expression manually to plot3d's arguments.
  • I could search for the absolute maximum and minimum in a list, but I think it's not necessary, since they can be chosen at sight. I still might add it later.
  • It probably lacks efficiency.
  • This could have been implemented as a function instead, like vv did, but I don't know how it's done.

 

Note: the results in the preview are shown incomplete, but they are fine in the original file.

 

1. Write in f the function given by the exercise statement.
2. Write in conditionsLogic the region where f is defined as a logical expression (like it already is in the statement).
3. Write in conditionsList the same as before but in the following way: if y >= (3/25)*x-61/10 is a condition, we add (3/25)*x-61/10-y to the list (conditions must be separated by comma).

 

f := -2*x^2+6*x*y+2*x+2*y+5:

conditionsLogic := y >= (3/25)*x-61/10 and y <= (28/13)*x+119/13 and y <= -(25/12)*x+59/12:

conditionsList := [(3/25)*x-61/10-y, (28/13)*x+119/13-y, -(25/12)*x+59/12-y]:

var := [x, y]:

[-859/64, -12337/1600], [-199/71, 2877/923], [82/87, 3083/1044], [-15/2, -7], [5, -11/2], [-1, 7]

(1)

candidates := []:

[-1, 7] = -27.

(2)

NULLIn order to see a tridimensional plot of the function in the stated domain, it must be written directly as an argument of plot3d (it's in bold).

If you look from above, you should see the same shape from the statement's graph.

 

print("Plot with all candidate points");

 

NULL

NULL

NULL

Download English.mw

Page 1 of 1