fsolve for a set of equations
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have a trouble solving this set of equations:
syms E
f1 = (-j*(sqrt(((2*mb)./h_.^2)*(E - V0) - k_I(i).^2))/mb) - ((sqrt(((2*mw./h_.^2)*E) - k_I(i).^2))/mw)*tan(0.5*(sqrt(((2*mw./h_.^2)*E) - k_I(i).^2))*a);
f2 = (-j*(sqrt(((2*mb)./h_.^2)*(E - V0) - k_I(i).^2))/mb) + ((sqrt(((2*mw./h_.^2)*E) - k_I(i).^2))/mw)*cot(0.5*(sqrt(((2*mw./h_.^2)*E) - k_I(i).^2))*a);
F = @(E) [f1; f2];
x0 = [10;10];
[F, fval] = fsolve(F, x0)
I get an error 'FSOLVE requires all values returned by functions to be of data type double.'. How can I correct the code? And what's the best way to solve such set of equations?
Thank you for any help provided to that issue.
Kind regards,
Ann
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!