Solving a nonlinear equation problem
3 views (last 30 days)
Show older comments
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.
Answers (3)
Andrew Newell
on 12 Apr 2011
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.
0 Comments
Andrew Newell
on 12 Apr 2011
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 Comments
Steve Grikschat
on 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.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!