EES-Lecture-4.ppt

上传人:豆**** 文档编号:26225294 上传时间:2022-07-16 格式:PPT 页数:35 大小:1.97MB
返回 下载 相关 举报
EES-Lecture-4.ppt_第1页
第1页 / 共35页
EES-Lecture-4.ppt_第2页
第2页 / 共35页
点击查看更多>>
资源描述

《EES-Lecture-4.ppt》由会员分享,可在线阅读,更多相关《EES-Lecture-4.ppt(35页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、Contents EES introduction tutorial (4 Lecures) Solving nonlinear & implicit equations (Lect 1) Formatting of equations (Lect 1) The unit system(Lect 2) Built-in functions(Lect 2) The Options menu(Lect 3) Parametric studies & plot basics(Lect 3) Lookup tables(Lect 4) Plots(Lect 4)0:35Lookup Tables Lo

2、okup Tables and Lookup Files (residing on the disk) provide a means of using tabular information in the solution of equations A good example is the variation of a property such as air density with temperature Conveniently (again!), EES uses a spreadsheet approach.(EES Lecture 4.1 - SimpleLookupTable

3、.EES):0:08Lookup Tables0204060801000.90.9511.051.11.151.21.251.3T C air kg/m3This is how the air density changes with temperature at ambient pressure. One could, of course, fit a mathematical function through that, however it is much simpler and more flexible to put the data in a lookup table or loo

4、kup file:0:10Lookup TablesLookup data can be accessed using two functions: Using the Lookup function, one specifies a specific row and column and retrieve a value for the other column for the same specified row The Interpolate function is much more useful. In essence it works like the Lookup functio

5、n, except that the retrieved value could fall between table rows. EES would then interpolate for this value, using several interpolation schemesThere are 2 ways to specify Lookup table data: Create and use a lookup table in EES and add the required data to it (shown on the previous slide). It can be

6、 directly pasted from Excel with headings and units for example (using Paste Special) Add the data to a text file and simply tell EES about the file. The file has the following format:0:15Lookup Tables0:15Number of rowsNumber of columnsMinus sign indicates that heading data is presentNumber format (

7、Auto 3-digit)Column titleColumn unitFirst column (T)Second column (rho_air)One could also omit the file headings and just specify the column data, but that is far less flexible and user-friendly!HeadingdataLookup Table Creation A lookup table is created from the Table menu: Data and headings can be

8、manually entered or pasted from a text file or Excel:0:15Lookup Table UsageFormat: TableName, RowNo (or RowName), ColNo (or ColName)T_1 = Lookup(Lookup 1, 4, 1) The table name is a stringrho_1 = Lookup(Lookup 1, 4, 2)0:25Lookup Table UsageInstead of a column number, we could specify the column by na

9、me via a string.T_2 = Lookup(Lookup 1, 5, T)T is a string!rho_2 = Lookup(Lookup 1, 5, rho_air)This way, row is a variable, which is much more flexiblerow = 6T_3 = Lookup(Lookup 1, row, T)rho_3 = Lookup(Lookup 1, row, rho_air)0:25Lookup Table UsageMore useful interpolate commandsFormat: TableName, Co

10、l1Name, Col2Name, ColValueNote the single quotes!rho_4a = Interpolate(Lookup 1, T, rho_air, T=65)As long as strings have no spaces, we can omit the quotesrho_4b = Interpolate(Lookup1, T, rho_air, T=65)We could also provide the value for the density column and retrieve the temperatureT_4 = Interpolat

11、e(Lookup1, T, rho_air, rho_air=1.2)0:25Lookup Table UsageIt is mostly a good idea to specify the properties such as temperature as variablesT_5 = 65 Crho_5a = Interpolate(Lookup1, T, rho_air, T=T_5)The lookup table can also reside in a disk file. Better to use string format for file name as file nam

12、es often have spacesrho_5b = Interpolate(Lookup 1.txt, T, rho_air, T=T_5)0:25Lookup Table Notes A table can be saved to disk (or opened) from the Table menu as shown. The saved file format can be text (txt), binary (lkt) or comma seperated variable (csv). EESs built-in libraries are binary and are s

13、tored in the Userlib directory as shown.0:25Lookup Table NotesNote: There are 5 versions of the Interpolate function:INTERPOLATE uses cubic interpolationINTERPOLATE1 uses linear interpolationINTERPOLATE2 uses quadratic interpolationINTERPOLATE2D does a 2-D interpolation, stored in a table.INTERPOLAT

14、E2M does a 2-D interpolation, stored in a matrix0:25Lookup Table Notes As shown before, one can omit the string quotes in the Interpolate function, and in many (most) other built-in EES functions, provided there are no spaces in the strings. However, this does not work for the Lookup function. In th

15、e Lookup function, the table or file name can omit the quotes, but the column names cannot! This is so since columns can also be numbered.0:25Advanced Lookup Table A more extensive example is the International Standard Atmosphere (ISA) which gives the properties of the atmosphere at different altitu

16、des In the example, four properties are listed against each other. One can interrogate any two columns at a time. Please refer to “ISA Atmosphere.xls”(EES Lecture 4.2 ISA LookupTable.EES)0:08Advanced Lookup TableThis is what the International Standard Atmosphere temperature with height looks like. I

17、t is obviously not going to be easy to fit a mathematical function through that! 0:10Note: Use LINEAR interpolation here and NOT CUBICAdvanced Lookup Table The Lookup table would look as follows:0:15Advanced Lookup TableObtain the temperature and the density at a height of 4800mT_1 = Interpolate(ISA

18、, Height, Temperature, Height=4800)rho_1 = Interpolate(ISA, Height, Density, Height=4800)At what height would the pressure be 80 kPa?H_1 = Interpolate(ISA, Height, Pressure, Pressure=80)0:25Plots & GraphsPlot basics have been introduced in lecture 3. In this section we will introduce some of the mor

19、e advanced features of plots and graphs: What is a plot and a graph? How EES plots graphs from data Multiple graphs on a plot Axes, scales, line types, marker symbols, grid lines Editing plot data Annotating a plot, text data, editing titles0:08Plots & GraphsIn EES plots (like parametric tables and

20、lookup tables) are all housed in a dedicated window that is accessible through the Windows menu or the toolbar.0:08All plots are housed in the one plot windowEach plot occupies a new tabPlots & GraphsA graph is a line on an X-Y axis. A plot may consist of a number of graphs on the same X-Y axis.0:08

21、Plots & GraphsThere are 3 types of graphs that can be plotted with EES: X-Y plots Bar plots X-Y-Z plots (3-dimensional) Surface plots Contour plots0:08Plots & GraphsHow EES plots graphs from data: EES plots graphs from any type of “array”. Parametric tables, lookup tables and ordinary arrays (matric

22、es) all qualify as sources for graphs. EES iterates through the arrays and plots y1 vs x1, y2 vs x2, y3 vs x3 etc The source is the first selection that should be made when creating a graph. The source selection will automatically load the relevant variables in the X-axis and Y-axis variable list bo

23、xes.0:08Plots & Graphs We demonstrate this by creating data and storing it in the different “array” types (Lecture 4.3 - Plots and Graphs.EES): We create two parametric tables as functions of sine and cosine We also create data and store it in an array Lastly, we place some data in a Lookup Table0:0

24、8Plots & GraphsNow lets plot graphs from these “arrays” The first step after choosing “X-Y Plot ” from the menu is to select the data source, the three alternatives being shown here:0:08 Note the data source options Note the variables automatically being loaded for the selected data sourcePlots & Gr

25、aphsMore on data source selection: Since we have created two parametric tables, we have to select the instance we want to plot from:0:08 Note the table source options Note the variables automatically being loaded for the selected data sourcePlots & GraphsLets now put all these graphs on a single plo

26、t Plot the first graph from the parametric table Table 1 (the sine function) as shown before, choosing the variables x for the X-axis and y for the Y-axis: Normally one wants to plot all the data in the table or array, but one can actually specify the start and end indices Check the “Spline fit”, “A

27、uto Update” and “Add legend item” checkboxes and choose a symbol and a colour and press OK.0:08The “Automatic Update” checkbox will ensure that the graph is automatically updated when the data in the table or array changes. This is mostly desired, but when the same parametric table is used to genera

28、te different curves, one may not want to check this option.Plots & Graphs To plot subsequent graphs on the same plot, choose “Overlay Plot” The same plot setup dialog appears. We must now choose the second parametric table as source Check the “Spline fit”, “Auto Update” and “Add legend item” checkbo

29、xes Note that EES automatically chooses the next symbol and colour Press OK.0:08Note the legendPlots & GraphsWe can also plot the data from the array table (and the lookup table) in the same wayNote that there is only one array table, whereas it is possible to create several parametric and lookup ta

30、blesLike with tables, one can plot any range of the dataArrays can also show the array index at each pointNote that EES automatically chooses the next symbol and colourPress OKNote that the new graph exceeds the Y-axis limits0:08Graph from arrayexceeding Y-limitsPlots & GraphsWe can fix the scaling

31、(range) of any axis by simply clicking on the axis, which would bring up the following dialog:We could select “Automatic scaling” or one could manually enter appropriate limitsWe could also change to log scaling, switch grid lines on, change the font, font colour and text angle and even the number f

32、ormat from this dialogNote the array indices on the yai curve.0:08Plots & GraphsWe can also edit graphs after creation. Simply right-click in the plot area to produce the “Modify Plot” dialog:We can Remove a graph Change line and marker types Show every nth marker Choose the smoothing Set Auto updat

33、ing We can connect the graph to a different data source through the Data button Choose the Y-axis and error bars Set border and grid attributes Swap the X and Y axes0:08Plots & GraphsIt is easy to edit plot titles and add text and other graphics to a plot. To do this, activate the Plot Toolbar via t

34、he Plot menu or by right-clicking or double-clicking in the empty margin outside of the plot area: The Graph value cross-hairs can be invokes by keeping the Ctrl+Shift keys down and moving the mouse pointer over the graph area. The X-Y values are displayed at the bottom of the graph0:08Add text tool

35、Add graphics toolsGraphics orientation toolsGraph value cross-hairsGraph zoom toolCross hairs and X-Y valuesPlots & Other OutputsPlots (like tables and formatted equations) can be copied from EES and pasted in other applications such as MS Word.The Professional version of EES also has a MathType int

36、erface for seamless exchange between EES and other applicationsThe Professional version of EES also has a convenient built-in Report Writer which students can use to report on the findings of their EES studyLastly, one can also export the report in PDF format. 0:08The End of Lecture 4 and the Introductory EES Course0:05

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com