Anda di halaman 1dari 4

SOLVINGNONLINEARSETOFEQUATIONSUSINGMATALB:

TheMATLABroutinefsolveisusedtosolvesetsofnonlinearalgebraicequationsusingaquasiNewton
method.Theusermustsupplyaroutinetoevaluatethefunctionvector;
F(x)=0.
Where,xisavectorandF(x)isafunctionthatreturnsavectorvalue.Followingsectiondescribethe
procedureappliedincurrentproblem.
Thefollowingsystemofnonlinearequationsobtainedafterapplyingnumericaltechniquetoproblem,
weobtained9equationswithnineunknownnodaltemperatures.SolveforT1,T2,T3,T4,T5,T6,T7,T8
andT9:
-7T1 + T2 + T3 + 2865 =0
T1-8T2+2T4+2865=0
T1+2T4+T6-4T3=0
T2+T3+T5+T7-4T4=0
2T4+2T8-4T5=0
T3-3.5T6+T7-3.645e-9T64+456.2=0
2T4+T6-7T7+T8-7.29E-9T74+912.314=0
2T5+T7-7T8+T9-7.29E-9T84+912.314=0
T8-2.5T9-3.64E-9T94+456.157=0
Themfileusedtosolvetheaboveproblemusingfsolveis:
*************************************************************************************
%
%
%
%
%

This function solve the nonlinear set of equations


for heat loss through chimney, heat transfer problem
solved by Numerical Technique.
REF BOOK:given in Younus Cengel
Example Problem# 5-4; Pg#287

function F = Tempdist(T)
F(1) = -7*T(1)+T(2)+T(3)+2865;
F(2) = T(1)-8*T(2)+2*T(4)+2865;
F(3) = T(1)-4*T(3)+2*T(4)+T(6);
F(4) = T(2)+T(3)-4*T(4)+T(5)+T(7);
F(5) = 2*T(4)-4*T(5)+2*T(8);
F(6) = T(3)-3.5*T(6)+T(7)-3.645E-9*T(6)^4+456.2;
F(7) = 2*T(4)+T(6)-7*T(7)+T(8)-7.29E-9*T(7)^4+912.314;
F(8) = 2*T(5)+T(7)-7*T(8)+T(9)-7.29E-9*T(8)^4+912.314;
F(9) = T(8)-2.5*T(9)-3.64E-9*T(9)^4+456.157;

*************************************************************************************
WhichisplacedinamfilecalledTempdist.m.
Entertheinitialguess
T0 = [1 1 1 1 1 1 1 1 1]';

% Make a starting guess at the solution

options=optimset('Display','iter');

% Option to display output

Nowsolvewithfollowingcommand:
[T,fval] = fsolve(@Tempdist,T0,options)

Whichgivesustheresult:
**********************************************************************************
Iteration
0
1
2
3
4
5
6
7
8
9
10
11
12

Func-count
f(x)
10
1.84264e+007
20
1.83693e+007
30
1.82269e+007
40
1.78739e+007
50
1.70085e+007
60
1.49531e+007
70
1.04814e+007
80
3.34027e+006
90
306992
100
2928.99
110
0.192913
120
8.69224e-010
130
3.68354e-025

step
1
2.5
6.25
15.625
39.0625
97.6563
244.141
610.352
464.403
18.6799
0.154728
1.03909e-005

optimality
2e+004
2e+004
1.99e+004
1.96e+004
1.89e+004
1.73e+004
1.37e+004
7.62e+003
574
247
1.93
0.000125
3.3e-012

radius
1
1
2.5
6.25
15.6
39.1
97.7
244
610
1.53e+003
1.53e+003
1.53e+003
1.53e+003

Optimization terminated: first-order optimality is less than options.TolFun.


T =
545.5983
529.0845
425.1039
411.0389
362.0019
332.7396
327.9651
312.9650
296.4097
fval =
1.0e-012 *
-0.4547
0.3411

0.1137

0.0568

0.1137

0.0568

-0.1137

MATLABPDEToolwasutilizedtoplottemperatureplotsandheatfluxinquarterandfullmodel.
FollowingplotsillustratethemodelandresultsobtainedfromPDETool,Heattransfermodule.Radiation
boundaryconditionsareignoredasnohelpisavailableinMATLAB,yetresultsareveryclosewithin1.2%
error.

Figure1:ChimneyFullModelwithInitialMeshinPDETool

Figure2:ChimneyquarterModelwithTemperaturecolorplotandcontourplotalongwithHeatflux
arrowsplot

Figure3:ChimneyfullModelwithTemperaturecolorplotandcontourplotalongwithHeatfluxarrows
plot

Anda mungkin juga menyukai