Solving an equation with one variable

23 ビュー (過去 30 日間)
Venkatesh Tanikonda
Venkatesh Tanikonda 2019 年 10 月 23 日
回答済み: Star Strider 2019 年 10 月 23 日
How can I solve :
(q*a^4/(E*t^4)) = k1*y/t + k2*(y/t)^3;
q,a,t,E,k1,k2 are constants; where as y is the variable.
How to write matlab code to solve this in terms of y.

採用された回答

Star Strider
Star Strider 2019 年 10 月 23 日
One approach:
Out = fzero(@(y) (q*a^4/(E*t^4)) - k1*y/t + k2*(y/t)^3, 2)
That assumes that all ‘constants’ are scalars. Choose the initial estimate (here 2) that best approximates the value for ‘y’ that you want to find.

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2019 年 10 月 23 日
syms q a t E k1 k2 y
eq = (q*a^4/(E*t^4)) == k1*y/t + k2*(y/t)^3;
sol = solve(eq,y,'MaxDegree', 3);

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by