by hrishikesh gadre email: [email protected] session ii department of mechanical engineering louisiana...

25
By Hrishikesh Gadre Email: [email protected] Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials Spring 2004

Upload: thomasine-hampton

Post on 19-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

ByHrishikesh Gadre

Email: [email protected]

Session II

Department of Mechanical Engineering

Louisiana State University

Engineering Equation Solver Tutorials

Spring 2004

Session 2 Outline

Menu commands in EES

Inserting property functions

Curve fitting

Linear Regression

File Menu

Open, New, Save, Print: need no mention

Merge: merges equations in a saved file with the current

contents of the Equations window at the cursor position.

Load Textbook: reads a Textbook index file (.txb) and uses

the information in that file to create a Textbook menu at the

far right of the menu bar.

Load library: is used to load library files (.lib) and also to

load external functions and procedures.

Options Menu

Variable Info: will provide a window containing the

information about the variables currently appearing in

Equations window. Information includes guess value, lower

and upper limits, display format, and units.

This information can not only be viewed but also changed.

Function Info (Options Menu)

This command will bring up the window as shown. It provides

different types of built-in functions like math functions,

thermodynamic functions etc.

The button ‘Function Info’ provides specific information

about the function selected. ‘Fluid Info’ gives information

related to source and range of applicability of property

correlations.

An example of the function selected with default variables

will be shown in the example rectangle at the bottom. We

can edit and paste this information.

The ‘External Routines’ button refers to external routines

which can be linked to EES.

Unit Conversion Info (Options Menu)

This command provides information to support the use of

the ‘Convert’ function (already discussed in session 1).

The left window shows the different dimensions and right

window lists the units for that dimension.

The conversion is given at the bottom.

Options Menu continued…

Constants: lists the different constants with description and

units.

Unit System: already discussed in Session 1.

Tolerances: will let you set stop criteria and parameters for

Integration.

Calculate Menu

Check/Format: will check the entered equations for any

syntax errors, if no errors are found, it’ll return number of

equations and variables.

Solve: will try to solve the equations entered. It will also

check the syntax of equations before actually solving them.

Solve Table: will initiate calculations using Parametric

table. The table, first run and the last run is to be selected.

Calculate Menu continued…

Min/Max: used to find the minimum or maximum of an

undetermined variable in an equation set.

Check Units: will check the dimensional and unit

consistency of all equations in the Equations window.

Update Guesses: replaces the guess value of each variable

in the Equations window with the value determined in the

last calculation (only accessible after calculations have

been successfully completed).

Reset Guesses: replaces the guess value of each variable

with the default guess value.

A simple example

‘Update Guesses’ improves the computational efficiency of an

EES calculation. We will have a look at a simple example to

illustrate this. Consider this set of equations.

By default, the guess value of each variable is set to 1.

With this guess value, EES may give error for this problem.

So, to solve this problem, we will proceed as follows:

Add a variable, Delta, such that

QB = AH*Sigma*(TH^4 - T^4)+Delta

Then, set Parametric Table containing variables T and Delta.

Use the Alter Values command to set a range of values of T and

Solve Table to calculate the corresponding values of Delta.

Plot Delta against T.

The value of T for which Delta is zero gives the solution.

Find out that value from the plot (T=905). Then put that

value as an equation in Equations window and Solve again.

Then use ‘Update Guesses’ and set Delta=0 and remove the

equation T=905 and again Solve the set of equations.

EES will now quickly converge to the correct solution.

This illustrates the use of ‘Update Guesses’.

Here, by selecting ‘Reset Guesses’, EES will again make

the Guess values of all variables equal to 1.

Tables Menu

New Parametric Table, Alter values: already discussed in

Session 1.

Insert/Delete Runs: allows the number of runs in an

existing Parametric Table to be changed by inserting or

deleting one or more rows in a specified Parametric table at

a specified position.

Insert/Delete Vars: allows variables in an existing

Parametric Table to be added or removed.

Tables Menu continued…

New Lookup Table: A Lookup table is a two-dimensional set

of data with a specified number of rows and columns.

This command creates a such new table in which numerical or

string data may be entered. This data can then be accessed by

different commands like Differentiate, Interpolate.

Open Lookup: will allow access to previously stored Lookup

file and will read its contents into Lookup Table Window.

Save Lookup: will write the data of Lookup Table into a

Lookup file on disk which can be read later.

Plots Menu

New Plot window: It has three options to generate plot from

two or more variables defined in tables or arrays. The options

are: X-Y plot, Bar plot and X-Y-Z plot .

X-Y Plot: Already discussed in Session I.

Bar plot: operates in exactly same manner as X-Y Plot.

X-Y-Z Plot: will generate a contour plot, i. e. it will plot lines

of constant z in X-Y space.

The options are Isometric Lines or Color Bands.

Plots Menu continued…

Overlay Plot: allows a new plot curve to be drawn over existing

plots. Works identical to New Plot Command.

Modify Plot: this dialog can also be accessed by double-clicking

or right-clicking the plot window to be modified.

This command allows manipulation of existing plots by giving

options to change parameters like line type, color, symbol, size

and frequency of symbol etc.

Property plot: creates a new plot with thermodynamic property

for selected substance and specified axes. We can also add

isotherms or isobars on this plot.

Curve Fitting and Linear Regression

The ‘Curve Fit’ command will find the best fit of a smooth curve

through a previously plotted set of data points using least squares.

The dialog box as shown appears. Choose the plot to be fitted from

the list and also select the type of equation. A sample of the

equation will appear below.

Curve Fitting

We can also enter any equation of the form y= f(x) in the

window below with coefficients as a0, a1 etc…

Clicking ‘Fit’ will determine

these coefficients and the

final equations will be

displayed in the window. The

button ‘Fit’ will be replaced

by ‘Plot’. That will plot the

curve fit equation in the same

plot window.

Linear Regression

The difference between Curve Fitting and Linear Regression is

that Curve Fitting provides a fit with only single independent

variable while in Linear Regression, one can have as many as 6

independent variables.

The dialog box as shown appears.

One has to select the type and

name of table from the drop

down list and then select a

dependent variable and one or

more independent variables.

Linear Regression continued…

The dependent variable will be represented as a linear

polynomial function of the independent variables depending on

the order of the polynomial.

The terms involving product of the independent variables can

be included by checking the ‘Include cross-terms’ check box.

Some of the terms from the equation can be excluded by

selecting that term and then clicking ‘Exclude’ button.

Clicking the ‘Fit’ button determines the unknown coefficients

and will display the final equation in the window. This can be

copied to the clip-board.

Recap

What we have learnt today

How different Menu commands in EES work

How to insert property functions

Curve fitting and Linear Regression

Thank You

That’s all for today….

THANK YOU