Having problem with @fsolve function
Afficher commentaires plus anciens
The following code worked properly in matlab2018b version; however, updating the new version matlab2019b, it does not work. Any advise?
% Options for solving the speed
opt = optimoptions(@fsolve, 'Display', 'none');
lam = @(wr) rt*wr/vw;
inv_lami = @(wr)1./(lam(wr) + 0.08*beta^2) - 0.035/(beta^3 + 1);
Cp = @(wr)0.22.*(116 .* inv_lami(wr) - 0.4*beta - 5).*exp(-12.5.*inv_lami(wr));
P = @(wr) 0.5*rho*A*Cp(wr)*vw^3;
Teq = @(wr) P(wr)./wr;
[wmaxP,Pmax] = fminbnd(@(wr) -P(wr), 0, 2.5);
[wmaxT,Tmax] = fminbnd(@(wr) -Teq(wr), 0, 2.5); Tmax = -Tmax;
wt0 = fsolve(Teq, 1.1*wmaxT, opt);
wts = linspace(0,wt0,10000);
An error occurs as follows:
Invalid solver specified. Provide a solver name or handle (such as 'fmincon' or @fminunc).
Type DOC OPTIMOPTIONS for a list of solvers.
Error in Untitled2 (line 37)
opt = optimoptions(@fsolve, 'Display', 'none');
2 commentaires
Walter Roberson
le 3 Déc 2019
I speculate that you might not have installed the Optimization Toolbox.
MP
le 5 Déc 2019
Réponses (0)
Catégories
En savoir plus sur Nonlinear Optimization 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!