Effacer les filtres
Effacer les filtres

Solver Stop Prematurely as new equation added

10 vues (au cours des 30 derniers jours)
Muhd Jasrim
Muhd Jasrim le 19 Juin 2024
Commenté : Alex Sha le 22 Juin 2024
Hi, How do I solve this? keep getting the solve stop prematurely. May I know what should I do? this happen when i try added another equation in my model. Any Suggestion?
  1 commentaire
Alex Sha
Alex Sha le 22 Juin 2024
@Muhd Jasrim please give out the full code in text, not in picture

Connectez-vous pour commenter.

Réponses (1)

Torsten
Torsten le 19 Juin 2024
Use an options structure for "fsolve" as
options = optimset('MaxFunEvals',100000,'MaxIter',100000)
sol = fsolve(...,options)
and try again.
  2 commentaires
Muhd Jasrim
Muhd Jasrim le 19 Juin 2024
options = optimset('MaxFunEvals',100000,'MaxIter',100000)
steady_state_values = fsolve(steady_state_fun, initial_guess, options);
am I right, the way I wrote the codes? because it still prematurely stop. Does this relate to the equation I inserted?
Thankyou :)
Torsten
Torsten le 19 Juin 2024
Modifié(e) : Torsten le 19 Juin 2024
The options
options = optimset('MaxFunEvals',100000,'MaxIter',100000)
give "fsolve" more iterations to converge (if the solver stops now prematurely, it should show that the Maximum Number of Iterations (10000) has been reached).
If this doesn't help and the problem came after inserting the new equation, you should think about why the new equation made your problem that more difficult or even unsolvable.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by