SlideShare uma empresa Scribd logo
1 de 25
Performing
Manual and Automated Iterations
in
Engineering Equation Solver (EES)
Examples from Heat Transfer
Naveed ur Rehman
http://www.naveedurrehman.com/
4th June, 2018
All the EES codes shown in the
examples are available at:
https://goo.gl/KExGFi
2
A problem that doesn’t require
iterative solution
3
A problem that doesn’t require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑎 for ‘Air’
Find 𝑇𝑠?
Note: The Prandtl number, which is a
material property, is required at a known
temperature (Ta=25⁰C).
No iteration is needed!
4
A problem that doesn’t require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑎 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
P = prandtl(Air,T=Ta)
EES Codes (Code-1.EES)
5
A problem that require iterative
solution
6
Performing manual iteration in EES
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Note: The Prandtl number, which is a material
property, is required at an unknown temperature!
This problem can not be solved without performing
iteration.
7
MANUAL
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
P = prandtl(Air,T=Ts)
EES Codes (Code-2.EES) Wrong approach!
8
MANUAL
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
Ts_guess = 100 [C]
check = Ts_guess - Ts
P = prandtl(Air,T=Ts_guess)
EES Codes (Code-3.EES) Right approach!
Assume some ‘guess’ value of
the unknown variable. Your
guess will correct only when
the difference between the
solution and your guess will
be ‘0’ i.e. check = 0
Evaluate
material
property at
guess value.
9
MANUAL
Check is not ‘0’ so
an iteration is
required.
Set the guess
variable value to the
current solution.
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
Ts_guess = 305.9 [C]
check = Ts_guess - Ts
P = prandtl(Air,T=Ts_guess)
EES Codes (Code-3.EES) Right approach!
10
MANUAL
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
Ts_guess = 313.3 [C]
check = Ts_guess - Ts
P = prandtl(Air,T=Ts_guess)
EES Codes (Code-3.EES) Right approach!
11
Check is still not ‘0’
so another iteration
is required.
Set the guess
variable value to the
current solution.
MANUAL
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
Ts_guess = 313.3 [C]
check = Ts_guess - Ts
P = prandtl(Air,T=Ts_guess)
EES Codes (Code-3.EES) Right approach!
Check is approx. ‘0’
so no further
iteration is required.
The current solution
(or guess) is the final
answer.
12
MANUAL
A problem that require iterative
solution
13
Performing automated iteration in EES
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠?
14
Same problem
AUTOMATED
A problem that require iterative solution
15
Subprogram solver(Ts_guess : Ts)
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
P = prandtl(Air,T=Ts_guess)
End
EES Codes (Code-4.EES) Step #1
Create a ‘solver ‘ subprogram as
shown containing the original
codes of your main problem.
Make sure that you are
evaluating the material
properties at the guess value.
AUTOMATED
Procedure control(Ts_guess : Ts)
nmax = 100
dTmin = 0.001
n:=0
Ts := Ts_guess
Repeat
T = Ts
Call solver(T : Ts)
n := n +1
dT = abs(T-Ts)
Until ( (n=nmax) or (dT < dTmin))
End
A problem that require iterative solution
16
EES Codes (Code-4.EES) Step #2
Create a ‘control‘ procedure to
control the flow of iterations.
There is no need to change
anything else in this procedure.
‘nmax’ is the maximum number of iterations (100 is
more than enough!)
dTmin is the stopping condition, similar to ‘check’. If
you want to be super precise, use dTmin=0
AUTOMATED
Ts_guess = 100 [C]
Call control(Ts_guess : Ts)
A problem that require iterative solution
17
EES Codes (Code-4.EES) Step #3
Write these codes outside any
procedure or subprogram.
Yes, this is the initial guess.
AUTOMATED
A problem that require iterative
solution
18
Performing automated iteration in EES
and getting more than single output
A problem that require iterative solution
𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎
Let’s say:
𝑄 = 2000𝑊
𝐴 = 1𝑚2
𝑇𝑎 = 25°𝐶
ℎ = 10𝑃
Where,
𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’
Find 𝑇𝑠, P and ℎ?
19
Same problem but
required variables
are more than
single.
AUTOMATED
Multiple outputs
Subprogram solver(Ts_guess : Ts, P, h)
Q = h*A*(Ts-Ta)
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
h = 10*P
P = prandtl(Air,T=Ts_guess)
End
A problem that require iterative solution
20
EES Codes (Code-5.EES) Step #1
More variables at output
AUTOMATED
Multiple outputs
Procedure control(Ts_guess : Ts, P, h)
nmax = 100
dTmin = 0.001
n:=0
Ts := Ts_guess
Repeat
T = Ts
Call solver(T : Ts, P, h)
n := n +1
dT = abs(T-Ts)
Until ( (n=nmax) or (dT < dTmin))
End
A problem that require iterative solution
21
EES Codes (Code-5.EES) Step #2
More variables at output
AUTOMATED
Multiple outputs
Ts_guess = 100 [C]
Call control(Ts_guess : Ts, P, h)
A problem that require iterative solution
22
EES Codes (Code-5.EES) Step #3
More variables at output
AUTOMATED
Multiple outputs
A problem that require iterative
solution
23
Performing automated iteration in EES
and working with inputs from outside
subprogram
A problem that require iterative solution
24
EES Codes (Code-6.EES)
Subprogram solver(Ts_guess, Q, A, Ta : Ts, P, h)
Q = h*A*(Ts-Ta)
h = 10*P
P = prandtl(Air,T=Ts_guess)
End
Procedure control(Ts_guess, Q, A, Ta : Ts, P, h)
nmax = 100
dTmin = 0.001
n:=0
Ts := Ts_guess
Repeat
T = Ts
Call solver(T, Q, A, Ta : Ts, P, h)
n := n +1
dT = abs(T-Ts)
Until ( (n=nmax) or (dT < dTmin))
End
Q = 2000 [W]
A = 1 [m^2]
Ta = 25 [C]
Ts_guess = 100 [C]
Call control(Ts_guess, Q, A, Ta : Ts, P, h)
Step #1 Step #2 Step #3
AUTOMATED
Multiple inputs and outputs
Performing
Manual and Automated Iterations
in
Engineering Equation Solver (EES)
Examples from Heat Transfer
Thank you! Naveed ur Rehman
http://www.naveedurrehman.com/

