How to find solution using VPASOLVE

1 vue (au cours des 30 derniers jours)
Harshpreet Singh Phull Bakshi
Modifié(e) : John D'Errico le 21 Avr 2021
Hello,
I'm trying to get the values of s and l using vpasolve. There's an external website that does give me a close approximation to the correct answer but I'm trying to figure out why MATLAB doesn't. I already know the answers for variables s and l, which are 100 and 102 respectively. Just trying to understand why MATLAB isn't giving me the correct answer. The code I'm using is given below:
clc, clear all
clearvars
syms s l
eq1 = 90.32362e-3==(1)/(1+(s/l)+(s/11))
eq2 = 475.2848e-3==(1)/(1+(s/l)+(s/809))
eq3 = 501.751e-3==(1)/(1+(s/l)+(s/7919))
eq4 = 308.051e-3==(1)/(1+(s/l)+(s/79))
eq1=subs(eq1); eq2=subs(eq2); eq3=subs(eq3); eq4=subs(eq4);
[s,l]=vpasolve([eq1, eq2, eq3, eq4], [s,l],[100,100])

Réponses (1)

John D'Errico
John D'Errico le 21 Avr 2021
Modifié(e) : John D'Errico le 21 Avr 2021
You have 2 variables, with 4 equations. vpasolve is NOT a tool that attmepts to solve a problem APPROXIMATELY. You cannot use vpasolve here. Instead, use lsqnonlin.

Catégories

En savoir plus sur Symbolic Math Toolbox 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!

Translated by