Mastering EES - F-Chart Software

20 downloads 160 Views 212KB Size Report
... OF CONTENTS. 1 INTRODUCTION TO EES .............................................................. ....................................... 1. 1.1 Acquiring and Installing EES . ... Acquiring EES .
TABLE OF CONTENTS 1 INTRODUCTION TO EES ..................................................................................................... 1 1.1 Acquiring and Installing EES .............................................................................................. 1 Acquiring EES ......................................................................................................................... 1 Installing EES ......................................................................................................................... 2 Silent Installation .................................................................................................................... 3 Online Help ............................................................................................................................. 4 1.2 Entering and Solving Equations .......................................................................................... 6 Entering Equations ................................................................................................................. 6 The Solutions Window............................................................................................................. 8 Decimal vs Comma Separator ................................................................................................ 8 The Variable Information dialog ............................................................................................ 9 Guess Values ......................................................................................................................... 10 Limits..................................................................................................................................... 10 Display Format ..................................................................................................................... 11 Rules for Entering Equations ................................................................................................ 11 Comments .............................................................................................................................. 12 Built-In Math Functions........................................................................................................ 14 External Functions and Procedures ..................................................................................... 14 String Variables .................................................................................................................... 15 The $TabStops Directive ....................................................................................................... 16 Showing Values and Setting Variable Units in the Equations Window ................................ 16 The Status Bar ....................................................................................................................... 17 Equations and Display Preferences ...................................................................................... 17 The Formatted Equations Window ....................................................................................... 18 The Splitter Bar ..................................................................................................................... 19 Password Protection ............................................................................................................. 20 Key Variables ........................................................................................................................ 21 1.3 Parametric Tables.............................................................................................................. 23 Creating a Parametric Table ................................................................................................ 25 Alter Values........................................................................................................................... 26 Solving a Parametric Table .................................................................................................. 27 Formatting Columns ............................................................................................................. 30 The $If, $IfNot, $Else, and $EndIf Directives ....................................................................... 31 Naming and Documenting Parametric Tables ..................................................................... 31 Saving and Loading Parametric Tables ............................................................................... 32 1.4 Basic Plotting ..................................................................................................................... 34 Generating a Plot.................................................................................................................. 34 Modifying Axes...................................................................................................................... 35 Overlaying Plots ................................................................................................................... 37 Modifying Plots ..................................................................................................................... 38 Automatic Update ................................................................................................................. 40 Error Bars ............................................................................................................................. 40 The Plot Tool Bar.................................................................................................................. 41

The Cross-Hairs, Move, and Zoom Tools ............................................................................. 44 1.5 Units ................................................................................................................................... 46 Unit System ........................................................................................................................... 46 Entering Units ....................................................................................................................... 46 Dual Units ............................................................................................................................. 48 Units Recognized by EES ...................................................................................................... 50 Checking Units ...................................................................................................................... 50 Automatically Setting Units .................................................................................................. 52 The Convert Function ........................................................................................................... 53 The Units List ........................................................................................................................ 54 Suggested Method for Working with Units ........................................................................... 56 The ConvertTemp Function .................................................................................................. 58 Adding Units ......................................................................................................................... 58 Using String Variables for Units .......................................................................................... 60 1.6 Printing .............................................................................................................................. 60 Printing a Hard Copy ........................................................................................................... 61 Copying Equations ................................................................................................................ 61 LaTeX Report ........................................................................................................................ 63 1.7 Arrays................................................................................................................................. 64 Assigning Array Variables .................................................................................................... 64 Array Range Notation ........................................................................................................... 65 Two-Dimensional Arrays ...................................................................................................... 65 The Array Editor ................................................................................................................... 66 The Duplicate Statement ....................................................................................................... 68 Arrays in the Variable Information dialog ........................................................................... 69 Purge Unused Variables ....................................................................................................... 70 1.8 Lookup Tables .................................................................................................................... 72 Creating a Lookup Table ...................................................................................................... 72 Entering Data........................................................................................................................ 72 Using Equations .................................................................................................................... 74 Saving and Loading Lookup Tables...................................................................................... 75 Lookup Commands................................................................................................................ 75 1.9 Other Features ................................................................................................................... 76 Built-In Constants ................................................................................................................. 76 Adding Constants .................................................................................................................. 77 The Calculator Window ........................................................................................................ 78 Preferences and Syntax Hightlighting .................................................................................. 79 References ................................................................................................................................. 82 2 CURVE FITTING & INTERPOLATION ........................................................................... 83 2.1 Curve Fitting ...................................................................................................................... 83 Curve Fitting Plotted Data ................................................................................................... 83 Curve Fitting Array Data...................................................................................................... 87 2.2 Linear Regression .............................................................................................................. 89 Selecting the Equation Form ................................................................................................ 90 Equation Statistics ................................................................................................................ 90 Regression Plot ..................................................................................................................... 91

