A,B,C,D,E,F are known numerical values
I want to find x and y such that
Signum (-x+A).B +(y+C).D = -1
AND
x.E-y.F=G
AND
|G| minimised
I think I can see how to write a routine to do this. However, do any of the commands do this?
All help much appreciated.
Global Optimization
If you have the Global Optimization toolbox that is an add-on for Maple, you could do something like the following:
eq1 := signum((-x+A)*B+(y+C)*D) = -1;
GlobalOptimization[GlobalSolve](abs(x*E-y*F), {eq1}, x = -10 .. 10, y = -10 .. 10, A = -10 .. 10, B = -10 .. 10, C = -10 .. 10, D = -10 .. 10, E = -10 .. 10, F = -10 .. 10);
This will run through and find you the value where G=0 which would be the minimum of abs(G). It is possible that you can know that this is the minimum and you could possible use one of the solve commands to find the values also (but I haven't found the correct call for this yet).
Scott
Sadly I do not have the
Sadly I do not have the Global Optimization toolbox
More generally can signum be used with the standard optimisation package as Maple 10 reports 'no iterations performed' when I attemp this.
data
Could you post the values of A,B,C,D,E, and F?
acer
Re: data
GlobalOptimization returned the following:
[0., [x = 1.00000023841857910, y = -1.00000023841857910, A = 1.00000023841857910, B = -1.00000023841857910, C = -1.00000023841857910, D = 1.00000023841857910, E = -1.00000023841857910, F = 1.00000023841857910]]
These are the values of x,y,A,B,C,D,E,F that will give G as 0.
But this is only one of the solutions. It appears that any number that is
x = A = D = F = -y = -B = -C = -E
may be solutions.
Scott
Re: data
Well, solve() should be able to handle (eq1,G=0}. So perhaps there's not need for optimizing in that case.
I rather got the impression that the OP had some specific values of the parameters in mind, and that those might not be free to range.
I thought that one might use Optimization:-Minimize, being careful with the abs, and either choosing a method not requiring derivatives or supplying them by hand. While GlobalOptimization might require only Lipschitz continuity, Optimization is pickier but sometimes one can coerce it.
acer
Please clarify your question.
I need some clarification since the solution below does not require
any actual optimization by Maple.
I am assuming that you have numerical values, not ranges, for A, B, C, D, E, and F.
Your first constraint is a linear constraint, either a*x+b*y<k or a*x+c*y<=k, that
gives a half-plane.
You are then looking for the smallest, in absolute value, G such that the line
x*E-y*F=G intersects the half-plane. If the line a*x+b*y=k and the line x*E-y*F=0
are not parallel or k>0, the answer is 0. If they are parallel and k>0, a
simple computation will give you the G such that the lines are identical
and that gives you your infimum. (It is a minimum only if you have a*x+c*y<=k. )
From here you can get a point on the line x*E-y*F=G that is in your half-plane.
This can also be reformulated as a linear programming problem.
Is that what you want?
Re: Please clarify your question.
Nice.
Now I feel silly for not bothering to think first, about the nature of the equations.
acer
A,B,C,D,E,F are specified
A,B,C,D,E,F are specified numbers and not ranges.
That is most helpful and clearly explained.
Many thanks