EES Lecture 5
EES Lecture 5
EES Lecture 5
Engineering
Advanced EES
(Engineering Equation Solver)
Lecture 5
Min/Max,
Uncertainty Analysis
y 7 x 3x 5 log( z )
2
z 6 2 y3 9 x
• Since x is no longer fixed, the solution y has
one degree of freedom – it depends on what x
or z is. If the second equation was removed
too, y will have two degrees of freedom.
Min/Max
• The following also has no degrees of freedom:
1
y 2
3x 5 x 7
y 0.05 x 0.1
0.15
0.125
y
0.1
0.075
0.05
0.025
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
x
Min/Max
• Lets create a simple Min/Max search
using the projectile movement example
we used earlier in lecture 3, saving a
copy of it as:
(Lecture 5.1 - SimpleMinMax.EES).
Min/Max
1. Find the angle that will maximise the
distance s the projectile will travel for
u = 30 m/s through a parametric table
2. Find the same angle just using the
Min/Max functionality (u = 30 m/s)
3. Find the required angle that will hit a
target at 60m (u = 30 m/s)
4. Find the required velocities for a range of
angles that will yield a range of exactly
60m!
Min/Max
Remember, the basic equations of motion
were:
0:10
Min/Max
1. Running the parametric table with varying theta shows
the optimal angle to be 45 degrees and the distance s to
be 91.77. Note however, that with differently selected
increments of theta that did not include 45 deg (40, 50
and 60 deg for example), we would not have arrived at 45
degrees!
Min/Max
2. Using Min/Max:
• The Min/Max
functionality is selected
from the Calculate menu:
• Using the Min/Max
functionality, EES will
first check the syntax of
the equations in the
Equations window. If no
errors are found, a dialog
window will appear •There must be at least
presenting the variables in one degree of freedom –
two lists. i.e. a variable that have
not been assigned a fixed
value so EES can vary it.
Min/Max
• Click the Maximize
button above the left list
(in this case).
• The variable which is to
be minimized/maximized
• The independent
variable(s) whose value(s)
will be changed by EES in
searching for the
minimum / maximum It is necessary to select as
• One needs to set realistic many independent variables as
there are degrees of freedom
bounds for the in the Equations window. The
independent variable(s). number of independent
variables which must be
selected is indicated above in
the right-hand list.
Min/Max
3. Find the required angle that will hit a
target at 60m (u = 30 m/s):
"To be able to determine the required angle to hit a
precise 60m target for an initial velocity u = 30 [m/s], we
define a variable deltas to force the calculation of the
angle using the Min/Max Table functionality. Remember
that we cannot specify theta = 45 [deg] now as EES will
vary it to try to minimise deltas and force s = 60 [m]."
s_max = 60 [m]
"When deltas = 0, s = 60 m"
deltas = abs(s - s_max)
0:10
Min/Max
• We then minimize
deltas (EES will
vary theta),
forcing s to be
60 m:
• We find theta =
20.42 deg
Min/Max - Table
4. Find the required velocities for a range
of given angles that will each yield a
range of exactly 60m. Here we let EES
search for u , so we cannot specify u,
but we specify theta in the parametric
table.
• With the Min/Max Table you can search for a
series of solutions in a parametric table
• Each run of the table will yield a specific
Min/Max solution!
Min/Max - Table
• We now need to perform the Min/Max
analysis on the table:
– Ensure that in the parametric table theta
varies between 0º and 90º
– As before we define s_max = 60 [m] as the
distance we want to achieve
– As before we minimise for deltas to force s
to be 60 [m]
– This time however, EES will find the values of
u for us, so we cannot specify u.
– Hint: To be able to minimise for deltas,
deltas has to be in the parametric table!
Min/Max - Table
YP ,i Yi
N
i 1
Min/Max
• To do this problem efficiently, we will
utilise the Duplicate statement:
• Instead of writing:
y[1] = sin(0); y[2] = sin(15); … y[10] = sin(135); etc…
N
N = 10 YP ,i Yi
DUPLICATE i = 1,N i 1
simultaneously. i 1
possible
combinations of
a_0/1/2 could
there be? EES
does it all for us!
Automagically!!!
Uncertainty Analysis
• Uncertainty Propagation determines the
uncertainty of up to 12 calculated variables as a
function of the uncertainties of one or more
measured values upon which it depends.
• In many experiments, an important quantity is
not directly measured but is rather calculated
as a function of one or more variables that are
directly measured, i.e., Y = f( X1, X2, ....).
• The measured variables, X1, X2, etc. have a
random variability which is referred to as its
uncertainty. In EES, that uncertainty is
displayed with a ± symbol, e.g., X1 = 300 ± 2.
Uncertainty Analysis
• As an example, let’s once again consider the
projectile model (Lecture 5.3 - SimpleUncertainyAnalysis.EES).
• Lets assume there is an uncertainty of 1.5 m/s
in the initial velocity u, and an uncertainty of 3
degrees in the angle theta.
• What would be the variation in the distance s
that we could expect?
Uncertainty Analysis-Table
• However, we could also do an uncertainty analysis
on a parametric table and vary parameters AND
still do an uncertainty analysis on each run!
100
78
56
sx [m]
34
12
Note the error bars in both x and y directions!
Switch off the x-bars to see only the y-bars
-10
0 10 20 30 40 50 60 70 80 90
[deg]
End of Lecture 5
0:05