Post Reply 
Find minimum or maximum of multi-variable function
08-16-2021, 08:43 PM
Post: #17
RE: Find minimum or maximum of multi-variable function
(08-30-2019 11:01 AM)teerasak Wrote:  I got strange calculation result c_0. What does it mean? I try to evaluate it numerically, it still leave c_0 as the result.

The solution substituted back to sum of distance get it right.

XCAS> a := sqrt((x-14)^2 + (y-55)^2)
XCAS> b := sqrt((x-23)^2 + (y-95)^2)
XCAS> sol := solve(diff(a+b,x)=0 and diff(a+b,y)=0, [x,y])

[[(9*c__0+574)/41,(40*c__0+2255)/41] , [(-9*c__0+574)/41,(-40*c__0+2255)/41]]

XCAS> simplify(subst(a+b, [x,y]=sol[0]))

abs(c__0) + abs(c__0 - 41)

minimum sum of distance = 41

This is equivalent to do translation and rotation by hand (distance preserved)

sum of distance
= (|z - (14+55i)|) + |z - (23+95i)|)
= (|z'| + |z' - (9+40i)|) * |(9-40i)/41|         // z' = z - (14+55i)
= (|z''| + |z'' - 41|)                                    // z'' = z' * (9-40i)/41

z = z' + (14+55i) = z'' * (9+40i)/41 + (14+55i) = (9*z''+574)/41 + (40*z''+2255)/41
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Find minimum or maximum of multi-variable function - Albert Chan - 08-16-2021 08:43 PM



User(s) browsing this thread: 2 Guest(s)