Copying the Regression Equation......................................................................................... 92 The $CheckUnits Directive ................................................................................................... 93 2.3 One Dimensional Interpolation ......................................................................................... 93 2.4 Two Dimensional Interpolation ......................................................................................... 94 The Interpolate2D Function ................................................................................................. 94 The Interpolate2DM Function .............................................................................................. 95 3 FUNCTIONS AND PROCEDURES ..................................................................................... 97 3.1 Equations and Assignment Statements............................................................................... 97 The Assignment Operator ..................................................................................................... 98 3.2 Functions............................................................................................................................ 98 Format of Functions ............................................................................................................. 98 First Example of a Function ................................................................................................. 99 Second Example of a Function ........................................................................................... 101 Setting and Checking Units for Function Variables ........................................................... 101 Variable Information Page for Function ............................................................................ 102 3.3 Procedures ....................................................................................................................... 103 Format of Procedures ......................................................................................................... 103 Example of a Procedure...................................................................................................... 104 3.4 Logic Statements .............................................................................................................. 106 If-Then-Else Statements ...................................................................................................... 106 Return Statements ............................................................................................................... 107 GoTo Statements and Statement Labels.............................................................................. 109 Repeat-Until Construct ....................................................................................................... 110 Case Statements Statements ................................................................................................ 110 3.5 Units in Functions and Procedures ................................................................................. 113 3.6 Arrays in Functions and Procedures ............................................................................... 115 Arrays as Arguments ........................................................................................................... 115 Using the $Common Directive to Access Arrays ................................................................ 117 Using the $Constant Directive to Set Array Limits ............................................................ 118 Arrays Table Window for Functions and Procedures ........................................................ 118 3.7 Using Lookup Tables ....................................................................................................... 122 3.8 The Beep and Print Commands ....................................................................................... 123 3.9 The Warning and Error Procedures ................................................................................ 124 The Warning Procedure...................................................................................................... 124 The Error Procedure........................................................................................................... 126 References ............................................................................................................................... 127 4 PROPERTY DATA .............................................................................................................. 128 4.1 Unit System ...................................................................................................................... 128 Unit System Dialog ............................................................................................................. 128 Specific Properties on a Molar vs Mass Basis.................................................................... 128 The $UnitSystem Directive ................................................................................................. 129 Unit Settings in the Status Bar ............................................................................................ 130 Importance of Unit Selection .............................................................................................. 130 4.2 Function Information ....................................................................................................... 130 4.3 Property Functions for Real Fluids ................................................................................. 131 Calling Protocol for Property Function ............................................................................. 131

