What function to use to solve an equation for a variable that's on both sides of the equation?

39 ビュー (過去 30 日間)
Lu Da Silva
Lu Da Silva 2020 年 10 月 30 日
編集済み: KSSV 2020 年 10 月 30 日
I need to find s. Every other variable is given; they're all constants except for "e" which is a vector (of 50 given values).
s = a / b
where a = 3 * c^2 * d where c = sqrt(e/(3*d*s))
and b = e - f * g^2 where g = c + (c*s)/(1-s)
I'm confused because s is difficult to isolate manually....
Should I try put the equations all together in order to get s = ........ ? and then put the single s on the right side of the equation so i have an equation == 0 ? What MATLAB function would I have to use to solve it that way? Or is there a simpler manner?
Thanksss
  1 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 10 月 30 日
You said "I need to find s. Every other variable is given". But then you can simply find s using s = a/b.

サインインしてコメントする。

回答 (2 件)

KSSV
KSSV 2020 年 10 月 30 日
編集済み: KSSV 2020 年 10 月 30 日
syms s a b c d e f g
c = sqrt(e/(3*d*s)) ;
g = c + (c*s)/(1-s) ;
a = 3*c^2*d ;
b = e-f*g^2 ;
eqn = s - a/b==0 ;
Try using solve in eqn.
sol = solve(eqn,s) ;

Ameer Hamza
Ameer Hamza 2020 年 10 月 30 日

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by