How to find solution using VPASOLVE

4 views (last 30 days)
Harshpreet Singh Phull Bakshi
Edited: John D'Errico on 21 Apr 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])

Answers (1)

John D'Errico
John D'Errico on 21 Apr 2021
Edited: John D'Errico on 21 Apr 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.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!