How to find solution using VPASOLVE

4 visualizaciones (últimos 30 días)
Harshpreet Singh Phull Bakshi
Harshpreet Singh Phull Bakshi el 21 de Abr. de 2021
Editada: John D'Errico el 21 de Abr. de 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])

Respuestas (1)

John D'Errico
John D'Errico el 21 de Abr. de 2021
Editada: John D'Errico el 21 de Abr. de 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.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by