So, I think this is that easy. Two non-linear equations, two unknowns. I know I once knew how to do this, but now I don't seem to be able to do it. I tried the min command, but that's just for arrays. I tried fsolve(E1,E2) which didn't work because it wants "double". Fminbnd didn't work either, I think because it can't handle two functions. I know my answer should be around Ts=290 and Ta=250, ish. It's just a simple command somewhere, but I can't find it. Any help would be appreciated. Thanks for taking the time!
alphaS=0.11; ta=0.53; alphaA=0.3; tprimea=0.06; alphaprimea=0.31;
C=2.5;
So=6.28e7; %Solar Constant, p.110
sigma=5.67e-8; %Boltzman's Constant, p. 110
%syms Ta Ts
E1=@(Ts,Ta)ta*(1-alphaS)*So/4-C*(Ts-Ta)-sigma*Ts^4*(1-alphaprimea)+...
sigma*Ta^4;
E2=@(Ts,Ta)(1-alphaA-ta*(1-alphaS))*So/4+C*(Ts-Ta)+sigma*Ts^4*...
(1-tprima-alphaprimea)-2*sigma*Ta^4;

 채택된 답변

Star Strider
Star Strider 2015년 9월 21일

0 개 추천

One problem is a typo in ‘E2’, where there’s an ‘e’ wanting in ‘tprima’. With that and creating ‘E1E2’ from both functions:
alphaS=0.11; ta=0.53; alphaA=0.3; tprimea=0.06; alphaprimea=0.31;
C=2.5;
So=6.28e7; %Solar Constant, p.110
sigma=5.67e-8; %Boltzman's Constant, p. 110
E1=@(Ts,Ta)ta*(1-alphaS)*So/4-C*(Ts-Ta)-sigma*Ts^4*(1-alphaprimea)+...
sigma*Ta^4;
E2=@(Ts,Ta)(1-alphaA-ta*(1-alphaS))*So/4+C*(Ts-Ta)+sigma*Ts^4*...
(1-tprimea-alphaprimea)-2*sigma*Ta^4;
E1E2 = @(B) [E1(B(1),B(2)); E2(B(1),B(2))];
B0 = [290; 250];
TsTa = fsolve(E1E2, B0)
TsTa =
4.5604e+003
3.5995e+003
Since this may not be the result you want, you may need to experiment with it, particularly with respect to a different ‘B0’. (This code assumes both equations equate to zero, as fsolve requires.)

댓글 수: 4

Daniel
Daniel 2015년 9월 21일
Yeah, forgot to mention they were equal to zero, thanks. And a typo, dang it all. I could have spent all night and never found that. Not working quite yet, but a definte step in the right direction, thanks!
Star Strider
Star Strider 2015년 9월 21일
My pleasure!
Daniel
Daniel 2015년 9월 21일
Got it. FIxed it by fixing another typo I had in my code while waiting for some help. Thanks again, I really appreciate it.
Star Strider
Star Strider 2015년 9월 21일
Again, my pleasure.
Glad you got it sorted.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2015년 9월 21일

댓글:

2015년 9월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by