Mais conteúdo relacionado

Mais procurados

Fundamentals of heat transfer lecture notes
Fundamentals of heat transfer lecture notesFundamentals of heat transfer lecture notes
Fundamentals of heat transfer lecture notesYuri Melliza
 
Modelling of a cooling tower in EES
Modelling of a cooling tower in EESModelling of a cooling tower in EES
Modelling of a cooling tower in EESShiyas Basheer
 
Thermodynamics part 1.pptx
Thermodynamics part 1.pptxThermodynamics part 1.pptx
Thermodynamics part 1.pptxPadmini36
 
LECTURE Notes on compressor
LECTURE Notes on compressorLECTURE Notes on compressor
LECTURE Notes on compressorYuri Melliza
 
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICS
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICSELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICS
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICSVijay Sarathy
 
Engineering Thermodynamics -Basic Concepts 2
Engineering Thermodynamics -Basic Concepts 2 Engineering Thermodynamics -Basic Concepts 2
Engineering Thermodynamics -Basic Concepts 2 Mani Vannan M
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferArun Sarasan
 
One dim, steady-state, heat conduction_with_heat_generation
One dim, steady-state, heat conduction_with_heat_generationOne dim, steady-state, heat conduction_with_heat_generation
One dim, steady-state, heat conduction_with_heat_generationtmuliya
 
Heat transfer 5th ed incropera solution manual
Heat transfer 5th ed incropera solution manualHeat transfer 5th ed incropera solution manual
Heat transfer 5th ed incropera solution manualManish Kumar
 
Fundamentals of Centrifugal Compressor - Head (revised)
Fundamentals of Centrifugal Compressor - Head (revised)Fundamentals of Centrifugal Compressor - Head (revised)
Fundamentals of Centrifugal Compressor - Head (revised)Sudhindra Tiwari
 
Boiling and Condensation heat transfer -- EES Functions and Procedures
Boiling and Condensation heat transfer -- EES Functions and ProceduresBoiling and Condensation heat transfer -- EES Functions and Procedures
Boiling and Condensation heat transfer -- EES Functions and Procedurestmuliya
 
Fundamentals of Computational Fluid Dynamics
Fundamentals of Computational Fluid DynamicsFundamentals of Computational Fluid Dynamics
Fundamentals of Computational Fluid DynamicsPankaj Koli
 
3_General Thermodynamic Relations.pptx
3_General Thermodynamic Relations.pptx3_General Thermodynamic Relations.pptx
3_General Thermodynamic Relations.pptxTabassumBinteRaisha
 
