Solving a nonlinear equation problem
Ältere Kommentare anzeigen
Hello. I am trying to solve the equations:
xl+d*vx-k*xlp=0
yl+d*vy-k*ylp=0
zl+d*(sqrt(1-vx^2-vy^2))+k*c=0
where xl,yl,zl,vx,vy,and k are unknowns. xlp, ylp, and c are known. I need help to choose which function that I should use and how?
I already try the 'fsolve' function and there was a warning "Optimizer appears to be converging to a point which is not a root. Norm of relative change in X is less than max(options.TolX^2,eps) but sum-of-squares of function values is greater than or equal to sqrt(options.TolFun) Try again with a new starting guess."
am I in a right way or not?
I really need help about this.
Antworten (3)
Andrew Newell
am 12 Apr. 2011
0 Stimmen
Your problem is ill-determined. You have three equations for six unknowns (and possibly a seventh, d). You need to either add some equations or reduce the number of unknowns.
Nindya Putri
am 12 Apr. 2011
0 Stimmen
Andrew Newell
am 12 Apr. 2011
0 Stimmen
Now you have 18 equations for 11 unknowns, so the system is overdetermined. Unless some of these equations are redundant, you will have no solutions.
It appears that you are trying to solve for a set of unit vectors. Maybe they aren't unit vectors? You could try replacing each square root by an independent variable. That would give you 17 unknowns.
It would make sense to have 9 three-dimensional vectors, for a total of 18 variables.
5 Kommentare
Nindya Putri
am 12 Apr. 2011
Andrew Newell
am 12 Apr. 2011
From the documentation: "The default trust-region dogleg method can only be used when the system of equations is square, i.e., the number of equations equals the number of unknowns. For the Levenberg-Marquardt and Gauss-Newton methods, the system of equations need not be square."
Nindya Putri
am 13 Apr. 2011
Steve Grikschat
am 18 Apr. 2011
You can validate that the result is correct by checking the residual (fsolve has done this for you and it appears to not be close to zero).
However, since this isn't a square system, you are solving an overdetermined least-squares problem which means that the solution only minimizes the sum of squares. In this case, you might check optimization-related quantities like the first-order-optimality measure. This tells you how close to a minimizer you got.
Again, fsolve has done this and it seems that it is not close enough (compared to options.TolFun). However, if it is small enough, you might be satisfied.
There are multiple solutions to your (least-squares) problem. You might have gotten close to one.
Nindya Putri
am 22 Apr. 2011
Kategorien
Mehr zu Choose a Solver finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!