0

I'm currently using Matlab's fsolve() to solve a system of three equations with eight unknowns (equations of motion for a four thruster vehicle - force and angle per thruster). I realize there is an infinite number of solutions available, but I'd still like for fsolve to give me an answer. Most of the time it can. That said, when running it in a simulation loop, I have found that towards the end of my simulation fsolve fails repeatedly to find a solution. I've tried increasing the tolerance and maximum number of iterations (it terminate out on max iterations reached), but that doesn't seem to help.

Is there a way to better help fsolve() in this configuration? Is it wrong to expect fsolve to provide any type of answer given my number of equations? Any advice is welcome.

Thanks!

  • 2
    without example, it's hard to know what you expect. You can try setting bounds if you know that `x – Laure Dec 08 '17 at 08:16
  • What do you expect "an answer" to be?? You recognise that there are infinitely many solutions, but haven't said which one you want. Simple example, take `x + y = 5` as 1 equation with 2 unknowns. What would you expect to get out of looking at this? `x=2, y=3` or `x=1e5, y=-1e5 + 5` or `y = (10 - 2*x)/2`... I'm not sure you fully grasp why your problem isn't properly defined. You should try and add more constraining equations and reform your problem. – Wolfie Dec 08 '17 at 10:29
  • I think the problem is the initialization that the nonlinear solver relies heavily on. You can try to initialize it carefully. – Blue Bird Dec 08 '17 at 11:47
  • I think my problem is indeed that I'm not considering there may be no solution. A closer look at the numbers going into the system have me trying to solve for a Fx, Fy, Mz (forces/moment) that just cannot be achieved as some component of the forces will negate the desired moment. I'll see what I can do about keeping better control of the constraints. Thanks for the advice! – user7509231 Dec 08 '17 at 14:35

0 Answers0