How to find solution using VPASOLVE

조회 수: 4 (최근 30일)
Harshpreet Singh Phull Bakshi
Harshpreet Singh Phull Bakshi 2021년 4월 21일
편집: John D'Errico 2021년 4월 21일
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])

답변 (1개)

John D'Errico
John D'Errico 2021년 4월 21일
편집: John D'Errico 2021년 4월 21일
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.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by