List of Property Functions .................................................................................................. 132 Built-in Real Fluids ............................................................................................................. 135 Property Indicators ............................................................................................................. 136 Fixing the State ................................................................................................................... 136 Two-Phase State.................................................................................................................. 137 The Example Box ................................................................................................................ 138 Vapor Compression Cycle Example ................................................................................... 140 Equations of State ............................................................................................................... 142 Properties of Water ............................................................................................................. 143 The Reference State............................................................................................................. 143 The $Reference Directive .................................................................................................... 144 4.4 Property Functions for Ideal Gases................................................................................. 144 The Ideal Gas Model........................................................................................................... 144 List of Ideal Gas Fluids....................................................................................................... 145 Ideal Gas vs Real Gas Fluids.............................................................................................. 145 The NASA Ideal Gas Database ........................................................................................... 146 The FluidType$ Function.................................................................................................... 147 The Ideal Gas Reference State & Chemical Reactions ....................................................... 150 4.5 Psychrometric Properties ................................................................................................ 151 The Fluid AirH2O ............................................................................................................... 151 Properties Specific to Psychrometrics ................................................................................ 151 List of Psychrometric Properties ........................................................................................ 152 List of Indicators for Psychrometric Properties ................................................................. 152 Psychrometrics Example..................................................................................................... 153 4.6 Property Plots .................................................................................................................. 155 The Property Plot Dialog.................................................................................................... 155 Property Plots for Real Fluids ............................................................................................ 156 Property Plots for Ideal Gases ........................................................................................... 157 Psychrometric Plots ............................................................................................................ 158 Property Plots for Brines .................................................................................................... 160 Overlaying States onto Property Plots ............................................................................... 161 4.7 Brine Properties ................................................................................................................ 164 Brine Property Functions ................................................................................................... 164 Brine Fluid Mixtures ........................................................................................................... 165 Using the Brine Property Functions ................................................................................... 166 The BrineProp2 External Procedure .................................................................................. 166 4.8 Incompressible Properties ............................................................................................... 167 Incompressible Property Functions .................................................................................... 168 Using the Incompressible Property Functions ................................................................... 170 Solid_Liquid_Props Library File (deprecated) .................................................................. 170 Incompressible Property Tables ......................................................................................... 171 Adding Incompressible Property Data ............................................................................... 174 4.9 NH3H2O (Ammonia-Water) ............................................................................................ 177 4.10 Property Data in External Procedures .......................................................................... 179 The IdealGasMixtureProps Library Procedure.................................................................. 179 The NASA Library ............................................................................................................... 181

Ammonia-Water Properties ................................................................................................ 183 Sea Water Properties .......................................................................................................... 185 Bromide-Water and Lithium Chloride-Water Properties ................................................... 186 The GENEOS Library ......................................................................................................... 188 The Peng-Robinson Library................................................................................................ 188 The EES_REFPROP Interface ............................................................................................ 189 4.11 Adding Property Information......................................................................................... 195 Providing Data in Lookup Tables ....................................................................................... 196 Providing Ideal Gas Property Data.................................................................................... 196 Providing Real Fluid Property Data represented by the Martin-Hou Equation of State... 199 References ............................................................................................................................... 204 5 CONVERGENCE AND DEBUGGING ............................................................................. 206 5.1 Solution Methodology Used in EES ................................................................................. 206 Numerical Solution of One Non-Linear Equation .............................................................. 206 Stopping Criteria ................................................................................................................ 209 Numerical Solution of Simultaneous Non-Linear Equations .............................................. 210 Blocking and Reordering Equation Sets ............................................................................. 215 5.2 The Residuals Window ..................................................................................................... 217 Blocks .................................................................................................................................. 217 Residuals ............................................................................................................................. 218 Units .................................................................................................................................... 218 Calls and Time .................................................................................................................... 219 Procedures in the Residuals Window ................................................................................. 220 5.3 The Computational Flow Window .................................................................................... 221 5.4 Setting Guess Values and Limits ....................................................................................... 228 The Variable Information dialog ........................................................................................ 228 Setting Guess Values and Limits using Variables............................................................... 229 Arrays in the Variable Information dialog ......................................................................... 230 Changing Variable Names .................................................................................................. 231 Variable Information Files ................................................................................................. 231 Using Arrays as Guess Values and Limits .......................................................................... 232 Default Variable Information ............................................................................................. 235 5.5 Using the Debug Window ................................................................................................ 236 Incorrect Degrees of Freedom ............................................................................................ 236 Constrained Solution .......................................................................................................... 237 5.6 Debugging Techniques..................................................................................................... 238 Effective Use of EES ........................................................................................................... 238 The Update Guesses Command and Directive ................................................................... 239 The Residuals or Computational Flow Window as a Debugging Tool .............................. 242 Common Problems .............................................................................................................. 244 The $Trace Directive .......................................................................................................... 245 References ............................................................................................................................... 247 6 OPTIMIZATION.................................................................................................................. 248 6.1 One-Dimensional Optimization ....................................................................................... 248 Implementing an Optimization Problem ............................................................................. 249 Objective Function .............................................................................................................. 251

