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.

采纳的回答

Walter Roberson
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
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 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