Numerical methods- Steady-state-1D-and-2D-Part- I
Numerical methods- Steady-state-1D-and-2D-Part- INumerical methods- Steady-state-1D-and-2D-Part- I
Numerical methods- Steady-state-1D-and-2D-Part- Itmuliya
 

Mais procurados (20)

Fundamentals of heat transfer lecture notes
Fundamentals of heat transfer lecture notesFundamentals of heat transfer lecture notes
Fundamentals of heat transfer lecture notes
 
Modelling of a cooling tower in EES
Modelling of a cooling tower in EESModelling of a cooling tower in EES
Modelling of a cooling tower in EES
 
Thermodynamics part 1.pptx
Thermodynamics part 1.pptxThermodynamics part 1.pptx
Thermodynamics part 1.pptx
 
LECTURE Notes on compressor
LECTURE Notes on compressorLECTURE Notes on compressor
LECTURE Notes on compressor
 
Condenser performance test
Condenser performance testCondenser performance test
Condenser performance test
 
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICS
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICSELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICS
ELECTRIC MOTOR (EM) DRIVEN COMPRESSOR IN ASPEN HYSYS DYNAMICS
 
Engineering Thermodynamics -Basic Concepts 2
Engineering Thermodynamics -Basic Concepts 2 Engineering Thermodynamics -Basic Concepts 2
Engineering Thermodynamics -Basic Concepts 2
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transfer
 
Heat Convection by Latif M. Jiji - solutions
Heat Convection by Latif M. Jiji - solutionsHeat Convection by Latif M. Jiji - solutions
Heat Convection by Latif M. Jiji - solutions
 
One dim, steady-state, heat conduction_with_heat_generation
One dim, steady-state, heat conduction_with_heat_generationOne dim, steady-state, heat conduction_with_heat_generation
One dim, steady-state, heat conduction_with_heat_generation
 
Equations
EquationsEquations
Equations
 
Air flowformulas
Air flowformulasAir flowformulas
Air flowformulas
 
Chapter_3.pdf
Chapter_3.pdfChapter_3.pdf
Chapter_3.pdf
 
Heat transfer 5th ed incropera solution manual
Heat transfer 5th ed incropera solution manualHeat transfer 5th ed incropera solution manual
Heat transfer 5th ed incropera solution manual
 
Fundamentals of Centrifugal Compressor - Head (revised)
Fundamentals of Centrifugal Compressor - Head (revised)Fundamentals of Centrifugal Compressor - Head (revised)
Fundamentals of Centrifugal Compressor - Head (revised)
 
Boiling and Condensation heat transfer -- EES Functions and Procedures
Boiling and Condensation heat transfer -- EES Functions and ProceduresBoiling and Condensation heat transfer -- EES Functions and Procedures
Boiling and Condensation heat transfer -- EES Functions and Procedures
 
Fundamentals of Computational Fluid Dynamics
Fundamentals of Computational Fluid DynamicsFundamentals of Computational Fluid Dynamics
Fundamentals of Computational Fluid Dynamics
 
3_General Thermodynamic Relations.pptx
3_General Thermodynamic Relations.pptx3_General Thermodynamic Relations.pptx
3_General Thermodynamic Relations.pptx
 
Numerical methods- Steady-state-1D-and-2D-Part- I
Numerical methods- Steady-state-1D-and-2D-Part- INumerical methods- Steady-state-1D-and-2D-Part- I
Numerical methods- Steady-state-1D-and-2D-Part- I
 
Unit9
Unit9Unit9
Unit9
 

Semelhante a Performing Iterations in EES

T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxGadaFarhan
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptxKokilaK25
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysisDr. Rajdeep Chatterjee
 
Thermodynamic Chapter 5 Air Standard Cycle
Thermodynamic Chapter 5 Air Standard CycleThermodynamic Chapter 5 Air Standard Cycle
Thermodynamic Chapter 5 Air Standard CycleMuhammad Surahman
 
Non linear function
Non linear functionNon linear function
Non linear functionvenyclaudia
 
Lecture 08 of Agricultural instrumentation
Lecture 08 of Agricultural instrumentationLecture 08 of Agricultural instrumentation
Lecture 08 of Agricultural instrumentationlauralasun1865
 
Admission in india 2014
Admission in india 2014Admission in india 2014
Admission in india 2014Edhole.com
 
