How to solve (minimize) with restrictions a system of three equations with three unknown variables

I have a system of three equations that I use to determine coordinates after a movement towards a point through the straightest path, i.e. a distance reduction equation and two vector alignment equations. I would like to keep moving towards my heading at the fastest way possible, but avoiding collision with an obstacle, I need therefore to minimize the systems solution while applying up to 26 restrictions. Which processes are at my disposal to do so?
The input for my function containing the three equations is as varied as data coming from various vectors. Here is the system:
function qmv=quickmove(ss,d1,d2,d3,hx,hy,hz)
global a b c ;
qmv(1)=sqrt((d1-hx).^2+(d2-hy).^2+(d3-hz).^2)-sqrt((a-hx).^2+(b-hy).^2+(c-hz).^2)-ss==0;
qmv(2)=sqrt((d1-hx)^2+(d2-hy)^2)*abs(a-hx)-sqrt((a-d1)^2+(b-hy)^2)*abs(d1-hx)==0;
qmv(3)=sqrt((d3-hz)^2+(d2-hy)^2)*abs(b-hy)-sqrt((c-hz)^2+(b-hy)^2)*abs(d2-hy)==0;
end
Is this correct? d1,d2,d3 are the starting coordinates of my object and hx,hy,hz are the final destination coordinates and ss is the speed of my object.
Thank you for any help you can provide.

답변 (2개)

Orion
Orion 2014년 10월 13일
Hi,
if you have the optimization toolbox, you can use fmincon ( Find minimum of constrained nonlinear multivariable function )

댓글 수: 2

fmincon shoes an example for f(x) but could I do the same for f(x,y,z)? And also, I require the input of parameters that will be determined during the programm and cannot input them beforehand. How do I do this? Or is it even possible?
The x in fmincon is a vector, so f(x) could equal f([x,y,z]), if you see what I mean.
As long as fmincon has the values it needs at the time it needs them, there is no problem. But I do not quite know how you are going to ensure that it does. I think you need to parameterize your problem, have fmincon adjust the parameters to ensure both feasibility (no crashes) and minimum time.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

댓글을 달려면 로그인하십시오.

Actually,
all your variables ( x, y and z ) are defined in one vector when you use fmincon.
meaning :
x -> x(1)
y -> x(2)
z -> x(3)
so if you have n unknown, you'll have a n*1 vector x
you need to "recode" :
sqrt((d1-hx).^2+(d2-hy).^2+(d3-hz).^2).....
as
sqrt((d1-x(1)).^2+(d2-x(2)).^2+(d3-x(3)).^2)....
and so on.
and for your input parameters_, it should work with global variables, just don't use a,b,c, but more complicated names (like MyInputParam_a) to avoid potential conflict.

카테고리

도움말 센터File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

질문:

2014년 10월 13일

댓글:

2014년 10월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by