Degrees of Freedom............................................................................................................ 251 The Min/Max Dialog ........................................................................................................... 251 Stopping Criteria ................................................................................................................ 252 Guess Value and Bounds .................................................................................................... 253 The Golden Section Search ................................................................................................. 253 The Quadratic Approximations Optimization Method ....................................................... 255 Min/Max Table .................................................................................................................... 257 6.2 Multi-Dimensional Optimization ..................................................................................... 259 The Conjugate Directions Method ...................................................................................... 262 The Variable Metric Method............................................................................................... 263 The Nelder-Mead Simplex Method ..................................................................................... 263 The DIRECT Algorithm ...................................................................................................... 264 The Genetic Method ............................................................................................................ 265 6.3 Constrained Optimization ................................................................................................ 267 Implementing Constraints using Bounds ............................................................................ 268 Parameterizing Variables ................................................................................................... 269 Penalty Function ................................................................................................................. 271 6.4 Other uses for Optimization .............................................................................................. 273 Solving Difficult Sets of Equations ..................................................................................... 273 Curve Fitting ....................................................................................................................... 275 References ............................................................................................................................... 278 7 INTEGRATION.................................................................................................................... 279 7.1 Numerical Integration of Ordinary Differential Equation ............................................... 279 Example ODE ..................................................................................................................... 279 Analytical Solution .............................................................................................................. 280 Discretizing Time ................................................................................................................ 281 Euler’s Technique (First Order Explicit) ........................................................................... 281 Heun's Method (Second Order Explicit) ............................................................................. 285 The Fully Implicit Method (First Order Implicit) ............................................................... 288 The Crank-Nicolson Method (Second Order Implicit) ....................................................... 289 7.2 Equation-Based Integral Function .................................................................................. 290 Calling Protocol for the Integral Command....................................................................... 290 Entering the State Equations .............................................................................................. 290 Carrying out the Integration ............................................................................................... 291 The Integral Table............................................................................................................... 292 Adaptive Step Size ............................................................................................................... 294 Integrating Simultaneous ODEs ......................................................................................... 295 The IntegralValue Command .............................................................................................. 298 Double Integration .............................................................................................................. 303 Multiple Integral Tables ..................................................................................................... 305 7.3 Table-Based Integral Function ........................................................................................ 306 7.4 Solving Partial Differential Equations ............................................................................ 307 8 UNCERTAINTY PROPAGATION .................................................................................... 313 8.1 Uncertainty Propagation using the RSS Method ............................................................. 313 The Root Sum Square Method............................................................................................. 313 Example of the RSS Method ................................................................................................ 314

