Results 1 to 2 of 2

Math Help - Mathematica Help

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    1

    Mathematica Help

    Well, first hi!! This is my first post!!

    Now, onto the real situation. I am currently in Calculus 4 in university and we have Mathematica projects.. problem is, I never learned how to really use it, and I've been flying on tutorials last semester, and the last project we did. But now, I have no tutorial, and I'm struggling.. badly.

    So, the project is finding absolute minima and maxima [its from Neumann and Miller, project 5.8]
    If I can just get started on it, that would be great.
    the first part gives you a function and a constraining function. I have to find the critical points under the constraining function, then the minima and maxima on the unit sphere, and then on the closed ball. and its using lagrange multipliers.
    I know this is kinda vague, I can def provide more information..
    Anyway, more help would be AWESOME

    Thanks guys



    ETA: project file
    Attached Files Attached Files
    Last edited by carXunderwater; March 4th 2010 at 07:44 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Aug 2008
    Posts
    903
    Here's (a) in two parts. Had to convert to raw format to paste it here. I think you can follow it right? The D[f[x,y,z],x] is just the partial with respect to x. Same dif for others. The syntax:

    extremaInUnitBall = Select[myExtrema,
    Sqrt[#1[[1]]^2 + #1[[2]]^2 +
    #1[[3]]^2] < 1 & ]

    means "select from the table of myExtrema, those values for which \sqrt{x^2+y^2+z^2}<1

    Code:
    f[x_, y_, z_] := Sqrt[48]*x*y*z - 
       (1 - x^2 - y^2 - z^2)^(3/2)
    g[x_, y_, z_] := x^2 + y^2 + z^2 - 1
    
    myExtrema = {x, y, z} /. 
       Solve[{D[f[x, y, z], x] == 0, 
         D[f[x, y, z], y] == 0, 
         D[f[x, y, z], z] == 0}, {x, y, z}]
    
    extremaInUnitBall = Select[myExtrema, 
       Sqrt[#1[[1]]^2 + #1[[2]]^2 + 
           #1[[3]]^2] < 1 & ]
    
    {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}, 
      {0, 0, 0}, {0, 0, 1}, {0, 1, 0}, 
      {1, 0, 0}, {-(Sqrt[3]/5), -(Sqrt[3]/5), 
       -(Sqrt[3]/5)}, {-(Sqrt[3]/5), 
       Sqrt[3]/5, Sqrt[3]/5}, 
      {Sqrt[3]/5, -(Sqrt[3]/5), Sqrt[3]/5}, 
      {Sqrt[3]/5, Sqrt[3]/5, -(Sqrt[3]/5)}}
    
    {{0, 0, 0}, {-(Sqrt[3]/5), -(Sqrt[3]/5), 
       -(Sqrt[3]/5)}, {-(Sqrt[3]/5), 
       Sqrt[3]/5, Sqrt[3]/5}, 
      {Sqrt[3]/5, -(Sqrt[3]/5), Sqrt[3]/5}, 
      {Sqrt[3]/5, Sqrt[3]/5, -(Sqrt[3]/5)}}
    Second part to (a) using Lagrange multipliers. Again, the variable myLagrange is just the table of values for which the four Lagrange equations are zero. Then the syntax

    (f[#1[[1]], #1[[2]], #1[[3]]] & ) /@
    myLagrange

    means, use the "pure function" (f[#1[[1]], #1[[2]], #1[[3]]]&) and go throgh the table myLagrange and substitute the first three elements in each term into the function f(x,y,z). From that list I get the max is 4/3 and the min is -4/3.

    Code:
    In[83]:=
    myF[x_, y_, z_, \[Lambda]_] := f[x, y, z] + 
        \[Lambda]*g[x, y, z]; 
    myLagrange = {x, y, z, \[Lambda]} /. 
       Solve[{D[myF[x, y, z, \[Lambda]], x] == 0, 
         D[myF[x, y, z, \[Lambda]], y] == 0, 
         D[myF[x, y, z, \[Lambda]], z] == 0, 
         D[myF[x, y, z, \[Lambda]], \[Lambda]] == 0}, 
        {x, y, z, \[Lambda]}]
    (f[#1[[1]], #1[[2]], #1[[3]]] & ) /@ 
      myLagrange
    
    Out[84]=
    {{-(1/Sqrt[3]), -(1/Sqrt[3]), 1/Sqrt[3], 
       -2}, {-(1/Sqrt[3]), 1/Sqrt[3], 
       -(1/Sqrt[3]), -2}, {1/Sqrt[3], 
       -(1/Sqrt[3]), -(1/Sqrt[3]), -2}, 
      {1/Sqrt[3], 1/Sqrt[3], 1/Sqrt[3], -2}, 
      {-1, 0, 0, 0}, {0, -1, 0, 0}, 
      {0, 0, -1, 0}, {0, 0, 1, 0}, 
      {0, 1, 0, 0}, {1, 0, 0, 0}, 
      {-(1/Sqrt[3]), -(1/Sqrt[3]), 
       -(1/Sqrt[3]), 2}, {-(1/Sqrt[3]), 
       1/Sqrt[3], 1/Sqrt[3], 2}, 
      {1/Sqrt[3], -(1/Sqrt[3]), 1/Sqrt[3], 
       2}, {1/Sqrt[3], 1/Sqrt[3], 
       -(1/Sqrt[3]), 2}}
    
    Out[85]=
    {4/3, 4/3, 4/3, 4/3, 0, 0, 0, 0, 0, 0, 
      -(4/3), -(4/3), -(4/3), -(4/3)}
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Help about Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: June 1st 2010, 11:46 AM
  2. help me in Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 18th 2010, 01:26 AM
  3. Mathematica
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 24th 2010, 07:13 AM
  4. mathematica help!
    Posted in the Math Software Forum
    Replies: 2
    Last Post: February 15th 2010, 03:59 PM
  5. MLE and Mathematica
    Posted in the Math Software Forum
    Replies: 0
    Last Post: June 21st 2008, 01:27 AM

Search Tags


/mathhelpforum @mathhelpforum