Problem with initial guess of a nonlinear system using fsolve
Afficher commentaires plus anciens
Dear all, actually I’m dealing with a problem involving the solution of a nonlinear system. I’m recicling the lines I wrote above for the solution of an implicit equation so:
f=@(x) myfun(x,k1,k2...) With k constants. [x]=fsolve(f,x0)
With myfun: Function F=myfun(x,k1,k2,...)
..some passages..
F(1)=implicit eq.
It works fine. If I use the same form to solve a system:
f=@(x,y) myfun(x,y,k1,k2...) With k constants.
x0y0=[x0,y0] [x,y]=fsolve(f,x0y0)
With myfun:
Function F=myfun(x,y,k1,k2,...)
..some passages..
F(1)=funct(x,y) F(2)=funct(x,y)
I get an error, and it is due to the fact that the vector of inital guess gives problem. I also tried writing fsolve(f,x0,y0) but only x0 is read as initial guess, while y0 is read as option (a structure). Could you suggest me how to fix this problem? Thanks in advance, Niccolò
1 commentaire
niccolò guazzi
le 19 Mai 2019
Modifié(e) : niccolò guazzi
le 19 Mai 2019
Réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!