chap5airstandardcycle2010-130703012738-02.pdf
chap5airstandardcycle2010-130703012738-02.pdfchap5airstandardcycle2010-130703012738-02.pdf
chap5airstandardcycle2010-130703012738-02.pdf21M220KARTHIKEYANC
 
Video lectures for b.tech
Video lectures for b.techVideo lectures for b.tech
Video lectures for b.techEdhole.com
 
Problem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docxProblem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docxelishaoatway
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
Overview Of Using Calculator
Overview Of Using CalculatorOverview Of Using Calculator
Overview Of Using CalculatorFrancescoPozolo1
 

Semelhante a Performing Iterations in EES (20)

T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptx
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
Thermodynamic Chapter 5 Air Standard Cycle
Thermodynamic Chapter 5 Air Standard CycleThermodynamic Chapter 5 Air Standard Cycle
Thermodynamic Chapter 5 Air Standard Cycle
 
Non linear function
Non linear functionNon linear function
Non linear function
 
Lecture 08 of Agricultural instrumentation
Lecture 08 of Agricultural instrumentationLecture 08 of Agricultural instrumentation
Lecture 08 of Agricultural instrumentation
 
algo_vc_lecture8.ppt
algo_vc_lecture8.pptalgo_vc_lecture8.ppt
algo_vc_lecture8.ppt
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Admission in india 2014
Admission in india 2014Admission in india 2014
Admission in india 2014
 
chap5airstandardcycle2010-130703012738-02.pdf
chap5airstandardcycle2010-130703012738-02.pdfchap5airstandardcycle2010-130703012738-02.pdf
chap5airstandardcycle2010-130703012738-02.pdf
 
lesson2.ppsx
lesson2.ppsxlesson2.ppsx
lesson2.ppsx
 
Analysis of Algorithum
Analysis of AlgorithumAnalysis of Algorithum
Analysis of Algorithum
 
Video lectures for b.tech
Video lectures for b.techVideo lectures for b.tech
Video lectures for b.tech
 
Problem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docxProblem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docx
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
System Modeling
System ModelingSystem Modeling
System Modeling
 
Chapter one
Chapter oneChapter one
Chapter one
 
Solutions fox
Solutions   foxSolutions   fox
Solutions fox
 
Overview Of Using Calculator
Overview Of Using CalculatorOverview Of Using Calculator
Overview Of Using Calculator
 

Último

Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEselvakumar948
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 

Último (20)

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 

