Two Non-Linear Equations, Two unknowns

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;

 采纳的回答

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 个评论

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!
Got it. FIxed it by fixing another typo I had in my code while waiting for some help. Thanks again, I really appreciate it.
Again, my pleasure.
Glad you got it sorted.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by