fsolve does not have any way of putting in bounds constraints, so it has no way to prevent any of the parameters being tested from going negative.
fsolve works numerically, so it must probe locations "past" the zero location on all sides. It could easily end up probing a negative location while looking for a location that makes the value zero.
If you need to constrain E to positive, define E=x(3).^2 and understand that there will then be two potential solutions, and remember to square the 3rd element of the solution vector afterwards.
0 Comments
Sign in to comment.