Legrange->System of equations

  • Thread starter adm_strat
  • Start date
In summary, the objective is to accurately approximate the minimum distance between two points on the graphs of functions and to determine the relationship between the derivatives of the two functions at those points. This can be achieved by formulating the problem as a minimization of a given equation and using Lagrange multipliers or minimizing the equation directly. The resulting equations can then be solved using methods such as substitution or using software like Mathematica.
  • #1
adm_strat
13
0
[SOLVED] Legrange-->System of equations

Homework Statement



Suppose (a,b) is on the graph of [tex]f(x)=x^{2}[/tex] and (c,d) is on the graph of g(x)=ln(x)

a) Accurately approximate the minimum distance between (a,b) and (c,d)
b) Accurately approximate (a,b) and (c,d)
c) What is the relationship between f'(a) and g'(c)


Homework Equations



Just a Legrange


The Attempt at a Solution



The function that needs to be minimized is [tex]\sqrt{(a-c)^{2} + (b-d)^{2}}[/tex]
Which can be left as [tex](a-c)^{2} + (b-d)^{2}[/tex] because they will both be minimized at the same place

The Legrange:
[tex]L(a,b,c,d,\lambda ,\mu )=(a-c)^{2} + (b-d)^{2} - \lambda (a - b^{2}) - \mu (b-ln(d))[/tex]

This gave me the six equations:

[tex]L_{a}= 2a - 2c - \lambda = 0[/tex]
[tex]L_{b}= 2b - 2d - 2\lambda b = 0[/tex]
[tex]L_{c}= 2c - 2a - \mu = 0[/tex]
[tex]L_{d}= 2d - 2b - \frac{\mu }{d}= 0[/tex]
[tex]L_{\lambda }= a = b^{b}[/tex]
[tex]L_{\mu }= c = ln (d) [/tex]

This is where I am stuck
I tried for quite some time to solve for the system of equations and I am at a point where i don't know where to go.

The things I got out of them is:

[tex]\lambda[/tex] = -[tex]\mu[/tex] This is from [tex]L_{a}=L_{c}[/tex]
and
[tex]bd=\frac{1}{2}[/tex]

I got this by taking [tex]L_{a}=0[/tex] and [tex]L_{b}=0[/tex] therefore:
[tex]L_{a} = L_{b} [/tex] --> [tex]L_{a} - L_{b} = 0 [/tex] --> [tex]L_{a} - L_{b} = L_{c} [/tex]

And so on till I got: [tex]L_{a} - L_{b} - L_{c} - L_{d} = 0 [/tex]
Then using some substitution for [tex]\lambda[/tex] and [tex]\mu[/tex] I got bd =[tex]\frac{1}{2}[/tex]


The instructor of my course said I could use software on any of the problems in the handout but even when I tried plugging the equations into mathematica I got an error. I just don't know where to go with the equations.
 
Physics news on Phys.org
  • #2
[itex]L_\lambda = a - b^2[/itex] and [itex]L_\mu= c - ln (d)[/itex] are binding; so a = b^2 and c = ln (d). These plus the 4 equations Lp = 0 for p = a, b, c, d give you 6 equations in 6 unknowns (a, b, c, d, [itex]\lambda, \mu[/itex]).

In mathematica try Solve[eq1 == ... == eq6 == 0}. (Edit: Solve[eq1 == ... == eq6 == 0].)
 
Last edited:
  • #3
Thanks for the response

I typed it in as you instructed (as close as possible to yours)

I received the response that is shown in my attachment. Why does it not give me numeric results? I could have received 20 different representations for that if I wanted to simply by rearranging equations.
Can I use these results to get numerical results in mathematica or do I need to sit down and start to rearrange equations again?
(which I am doing anyways)

Thanks again
 

Attachments

  • Mma.JPG
    Mma.JPG
    12.9 KB · Views: 368
  • #4
My guess is that the "Log" term is creating a nonlinearity that Mathematica finds difficult to solve analytically. An alternative solution method:

FindRoot[
{
D[L[a, b, c, d, \[Lambda], \[Mu]], a] ==
D[L[a, b, c, d, \[Lambda], \[Mu]], b] ==
D[L[a, b, c, d, \[Lambda], \[Mu]], c] ==
D[L[a, b, c, d, \[Lambda], \[Mu]], d] ==
D[L[a, b, c, d, \[Lambda], \[Mu]], \[Lambda]] ==
D[L[a, b, c, d, \[Lambda], \[Mu]], \[Mu]] == 0
},
{{a, 1}, {b, 1}, {c, 2}, {d, Log[2]}, {\[Lambda], 1}, {\[Mu], 1}}
]

yields:

{a -> 0.289624, b -> 0.538168, c -> -0.0735622,
d -> 0.929078, \[Lambda] -> 0.726373, \[Mu] -> -0.726373}
 