8.2 Uncertainty Propagation in EES ..................................................................................... 316 Assigning Uncertainties to Measured Variables ................................................................ 316 Determining the Uncertainties of Calculated Variables .................................................... 318 UncertaintyOf Function ...................................................................................................... 319 Uncer.Pardif and Uncert.Percent Functions ...................................................................... 320 8.3 Uncertainty Propagation in Tables .................................................................................. 320 Uncertainty Propagation Table .......................................................................................... 320 Plotting Data with Uncertainties ........................................................................................ 321 Uncertainty Propagation with Lookup Tables .................................................................... 322 8.4 Uncertainty Propagation in Integrals............................................................................... 326 9 ADVANCED PLOTTING ................................................................................................... 330 9.1 Two-Dimensional Plots..................................................................................................... 330 Point Labels ........................................................................................................................ 330 Dual Axis Scales for Two-Dimensional Plots ..................................................................... 332 The Cross-Hairs Tool ......................................................................................................... 336 Bar Plots ............................................................................................................................. 337 Controlling the Appearance of Bar Plots ........................................................................... 340 Overlays on Bar Plots ......................................................................................................... 341 Bar Plots using String Values ............................................................................................. 343 Side-by-Side Bar Plots ........................................................................................................ 344 Plotting Dates ..................................................................................................................... 347 Polar Plots .......................................................................................................................... 350 Modifying the Appearance of Polar Plots .......................................................................... 351 Using Variables as Axis Limits ........................................................................................... 352 Copying and Saving Plots ................................................................................................... 354 Naming and Documenting Plots ......................................................................................... 356 Plot Templates .................................................................................................................... 356 9.2 Time Sequence Plots ........................................................................................................ 356 Creating the Initial Plot ...................................................................................................... 358 Activating the Time Sequence Display................................................................................ 359 Assigning Frame Numbers to Data Series .......................................................................... 360 Assigning Frame Numbers to Objects ................................................................................ 361 Making a Movie .................................................................................................................. 362 9.3 Three-Dimensional Plots .................................................................................................. 365 Three Column Data............................................................................................................. 367 Isometric Lines Contour Plot .............................................................................................. 367 Color Bands Contour Plot .................................................................................................. 369 Gradient Plot ...................................................................................................................... 370 Three-Dimensional Surface Plot and Control Panel .......................................................... 371 Two-Dimensional Table Data ............................................................................................. 375 3-D Points Plots .................................................................................................................. 377 9.4 Plot Thumbnails Window .................................................................................................. 381 References ............................................................................................................................... 382 10 SUBPROGRAMS and MODULES ................................................................................... 383 10.1 Subprograms .................................................................................................................. 383 Format of a Subprogram .................................................................................................... 383

Solution and Residuals Windows ........................................................................................ 385 Guess Values and Limits of Inputs and Outputs ................................................................. 387 Subprograms with the Integral Command .......................................................................... 388 Subprograms to Determine the Limit of an Integral ........................................................... 393 10.2 Modules .......................................................................................................................... 395 Module Execution ............................................................................................................... 395 The Solution Window .......................................................................................................... 397 The Residuals Window ........................................................................................................ 397 Guess Values and Limits of Inputs and Outputs ................................................................. 398 10.3 Should you use Subprograms or Modules? ................................................................... 399 References ............................................................................................................................... 400 11 INTERNAL LIBRARY FILES ......................................................................................... 401 11.1 Writing and Saving Library (.lib) Files ......................................................................... 401 An Example Library File Function ..................................................................................... 402 Units in Library File Functions .......................................................................................... 402 Testing a Library File Function.......................................................................................... 405 Saving Functions as a Library File .................................................................................... 405 11.2 Loading and Using Library Files .................................................................................. 406 EES Library Routines in the Function Information Dialog ................................................ 406 Libraries in the Userlib (Userlib64) Folder ....................................................................... 407 Manually Loading Library Files......................................................................................... 408 11.3 Help for Library Files ..................................................................................................... 409 Using a Dedicated Help File .............................................................................................. 410 11.4 Application Library Files................................................................................................ 412 Contents of an Application Library Folder ........................................................................ 413 Table of Contents File......................................................................................................... 413 11.5 The Textbook Menu ......................................................................................................... 415 11.6 The Library Manager...................................................................................................... 418 References ............................................................................................................................... 419 12 THE HEAT TRANSFER LIBRARY ................................................................................ 420 12.1 Boiling and Condensation.............................................................................................. 420 12.2 Compact Heat Exchangers ............................................................................................. 423 Compact Heat Exchanger Data .......................................................................................... 423 Organization of the Compact Heat Exchanger Library ..................................................... 423 Non-Dimensional Functions ............................................................................................... 424 Geometry Functions ............................................................................................................ 424 Coefficient of Heat Transfer Functions .............................................................................. 425 Pressure Drop Functions .................................................................................................... 426 12.3 Conduction Shape Factors.............................................................................................. 426 12.4 Convection ...................................................................................................................... 427 Internal Forced Convection ................................................................................................ 427 External Forced Convection ............................................................................................... 428 Free Convection .................................................................................................................. 429 Impinging Jets ..................................................................................................................... 430 Regenerator Packings ......................................................................................................... 431 12.5 Fin Efficiency .................................................................................................................. 432

