How to find solution using VPASOLVE

2 ビュー (過去 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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by