Effacer les filtres
Effacer les filtres

Two Non-Linear Equations, Two unknowns

1 vue (au cours des 30 derniers jours)
Daniel
Daniel le 21 Sep 2015
Commenté : Star Strider le 21 Sep 2015
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;

Réponse acceptée

Star Strider
Star Strider le 21 Sep 2015
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 commentaires
Daniel
Daniel le 21 Sep 2015
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 le 21 Sep 2015
Again, my pleasure.
Glad you got it sorted.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by