12.6 Fouling Factors ............................................................................................................. 433 12.7 Heat Exchangers ............................................................................................................ 434 Log Mean Temperature Difference Solutions ..................................................................... 434 Effectiveness-NTU Solutions............................................................................................... 436 Axial Conduction and Regenerator Models ........................................................................ 437 12.8 Radiation View Factors ................................................................................................. 438 12.9 Total Hemispherical Emissivity ..................................................................................... 439 12.10 Transient Conduction................................................................................................... 441 12.11 Minor Losses and Flow Measurement ......................................................................... 442 References ............................................................................................................................... 444 13 COMPLEX ALGEBRA ..................................................................................................... 445 13.1 Introduction to Complex Algebra in EES ...................................................................... 445 Assigning Complex Variables in Rectangular Form .......................................................... 446 Assigning Complex Variables in Polar Form ..................................................................... 447 Units of Complex Variables ................................................................................................ 448 The Variable Information dialog ........................................................................................ 449 Complex Algebra ................................................................................................................ 449 Functions Specific to Complex Variables ........................................................................... 450 Built-In Functions and Complex Variables ........................................................................ 451 13.2 Complex Algebra Example ............................................................................................ 451 Parametric Table ................................................................................................................ 453 The $Real Directive ............................................................................................................ 455 Subprograms ....................................................................................................................... 456 14 DIRECTIVES...................................................................................................................... 457 14.1 Directives related to Display & Formatting Options .................................................... 457 $Allow ‘//’ ........................................................................................................................... 457 $Arrays................................................................................................................................ 457 $Bookmark .......................................................................................................................... 458 $DiagramUpdate On/Off .................................................................................................... 460 $HideWindow...................................................................................................................... 460 $Private ............................................................................................................................... 460 $ShowWindow ..................................................................................................................... 462 $SumRow............................................................................................................................. 463 $Syntax ................................................................................................................................ 464 $TabStops............................................................................................................................ 464 $Warnings ........................................................................................................................... 465 14.2 Directives related to Units ............................................................................................. 465 $CheckUnits ........................................................................................................................ 465 $Reference........................................................................................................................... 466 $UnitSystem ........................................................................................................................ 467 14.3 Directives for Code Segments ........................................................................................ 467 $Common ............................................................................................................................ 467 $Constant ............................................................................................................................ 468 14.4 Directives related to Complex Algebra.......................................................................... 469 $Complex ............................................................................................................................ 469 $Real ................................................................................................................................... 469

14.5 Directives related to Saving & Copying Data ............................................................... 469 $CopyToLookup .................................................................................................................. 469 $Export................................................................................................................................ 471 $ExportPlot ......................................................................................................................... 473 $Import................................................................................................................................ 473 $OpenLookup ...................................................................................................................... 476 $SaveLookup ....................................................................................................................... 477 $SaveTable .......................................................................................................................... 477 $SaveVarInfo....................................................................................................................... 478 14.6 Directives related to Program Execution & Debugging ............................................... 479 $ClearLookup 'LookupTableName' /C1..3 /R2..5 .............................................................. 479 $DefaultArraySize=100 ...................................................................................................... 479 $DoLast & $EndDoLast ..................................................................................................... 479 $If, $IfNot, $Else & $EndIf ................................................................................................. 480 $Include............................................................................................................................... 485 $IntegralAutoStep ............................................................................................................... 486 $IntegralTable..................................................................................................................... 486 $Load 'Component Library' ................................................................................................ 486 $MaxCalls ........................................................................................................................... 487 $RunMacroAfter ................................................................................................................. 487 StopCriteria......................................................................................................................... 487 $Trace ................................................................................................................................. 488 $UpdateGuesses.................................................................................................................. 488 $VarInfo .............................................................................................................................. 489 References ............................................................................................................................... 490 15 THE DIAGRAM WINDOW.............................................................................................. 491 15.1 Placing Graphic Objects in the Diagram Window ........................................................ 491 Development and Application Modes ................................................................................. 491 Graphical Objects from a Drawing Program..................................................................... 492 Graphical Objects Drawn in the Diagram Window ........................................................... 493 Drawing and Modifying Lines and Arrows ........................................................................ 494 Drawing and Modifying Rectangles ................................................................................... 496 Drawing and Modifying Ellipses or Circles ....................................................................... 498 Drawing and Modifying Polylines and Polygons ............................................................... 499 Accessing the Diagram Window Palette ............................................................................. 501 15.2 Placing Text Items in the Diagram Window .................................................................. 504 Entering Plain Text ............................................................................................................. 504 Entering Formatted Text ..................................................................................................... 506 15.3 Entering Input and Output Variables ............................................................................ 509 An Example of a Graphical User Interface ........................................................................ 509 Entering Input Numerical Variables from the Diagram Window ....................................... 510 Displaying Output Variables on the Diagram Window ...................................................... 511 Limits on Input Variables.................................................................................................... 513 Entering Input String Variables from the Diagram Window .............................................. 514 Mapping String Variables in a Drop-Down List to Equations ........................................... 516 The Find Command............................................................................................................. 518