Last edited:
  • #5
You can also try substituting Exp[c] = d for c = Log[d]. The "Exp" expression seems to work with Solve. Defined that way, Solve yields:

{a -> 0.289624, b -> 0.538168, c -> -0.0735622,
d -> 0.929078, \[Lambda] -> 0.726373, \[Mu] -> -0.726373}

which is the identical to the FindRoot solution above.
 
  • #6
adm_strat said:

Homework Statement



Suppose (a,b) is on the graph of [tex]f(x)=x^{2}[/tex] and (c,d) is on the graph of g(x)=ln(x)

Are you supposed to use Lagrange multipliers? Perhaps the approach minimizing would be good, too.

Reformulation: Minimize [tex]H(s,t)=(t-s)^2+(t^2-\ln s)^2[/tex] for [tex]s,t \in \mathbb R[/tex] and [tex]s>0[/tex].

Differentiating:
[tex]H_t=2(t-s)+4t(t^2-\ln s)=0[/tex]
[tex]H_s=-2(t-s)-\frac{2(t^2-\ln s)}s=0[/tex]

Adding these two equations yields:
[tex]4t(t^2-\ln s)-\frac{2(t^2-\ln s)}s=0[/tex]
[tex](t^2-\ln s)\left(4t-\frac{2}s\right)=0[/tex]

Using these equations we get [tex]2ts=1[/tex].

By plugging this into one of the above equation we get
[tex]2(t-1/2t)+4t(t^2+\ln(2t))=0[/tex]
One equation, one unknown - perhaps easier to solve.

More generally: Minimize [tex]H(s,t)=(t-s)^2+(f(t)-g(s))^2[/tex].

Differentiating:
[tex]H_t=2(t-s)+2f'(t)(f(t)-g(s))=0[/tex]
[tex]H_s=-2(t-s)-2g'(s)(f(t)-g(s))=0[/tex]


[tex]f'(t)(f(t)-g(s))-g'(s)(f(t)-g(s))=(f'(t)-g'(s))(f(t)-g(s))=0[/tex]

Two possibilities:
[tex]f(t)=g(s)[/tex] which implies (using the above equations) [tex]t=s[/tex], i.e. the two graphs have intersection.
[tex]f'(t)=g'(s)[/tex] (the tangent lines are parallel) and [tex]t-s+f'(t)(f(t)-g(s))=0[/tex] (the line segment between the two points is perpendicular to the tangent line)
This corresponds very nicely to our geometrical intuition.
[I guess this is what your teacher wants you to see - at least that's why there is the last question.]
 
  • #7
I tried to simply minimize the equation like you did kompik since I cannot get mathematica to spit out the results (I don't know why, but it doesn't matter).

I couldn't get mathematica to solve the equation so I simply put it into my calculator and used the zero function to get my answer. I got 0.538168 for the s value in your equation.

To find the error in this estimation (since my calculator only gives me the answer to a few decimals)

t = 0.538168

[tex]2(t-1/2t)+4t(t^2+\ln(2t))=3.6947 x 10^{-6}[/tex]

[tex]\frac{0.538168-3.6947 x 10^{-6}}{0.538168} x 100 = 99.9993 Percent[/tex] << Good enough for me. Thanks for the help.
 
Last edited:

Related to Legrange-&gt;System of equations

What is the Legrange-System of equations?

The Legrange-System of equations is a set of equations used to solve optimization problems in mathematics. It involves finding the maximum or minimum value of a function subject to certain constraints.

How is the Legrange-System of equations different from other methods of solving optimization problems?

The Legrange-System of equations uses a systematic approach to solving optimization problems, by introducing a set of Lagrange multipliers to represent the constraints. This method is more efficient and reliable compared to other methods.

What are the applications of the Legrange-System of equations?

The Legrange-System of equations has various applications in fields such as economics, physics, engineering, and computer science. It can be used to solve problems involving optimization, such as maximizing profits or minimizing costs.

Can the Legrange-System of equations be used for non-linear problems?

Yes, the Legrange-System of equations can be used for both linear and non-linear problems. It is a versatile method that can be applied to a wide range of optimization problems.

What are the limitations of the Legrange-System of equations?

The Legrange-System of equations may not always provide a unique solution, especially in cases where the constraints are not independent. It also requires some knowledge and understanding of calculus to apply it effectively.

Similar threads

Replies
3
Views
486
  • Special and General Relativity
Replies
1
Views
93
  • Calculus and Beyond Homework Help
Replies
6
Views
358
  • Calculus and Beyond Homework Help
Replies
2
Views
437
  • Calculus and Beyond Homework Help
Replies
7
Views
600
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
20
Views
522
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
15
Views
403
  • Calculus and Beyond Homework Help
Replies
10
Views
537
Back
Top