Hi, I want to solve a equation for a variable. I am not able to figure out which command should I use to solve it and how.
1 次查看(过去 30 天)
显示 更早的评论
The problem is as follows
tauc*alp_g*G*As + Skyemi*eps_g*sig*As*Tsky.^4 - eps_g*sig*As*Tg.^4 - ha*As*(Tg - Tamb) + (T2 - Tg)/((delxr)/(1/(hi*As)+(kroof*As)))
I want to solve for the variable Tg.
0 个评论
采纳的回答
Walter Roberson
2017-4-2
If you have the symbolic toolbox then you can
syms Tg
and then define the equation and use solve()
Otherwise you can do some minor algebra to expand the equation into a polynomial, and write out the terms from largest to smallest, and use roots() to get numeric solutions.
Note: there will be four solutions but we do not have enough information to know if they will all be real-valued
3 个评论
Walter Roberson
2017-4-2
Use
syms Tg nonnegative
Using the previous value would be useful if you were doing a numeric solution using fsolve() or fzero(), but you do not need to use those.
Direct numeric approach:
all_Tg = roots( [As^2*delxr*eps_g*hi*sig, 0, 0, 1+hi*(delxr*ha+kroof)*As^2, -hi*((Skyemi*Tsky^4*eps_g*sig+G*alp_g*tauc+Tamb*ha)*delxr+kroof*T2)*As^2-T2] );
Tg = all_Tg( imag(all_Tg) == 0 & real(all_Tg) >= 0 );
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!