15.4 Copying and Resizing the Diagram Window ................................................................. 519 The Copy Command in Application Mode .......................................................................... 519 The Copy Command in Development Mode ....................................................................... 519 Change Window Size Dialog .............................................................................................. 520 Clearing the Diagram Window ........................................................................................... 520 15.5 Adding Calculate, Print, Plot Access, and Help buttons ............................................... 521 Adding a Calculate Button .................................................................................................. 521 Moving and Resizing the Calculate Button......................................................................... 521 Calculate Button Characteristics Dialog............................................................................ 522 Adding a Print Button ......................................................................................................... 523 Adding a Plot Access Button ............................................................................................... 524 Showing a Plot on the Diagram Window ............................................................................ 527 Adding a Help Button.......................................................................................................... 528 15.6 Child Diagram Windows................................................................................................ 528 Creating a Child Diagram Window .................................................................................... 529 How to Modify Child Diagram Property Information ........................................................ 530 How to Access a Diagram Window from another Diagram Window ................................. 532 15.7 Other Professional Version Enhancements___________ ............................................. 533 Group and Ungroup Selected Items Buttons ...................................................................... 533 Align Selected Items Button ................................................................................................ 534 Showing a Grid on the Diagram Window ........................................................................... 534 Creating Links..................................................................................................................... 535 Adding an Audio-Visual Item .............................................................................................. 538 Saving and Loading User Inputs......................................................................................... 538 Add Check Box Item ............................................................................................................ 540 Creating and Using Radio Button Groups.......................................................................... 542 Using Sliders for Inputting Values...................................................................................... 545 Entering a Filename into a String Variable ....................................................................... 547 Converting Units for Inputs and Outputs in the Diagram Window .................................... 548 16 DIAGRAM WINDOW ANIMATION .............................................................................. 554 16.1 Controlling the Attributes of Diagram Window Objects ............................................... 554 Attributes of Rectangle and Ellipse/Circle Objects ............................................................ 554 Attributes of Line Objects ................................................................................................... 557 Attributes of Polyline and Polygon Objects ........................................................................ 558 Attributes of Text Objects.................................................................................................... 558 Attributes of Button, Radio Group and Check box Objects ................................................ 560 Showing and Hiding Diagram Window Objects ................................................................. 561 16.2 Setting Attributes within the Diagram Window ............................................................. 562 Setting Attributes with Text Drop Down Lists .................................................................... 562 Setting Attributes with a Check Box Object ........................................................................ 566 Setting Attributes with a Radio Button Group .................................................................... 566 Controlling the Equations Window with Check Boxes and Radio Button Groups ............. 568 Improving the Response Time of Diagram Window Controls ............................................ 569 16.3 Exchanging Inputs and Outputs ..................................................................................... 570 16.4 Using Parametric and Integral Tables for Animations ................................................. 576 Setting up an Animation Using the Parametric Table ........................................................ 577