Performing Iterations in EES

  • 1. Performing Manual and Automated Iterations in Engineering Equation Solver (EES) Examples from Heat Transfer Naveed ur Rehman http://www.naveedurrehman.com/ 4th June, 2018
  • 2. All the EES codes shown in the examples are available at: https://goo.gl/KExGFi 2
  • 3. A problem that doesn’t require iterative solution 3
  • 4. A problem that doesn’t require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑎 for ‘Air’ Find 𝑇𝑠? Note: The Prandtl number, which is a material property, is required at a known temperature (Ta=25⁰C). No iteration is needed! 4
  • 5. A problem that doesn’t require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑎 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P P = prandtl(Air,T=Ta) EES Codes (Code-1.EES) 5
  • 6. A problem that require iterative solution 6 Performing manual iteration in EES
  • 7. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Note: The Prandtl number, which is a material property, is required at an unknown temperature! This problem can not be solved without performing iteration. 7 MANUAL
  • 8. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P P = prandtl(Air,T=Ts) EES Codes (Code-2.EES) Wrong approach! 8 MANUAL
  • 9. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P Ts_guess = 100 [C] check = Ts_guess - Ts P = prandtl(Air,T=Ts_guess) EES Codes (Code-3.EES) Right approach! Assume some ‘guess’ value of the unknown variable. Your guess will correct only when the difference between the solution and your guess will be ‘0’ i.e. check = 0 Evaluate material property at guess value. 9 MANUAL
  • 10. Check is not ‘0’ so an iteration is required. Set the guess variable value to the current solution. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P Ts_guess = 305.9 [C] check = Ts_guess - Ts P = prandtl(Air,T=Ts_guess) EES Codes (Code-3.EES) Right approach! 10 MANUAL
  • 11. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P Ts_guess = 313.3 [C] check = Ts_guess - Ts P = prandtl(Air,T=Ts_guess) EES Codes (Code-3.EES) Right approach! 11 Check is still not ‘0’ so another iteration is required. Set the guess variable value to the current solution. MANUAL
  • 12. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P Ts_guess = 313.3 [C] check = Ts_guess - Ts P = prandtl(Air,T=Ts_guess) EES Codes (Code-3.EES) Right approach! Check is approx. ‘0’ so no further iteration is required. The current solution (or guess) is the final answer. 12 MANUAL
  • 13. A problem that require iterative solution 13 Performing automated iteration in EES
  • 14. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠? 14 Same problem AUTOMATED
  • 15. A problem that require iterative solution 15 Subprogram solver(Ts_guess : Ts) Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P P = prandtl(Air,T=Ts_guess) End EES Codes (Code-4.EES) Step #1 Create a ‘solver ‘ subprogram as shown containing the original codes of your main problem. Make sure that you are evaluating the material properties at the guess value. AUTOMATED
  • 16. Procedure control(Ts_guess : Ts) nmax = 100 dTmin = 0.001 n:=0 Ts := Ts_guess Repeat T = Ts Call solver(T : Ts) n := n +1 dT = abs(T-Ts) Until ( (n=nmax) or (dT < dTmin)) End A problem that require iterative solution 16 EES Codes (Code-4.EES) Step #2 Create a ‘control‘ procedure to control the flow of iterations. There is no need to change anything else in this procedure. ‘nmax’ is the maximum number of iterations (100 is more than enough!) dTmin is the stopping condition, similar to ‘check’. If you want to be super precise, use dTmin=0 AUTOMATED
  • 17. Ts_guess = 100 [C] Call control(Ts_guess : Ts) A problem that require iterative solution 17 EES Codes (Code-4.EES) Step #3 Write these codes outside any procedure or subprogram. Yes, this is the initial guess. AUTOMATED
  • 18. A problem that require iterative solution 18 Performing automated iteration in EES and getting more than single output
  • 19. A problem that require iterative solution 𝑄 = ℎ𝐴 𝑇𝑠 − 𝑇𝑎 Let’s say: 𝑄 = 2000𝑊 𝐴 = 1𝑚2 𝑇𝑎 = 25°𝐶 ℎ = 10𝑃 Where, 𝑃 = 𝑃𝑟 𝑇𝑠 for ‘Air’ Find 𝑇𝑠, P and ℎ? 19 Same problem but required variables are more than single. AUTOMATED Multiple outputs
  • 20. Subprogram solver(Ts_guess : Ts, P, h) Q = h*A*(Ts-Ta) Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] h = 10*P P = prandtl(Air,T=Ts_guess) End A problem that require iterative solution 20 EES Codes (Code-5.EES) Step #1 More variables at output AUTOMATED Multiple outputs
  • 21. Procedure control(Ts_guess : Ts, P, h) nmax = 100 dTmin = 0.001 n:=0 Ts := Ts_guess Repeat T = Ts Call solver(T : Ts, P, h) n := n +1 dT = abs(T-Ts) Until ( (n=nmax) or (dT < dTmin)) End A problem that require iterative solution 21 EES Codes (Code-5.EES) Step #2 More variables at output AUTOMATED Multiple outputs
  • 22. Ts_guess = 100 [C] Call control(Ts_guess : Ts, P, h) A problem that require iterative solution 22 EES Codes (Code-5.EES) Step #3 More variables at output AUTOMATED Multiple outputs
  • 23. A problem that require iterative solution 23 Performing automated iteration in EES and working with inputs from outside subprogram
  • 24. A problem that require iterative solution 24 EES Codes (Code-6.EES) Subprogram solver(Ts_guess, Q, A, Ta : Ts, P, h) Q = h*A*(Ts-Ta) h = 10*P P = prandtl(Air,T=Ts_guess) End Procedure control(Ts_guess, Q, A, Ta : Ts, P, h) nmax = 100 dTmin = 0.001 n:=0 Ts := Ts_guess Repeat T = Ts Call solver(T, Q, A, Ta : Ts, P, h) n := n +1 dT = abs(T-Ts) Until ( (n=nmax) or (dT < dTmin)) End Q = 2000 [W] A = 1 [m^2] Ta = 25 [C] Ts_guess = 100 [C] Call control(Ts_guess, Q, A, Ta : Ts, P, h) Step #1 Step #2 Step #3 AUTOMATED Multiple inputs and outputs
  • 25. Performing Manual and Automated Iterations in Engineering Equation Solver (EES) Examples from Heat Transfer Thank you! Naveed ur Rehman http://www.naveedurrehman.com/