You are on page 1of 16

 Unit Checking and Conversions

 Single and multi-dimensional Optimization


 Numerical integration and the Solution of ODEs and PDEs
 High quality property data for many pure substances
 Plotting and Curve fitting
 Uncertainty Analysis
 Heat Transfer Library
 Complex Algebra
 The Diagram Window and the high quality GUIs

 Entering and Solving Equations - the basics

$Key Board EU

$Key Board US

Order of Operations

1) Parentheses
2) Exponents
3) Multiplication and Division
4) Addition and Subtraction
Variable names
EES is case- insensitive
Variables must begin with a letter
Variables cannot include : () * / + - {} 0r ;

{Comment 1}

“Comment 2”

//Comment 3

“! Comment type 2”

The Variable Information Window & Palette

Function Information and Help


Built-in functions

Mathematical

Complex

Economic

Statistical

Trigonometric, Bessel, Hyperbolic

Utility: data files, tables, strings etc


D_bar = 0.500 [inch] "average diameter"
sigma = 0.005 [inch] "standard deviation"
D_min = 0.49 [inch] "minimum diameter"
D_max = 0.505 [inch] "maximum diameter"
p=probability(D_min,D_max,D_bar,sigma)
String Variables and Functions

S$ 'Aluminum'
k=Conductivity(S$,T= 300[K])
or
k=Conductivity(Aluminum,T= 300[K])
gone girls, rookie magazine

penguin random house

Clarkson potter
Rupee course publishers

We present

We transfer and we present

Ocean Wonky

On earth we are briefly gorgeous

Issac internship

Pixo blog

Curve Fitting Plotted Data


Curve Fitting Data in Arrays and Lookup
Tables
 Linear Regression from the Menu
One Dimensional Interpolation
Introduction to Functions
Function Area(W,H)
Area=W*H
End
W=2
H=3
A=Area(W,H)

Introduction to Procedures
Logic Statements
Function Compare(A,B)
If (A=B) then compare=1 else compare=0
End
A=2
B=2+1e-9
C=compare(A,B)

Or

Function Compare(A,B)
If (ABS(A-B)<1e-5) then compare=1 else compare=0
End
A=2
B=2+1e-9
C=compare(A,B)

Or

Function Compare(A,B)
If (Round(A)=Round(B)) then compare=1 else compare=0
End
A=2
B=2+1e-9
C=compare(A,B)

We can also compare string variables with these relational operators

Function Compare(A$,B$)
If (A$=B$) then compare=1 else compare=0
End
A$='A'
B$='B'
C=compare(A$,B$)

Function friction_factor(Re)
"assume flow is laminar"
friction_factor=64/Re
If (Re<2300) Then Return
"assume flow is turbulent"
friction_factor=1/0.790*ln(Re)-1.64)^2
If (Re<5e6) Then Return
"Reynold no. is out of range"
Friction_factor=-9
End
f_laminar=friction_factor(1000)
f_turbulent=friction_factor(1e5)
f_outofrange=friction_factor(1e7)
Function Fact(N)

F:=1 "factorial"
i:=0 "counter"
10: i:=i+1 "increment counter"
F:=F*i "multiply factorial by counter"
if(i<N) Then GoTo 10 "see if counter has reached N"
Fact:=F "assign factorial"
End
Y=Fact(7) "Fact(7)=5040"
Y2=Factorial(7) "EES build-in factorial function"

Or
Function Fact(N)

F:=1 "factorial"
If(N=0) Then Return "check for N=0"
i=0
Repeat
i=i+1
Fact=Fact*i
Until(i>=N)
End
Y=Fact(7) "Fact(7)=5040"
Y2=Factorial(7) "EES build-in factorial function"
Function Roughness (Pipe$)

Case Pipe$
'Steel':: Roughness=0.045 [mm]
'Cast Iron':: Roughness=0.5 [mm]
'Drawn Tubing':: Roughness=0.0015 [mm]
'Concrete':: Roughness=1.7 [mm]
'Glass':: Roughness=0.0 [mm]
'Plastic':: Roughness=0.004 [mm]
'Rubber':: Roughness=0.01 [mm]
'Else':: Roughness=0.0 [mm]
EndCase
End
Pipe$='Rubber'
R=Roughness(Pipe$)

Units in Functions and Procedures

Arrays in Functions and Procedures


Function SumSquares(N, A[1..N])
S:=0 "initialize sum"
i:=1 "initialize index"
Repeat
S:=S+A[i]^2 "Sum the square of each element"
i:=i+1 "increment the element"
Until(i>=N) "stopping conditions"
SumSquares:=S "Set the Function name to the calculated value"
End

Function Temp(duration, h_bar, A_s, T_ini, T_infinity, C, N)


Dtime:=duration/N
T[1]:=T_ini
time[1]:=0
i:=1
End
Repeat
T[i+1]=T[i]+Dtime
T[i+1]=T[i]+[A_s*h_bar*(T_infinity-T[i])+A_s*sigma#*(T_infinity^4-T[i]^4))*Dtime/C
i:=i+1
Until(i>N)
Temp=T[N+1]
End

N=5[-]
duration=100[s] "duration of process"
h_bar= 100 [W/m^2-K] "heat transfer coefficient"
A_s=0.01[m^2] "Surface Area"
T_ini=300[K] "initial Temperature"
T_infinity=500[K] "ambient Temperature"
C=100[J/K] "Total Heat Capacity"
T_final=Temp(duration,h_bar,A_s,T_ini,T_final,C,N)

The Unit System

Real Fluid Properties

$UnitSystem SI Mass J K Pa Rad


v=Volume(R134a, T= 350[K], P= 250000[Pa])
Real Fluid Property Example

You might also like