Saving Animation Files for the Generation of a Movie ...................................................... 579 Setting up an Animation Using the Integral Table ............................................................. 579 17 DISTRIBUTABLE PROGRAMS ..................................................................................... 585 17.1 Distributable Program Setup and Startup Dialog ...................................................... 585 17.2 Setting Distributable File Information........................................................................... 590 17.3 Completing the Distributable File ................................................................................. 593 17.4 Internet-Enabled Distributable Programs ..................................................................... 595 Creating a Distributable Program...................................................................................... 595 Installing the EESws Web Server on a Server Computer ................................................... 599 Starting and Running EESws .............................................................................................. 602 Modifying the Firewall Parameters .................................................................................... 603 Running a Distributable Program with EESws .................................................................. 607 Uninstalling EESws ............................................................................................................ 611 Operating Tips and Trouble-Shooting ................................................................................ 612 18 MACROS ............................................................................................................................. 615 18.1 The EES Macro Window ................................................................................................ 615 Creating a Macro in the Macro Window ............................................................................ 616 The EES Log File ................................................................................................................ 620 18.2 EES Macro Commands .................................................................................................. 622 18.3 Interacting with External Programs using Macros ....................................................... 653 Interacting with Microsoft Excel ........................................................................................ 653 Interacting with MATLAB ................................................................................................... 656 18.4 Using a Macro for Serial Port Communications ........................................................... 658 Basic Communication with the Arduino UNO .................................................................... 658 Logging Data to a Lookup Table and Plotting ................................................................... 660 18.5 Executing EES Macros from External Programs .......................................................... 667 Executing an EES Macro File from the Windows Run dialog ............................................ 667 Executing an EES Macro File from MATLAB .................................................................... 668 Executing an EES Macro File from Excel .......................................................................... 670 Executing an EES Macro File from LabView ..................................................................... 673 Executing an EES Macro File from DELPHI ..................................................................... 676 18.6 Interacting with EES using Dynamic Data Exchange ................................................... 678 Dynamic Data Exchange with Excel................................................................................... 678 Dynamic Data Exchange with MATLAB ............................................................................ 680 Dynamic Data Exchange with DELPHI ............................................................................. 681 18.7 Useful Macro Examples ................................................................................................. 683 19 EXTERNAL FUNCTIONS AND PROCEDURES ......................................................... 686 19.1 EES External Functions (.dlf files) ................................................................................ 686 External Functions written in C++ .................................................................................... 691 19.2 EES External Procedures - Type 1 (.dlp files) ............................................................... 694 Type 1 External Procedures written in Pascal ................................................................... 695 Type 2 External Procedures written in C++ ...................................................................... 699 19.3 EES External Procedures - Type 2 (.fdl files) ................................................................ 702 Type 2 (.fdl procedure) with the MinGW Open Source GCC Fortran Compiler ............... 706 19.4 Multiple Files in a Single Library File (.dll or .dll64).................................................... 710

19.5 Managing External Library Files .................................................................................. 713 Loading External Library Files .......................................................................................... 713 Providing Help for External Library Files ......................................................................... 713 19.6 External Python Procedures ......................................................................................... 714 20 THE REPORT WINDOW ................................................................................................. 721 20.1 Creating the Report......................................................................................................... 721 20.2 Inserting EES Variables.................................................................................................. 726 20.3 Inserting EES Plots ......................................................................................................... 727 21 THE COMPONENT LIBRARY ....................................................................................... 729 21.1 Summary of the Component Library .............................................................................. 740 Appendix A: Built-In Mathematical Functions .................................................................... 743 Appendix B: Built-In String Functions .................................................................................. 753 Appendix C: Directives ........................................................................................................... 756 Appendix D: Macro Commands ............................................................................................. 759 Appendix E: Overriding Default Behavior ........................................................................... 770 Appendix F: EES File Types ................................................................................................... 773 Appendix G: The 64-bit Professional version ....................................................................... 778 Index ........................................................................................................................................... 780