Delft3D-MATLAB_User_Manual

合集下载

Delft3D水流计算笔记入门

Delft3D水流计算笔记入门

Delft 3D 计算水流泥沙第1章网格1.1 确定模型范围即确定网格范围,确定河道起止断面,河堤位置等;另,可将桥梁位置,工程布置,测流点等予以标注。

*.ldb (land boundary)文件在记事本或UE里编辑后保存为后缀名为.ldb的文件即可。

l mn 2x1 y1x2 y2……x n y nl代表line,m表示当前是第几条线,n表示这条线有多少个点,x y表示点坐标,具体格式见附件LDB文件。

其中x,y坐标的提取,利用cad-excel插件的提取多段线坐标功能。

确定模型边界时,力求准确,缩小范围,减少后期处理数据量(网格数量)。

打开GRID模块的RGFGRID,File→Open Land Boundary(图1-1)1.2 Splines分割模型即绘制spline样条曲线。

打开GRID模块的RGFGRID,File→Open Land Boundary(图1-1),找到*.ldb文件打开(图1-2)。

除第一个为打印命令外,其他都是视图范围调整按钮。

图1-1图1-2导入ldb文件图1-3 Spline样条曲线(绿色)在land boundary的参照下,点击开始画Splines样条曲线,删除整条线,调整单个点,删除单个点。

左键点击画点,右键结束一条线,ESC键可以回退一步,注意3D中操作只可以回退一步,所以操作要稳准,且注意随时保存。

画Spline时注意中间岛的处理,如果岛较大且无地形数据,在差值地形前需要删掉网格以便计算,则岛可以用两条Spline包裹,以节省网格。

如图1-3。

画Spline线时,注意河道狭窄处的处理。

Spline线顺延河段较宽处的走势,画在land boundary之外,这样在生成网格时,避免了此处网格过密。

Splines画好后,File→Save Splines,保存为*.spl文件。

1.3 生成网格打开*.spl文件,点击生成网格,生成网格时,Settings→Change Parameters,设置自动生成网格的参数。

MATLAB中文手册簿

MATLAB中文手册簿

Matlab中文手册目录 (1)第1章MATLAB 6.5环境 (6)1.1 MA TLAB简介 (6)1.1.1 MATLAB工具箱 (6)1.1.2 MATLAB功能和特点 (6)1.2 MA TLAB 6.5环境设置 (7)1.2.1 菜单栏 (7)1.2.2 工具栏 (10)1.2.3 通用操作界面窗口 (10)1.3 MA TLAB 6.5帮助 (19)1.4 MATLAB 6.5其他管理 (20)1.4.1 MATLAB用户文件格式 (20)1.4.2设置搜索路径 (21)1.4.3文件管理命令 (22)1.4.4 退出MA TLAB (23)1.5 一个实例 (23)第2章MATLAB数值计算 (26)2.1 变量和数据 (26)2.1.1数据类型 (26)2.1.2数据 (26)2.1.3变量 (27)2.2 矩阵和数组 (28)2.2.1矩阵输入 (28)2.2.2矩阵元素和操作 (31)2.2.3字符串 (37)2.2.4矩阵和数组运算 (41)2.2.5多维数组 (52)2.3稀疏矩阵 (55)2.3.1稀疏矩阵的建立 (55)2.3.2稀疏矩阵的存储空间 (58)2.3.3稀疏矩阵的运算 (59)2.4多项式 (59)2.4.1多项式的求值、求根和部分分式展开 (59)2.4.2多项式的乘除法和微积分 (61)2.4.3多项式拟合和插值 (63)2.5元胞数组和结构数组 (65)2.5.1元胞数组 (65)2.5.2结构数组 (68)2.6数据分析 (71)2.6.1数据统计和相关分析 (71)2.6.2差分和积分 (72)2.6.3卷积和快速傅里叶变换 (74)2.6.4向量函数 (76)第3章MATLAB符号计算 (77)3.1 符号表达式的建立 (77)3.1.1 创建符号常量 (77)3.1.2 创建符号变量和表达式 (78)3.1.3 符号矩阵 (79)3.2符号表达式的代数运算 (81)3.2.1符号表达式的代数运算 (81)3.2.2 符号数值任意精度控制和运算 (83)3.2.3 符号对象与数值对象的转换 (84)3.3符号表达式的操作和转换 (85)3.3.1符号表达式中自由变量的确定 (85)3.3.2符号表达式的化简 (86)3.3.3符号表达式的替换 (89)3.3.4求反函数和复合函数 (90)3.3.5 符号表达式的转换 (92)3.4 符号极限、微积分和级数求和 (93)3.4.1符号极限 (93)3.4.2符号微分 (94)3.4.3符号积分 (96)3.4.4符号级数 (97)3.5 符号积分变换 (98)3.5.1傅里叶(Fourier)变换及其反变换 (98)3.5.2拉普拉斯(Laplace)变换及其反变换 (99)3.5.3 Z变换及其反变换 (100)3.6符号方程的求解 (101)3.6.1代数方程 (101)3.6.2符号常微分方程 (102)3.7符号函数的可视化 (103)3.7.1符号函数的绘图命令 (103)3.7.2图形化的符号函数计算器 (105)3.8 Maple函数的使用 (105)3.8.1访问Maple函数 (105)3.8.2 获得Maple的帮助 (106)第4章MA TLAB计算的可视化和GUI设计 (107)4.1二维曲线的绘制 (107)4.1.1基本绘图命令plot (107)4.1.2绘制曲线的一般步骤 (111)4.1.3多个图形绘制的方法 (112)4.1.4曲线的线型、颜色和数据点形 (114)4.1.5设置坐标轴和文字标注 (115)4.2 MA TLAB的三维图形绘制 (119)4.2.1绘制三维线图命令plot3 (119)4.2.2绘制三维网线图和曲面图 (120)4.2.3立体图形与图轴的控制 (123)4.2.4色彩的控制 (125)4.3 MA TLAB的特殊图形绘制 (128)4.3.1条形图 (128)4.3.2面积图和实心图 (129)4.3.3直方图 (130)4.3.4饼图 (131)4.3.5离散数据图 (132)4.3.6对数坐标和极坐标图 (132)4.3.7等高线图 (133)4.3.8复向量图 (134)4.4图形窗口的功能 (135)4.5对话框 (136)4.6句柄图形 (138)4.6.1句柄图形体系 (138)4.6.2图形对象的操作 (139)4.6.3图形对象属性的获取和设置 (142)4.7图形用户界面(GUI)设计 (144)4.7.1可视化的界面环境 (144)4.7.2菜单 (145)4.7.3控件 (146)4.7.5回调函数 (148)4.7.6 GUI应用举例 (148)4.8动画 (151)4.8.1以电影方式产生动画 (151)4.8.2以对象方式产生动画 (151)第5章MATLAB程序设计 (153)5.1脚本文件和函数文件 (153)5.1.1 M文本编辑器 (153)5.1.2 M文件的基本格式 (153)5.1.3 M脚本文件 (154)5.1.4 M函数文件 (155)5.2程序流程控制 (156)5.2.1 for ... end循环结构 (156)5.2.2 while ... end循环结构 .. (157)5.2.3 If...else...end条件转移结构 (158)5.2.4 switch...case开关结构 (158)5.2.5 try... catch... end试探结构 . (160)5.2.6流程控制语句 (160)5.3函数调用和参数传递 (162)5.3.2局部变量和全局变量 (163)5.3.3函数的参数 (164)5.3.4程序举例 (167)5.4 M文件性能的优化和加速 (169)5.4.1 P码文件 (169)5.4.2 M文件性能优化 (169)5.4.3 JIT和加速器 (170)5.5内联函数 (173)5.6利用函数句柄执行函数 (174)5.6.1函数句柄的创建 (174)5.6.2用feval命令执行函数 (175)5.7利用泛函命令进行数值分析 (176)5.7.1求极小值 (177)5.7.2求过零点 (178)5.7.3数值积分 (179)5.7.4微分方程的数值解 (179)第6章线性控制系统分析与设计 (181)6.1线性系统的描述 (181)6.1.1状态空间描述法 (181)6.1.2传递函数描述法 (182)6.1.3零极点描述法 (183)6.1.4离散系统的数学描述 (183)6.2线性系统模型之间的转换 (186)6.2.1连续系统模型之间的转换 (186)6.2.2连续系统与离散系统之间的转换 (189)6.2.3模型对象的属性 (192)6.3结构框图的模型表示 (194)6.4线性系统的时域分析 (202)6.4.1零输入响应分析 (202)6.4.2脉冲响应分析 (203)6.4.3阶跃响应分析 (204)6.4.4任意输入的响应 (205)6.4.5系统的结构参数 (207)6.5线性系统的频域分析 (208)6.5.1频域特性 (208)6.5.2连续系统频域特性 (209)6.5.3幅值裕度和相角裕度 (212)6.5.4离散系统频域分析 (213)6.6线性系统的根轨迹分析 (213)6.6.1绘制根轨迹 (213)6.6.2根轨迹的其它工具 (215)6.7线性系统的状态空间设计 (218)6.7.1极点配置法 (218)第7章Simulink仿真环境 (220)7.1演示一个Simulink的简单程序 (220)7.2 Simulink的文件操作和模型窗口 (222)7.2.1 Simulink的文件操作 (222)7.2.2 Simulink的模型窗口 (222)7.3 模型的创建 (224)7.3.1模块的操作 (224)7.3.2信号线的操作 (226)7.3.3给模型添加文本注释 (227)7.4 Simulink的基本模块 (227)7.4.1基本模块 (227)7.4.2常用模块的参数和属性设置 (229)7.5复杂系统的仿真与分析 (232)7.5.1仿真的设置 (232)7.5.2连续系统仿真 (233)7.5.3离散系统仿真 (236)7.5.4仿真结构参数化 (238)7.6子系统与封装 (238)7.6.1建立子系统 (238)7.6.2条件执行子系统 (240)7.6.3子系统的封装 (241)7.7用MA TLAB命令创建和运行Simulink模型 (245)7.7.1用MA TLAB命令创建Simulink模型 (245)7.7.2用MA TLAB命令运行Simulink模块 (247)7.8以Simulink为基础的模块工具箱简介 (248)第8章MA TLAB高级应用 (248)8.1 MA TLAB应用接口 (248)8.1.1 MEX文件 (248)8.1.2 使用MA TLAB编译器生成MEX和EXE文件 (252)8.2 低级文件的输入输出 (254)8.2.1打开和关闭文件 (254)8.2.2读写格式化文件 (255)8.2.3读写二进制数据 (257)8.2.4文件定位 (258)8.3 图形文件的转储 (260)8.4 Notebook (260)8.4.1 Notebook的安装 (260)8.4.2 Notebook的启动 (261)8.4.3 Notebook的使用 (262)8.4.4 Notebook中MA TLAB的使用 (265)第1章MATLAB 6.5环境1.1MATLAB简介●MATLAB(Matrix Laborator)是MathWorks公司开发科学与工程计算软件;●广泛应用于自动控制、数学运算、信号分析、计算机技术、图像信号处理、财务分析、航天工业、汽车工业、生物医学工程、语音处理和雷达工程等行业;●国内外高校和研究部门科学研究的重要工具;●MATLIB 已成为数学计算工具方面事实上的标准,MATLIB 6.5是最新版本。

Delft3D-NESTWQ_User_Manual

Delft3D-NESTWQ_User_Manual

Delft3D-NESTWQ Offline nesting of water quality models User ManualNovember, 2006User Manual Delft3D-NESTWQPublished and printed by:WL | Delft Hydraulicsmain officeRotterdamseweg 185p.o. box 1772600 MH DelftThe Netherlandstelephone+31 15 285 85 85fax+31 15 285 85 82internet info@wldelft.nlwww http://www.wldelft.nlFor support contact:e-mail:delft3d.support@wldelft.nlwww:http://www.wldelft.nl/d3d/telephone:+31 15 285 85 55fax:+31 15 285 85 82Copyright 2006 WL | Delft HydraulicsAll rights reserved. No part of this document may be reproduced in any form by print, photo print, photo copy, microfilm or any other means, without written permission from the publisher: WL | Delft Hydraulics.Delft3D-NESTWQ Contents November, 2006 User Manual Version 1.33 Contents1 A guide to this manual.......................................................................................1–11.1Introduction............................................................................................1–11.2Manual version and revisions..................................................................1–11.3Typographical conventions......................................................................1–21.4Changes with respect to previous versions...............................................1–22Introduction to Delft3D-NESTWQ...................................................................2–12.1System name and subsystems..................................................................2–12.2Functionality..........................................................................................2–12.3Overview subsystems.............................................................................2–23Getting started..................................................................................................3–13.1Starting Delft3D.....................................................................................3–13.2Getting into Delft3D-NESTWQ..............................................................3–23.3Exploring some menu options.................................................................3–64Input and output...............................................................................................4–14.1Input NESTWQ1...................................................................................4–14.2Output NESTWQ1.................................................................................4–24.3Input NESTWQ2...................................................................................4–24.4Output NESTWQ2.................................................................................4–35Tutorial..............................................................................................................5–15.2Introduction............................................................................................5–35.3Input and output NESTWQ1..................................................................5–55.4Input and output NESTWQ2..................................................................5–7November, 2006Contents Delft3D-NESTWQ Version 1.33User Manual 6Limitations, warnings and errors.....................................................................6–16.1Limitations.............................................................................................6–16.2Warnings................................................................................................6–26.3Errors....................................................................................................6–27Description files.................................................................................................7–18Theoretical background....................................................................................8–18.1Boundary segments................................................................................8–18.2Nest segments and weights.....................................................................8–19References.........................................................................................................9–1Delft3D-NESTWQ A guide to this manual November, 2006 User Manual Version 1.331 A guide to this manual1.1IntroductionThis User Manual concerns the offline water quality nesting module, Delft3D-NESTWQ, ofthe Delft3D software suite. To make this manual more accessible we will briefly describe thecontents of each chapter and appendix.If this is your first time to start working with Delft3D-NESTWQ we suggest you to read andpractice the getting started of Chapter 3 and the tutorial of Chapter 5. These chapters explainthe user input and guide you through the definition of your first nested simulation.Chapter 2:Introduction to Delft3D-NESTWQ, provides specifications of Delft3D-NESTWQ, such as the areas of applications, the functionality provided and an overview ofthe system.Chapter 3:Getting started, explains the use of the overall menu program, which givesaccess to all Delft3D modules (for which you have authorisation) and to the pre- and post-processing tools. Delft3D-NESTWQ being one of them as part of the WAQ module.Chapter 4:Input and output, provides detailed information on the parameters in the inputfile and the output files from Delft3D-NESTWQ.Chapter 5:Tutorial, emphasis at giving you some first hands-on experience in using theDelft3D-NESTWQ tool.Chapter 6:Limitations, warnings and errors, discusses the underlying assumptions andwarnings and errors that might occur.Chapter 7:Description files, explains in detail the contents of input and output files.Chapter 8:Theoretical background, provides information about boundary segments, nestsegments and weights.Chapter 9:References, provides a list of related Delft3D modules and backgroundinformation.1.2Manual version and revisionsA manual applies to a certain release of the related numerical program. This manual appliesto Delft3D-NESTWQ1 version 2.00.02 and Delft3D-NESTWQ2 version 2.00.03.November, 2006 A guide to this manual Delft3D-NESTWQ Version 1.33User Manual 1.3T ypographical conventionsThroughout this manual, the following conventions help you to distinguish between different elements of text to help you learn about Delft3D and NESTWQ.Example DescriptionWater quality Title of a window or sub-window.Sub-windows are displayed in the WAQ Module windowand can not be moved.Tools Item from a menu, title of a push button or the name of auser interface input field.Upon selecting this item (click or in some case double clickwith the left mouse button on it) a related action will beexecuted; in most cases it will result in displaying some other(sub-)window.In case of an input field you are supposed to enter input dataof the required format and in the required domain.<\tutorial\waq\nestwq> <nestwq1.inp>Directory names, filenames, and path names are expressed between smaller than, <, and larger than, >, signs. For the Linux and UNIX environment a forward slash (/) is used instead of the backward slash (\) for PCs.“27081999”Data to be typed by you into the input fields are displayedbetween double quotes.Selections of menu items, option boxes etc. are described assuch: for instance ‘select Save and go to next window’.delft3d-menu Commands to be typed by you are given in the font CourierNew, 10 points.[m/s] [-]Units are given between square brackets when used next to the formulae. Leaving them out might result in misinterpretation.1.4Changes with respect to previous versionsDelft3D-NESTWQ Introduction to Delft3D-NESTWQ November, 2006 User Manual Version 1.33 2Introduction to Delft3D-NESTWQThe transfer of data from an encompassing or 'overall' numerical model to an embedded or'nested' numerical model is called nesting. In general the overall model has a coarse resolutionof grid cells, whereas the nested model has a higher resolution. At the boundary locations ofthe nested model the results from the overall model are required as boundary conditions forthe nested model. The boundary conditions can be water levels, currents, fluxes or dischargesin case of hydrodynamic models, and water quality parameters in case of water qualitymodels.2.1System name and subsystemsThe procedure of nesting through concentrations between Delft3D-WAQ (or PART) models isperformed by the system NESTWQ. In this procedure two steps can be distinguished whichare handled by separate subsystems:NESTWQ1, for the determination of nest segments and nest weights in the overall model. The concentrations at these segments are used by the next subsystem.NESTWQ2, for the generation of boundary conditions for the boundary segments in the nested model from the results at the nest segments in the overall model.2.2FunctionalityThe functionality of the subsystem NESTWQ1 is:determine for each boundary segment in the nested model which nest segments in the overall model are required for the nesting of results to these boundary segments determine for each nest segment the weight factors for the interpolation from the surrounding nest segments to the boundary segment in the nested modelThe functionality of the subsystem NESTWQ2 is:interpolate the concentration time-series from the nest segments in the overall model to boundary conditions for the boundary segments in the nested modelaverage these boundary conditions in case of aggregated boundary segments in the nested modelgenerate a Delft3D-WAQ boundary conditions file for the nested modelNovember, 2006Introduction to Delft3D-NESTWQ Delft3D-NESTWQ Version 1.33User Manual 2.3Overview subsystemsFigure 2-1 Data flow diagram of Delft3D-NESTWQDelft3D-NESTWQ Getting started November, 2006 User Manual Version 1.33 3Getting started3.1Starting Delft3DTo start Delft3D:On an MS Windows platform: select Delft3D in the Applications menu or click on the Delft3D icon on the desktop.On Linux and UNIX machines: type delft3d-menu on the command line.Next the title window of Delft3D is displayed, Figure 3-1:Figure 3-1 Title window of Delft3DAfter a short while the main window of the Delft3D-MENU appears, Figure 3-2.November, 2006Getting started Delft3D-NESTWQ Version 1.33User ManualFigure 3-2 Main window Delft3D-MENUWhether or not you may use specific Delft3D modules and features depends on the licensefile you have. For now, only concentrate on exiting Delft3D-MENU, hence:Select Exit.The window will be closed and you are back in the Windows Desk Top screen for PCs or onthe command line for Linux and UNIX workstations.Remark:In this and the following chapters several windows are shown to illustrate the presentation of Delft3D-MENU and Delft3D-NESTWQ. These windows are grabbed from the PC-platform. For Linux and UNIX workstations the content of the windows is the same, butthe colours may be different. On the PC-platform you can set your preferred colours byusing the Display Properties.3.2Getting into Delft3D-NESTWQTo continue restart the menu program as indicated above. To access the nesting tool betweenan overall water quality model and a detailed water quality model, select the far-field waterquality module.Select Water Quality in the main window, see Figure 3-2..Next the selection window for Far-field water quality (all modules) is displayed, see Figure3-3.Delft3D-NESTWQ Getting started November, 2006 User Manual Version 1.33Figure 3-3 Selection window for Far-field water quality (all modules)The nesting functionality is exactly the same for all water quality modules, therefore:Select General.The selection window for Water quality (WAQ) is displayed (Figure 3-4), in which you canconvert and/or aggregate hydrodynamic results, prepare a substance file using the ProcessLibrary Configuration Tool, prepare a water quality input file, run the pre-processor, executea computation, inspect the report files with information on the execution, visualise the results,and access additional tools.November, 2006Getting started Delft3D-NESTWQ Version 1.33User ManualFigure 3-4 Selection window for Water Quality (general)Before continuing with any of the selections of this Water quality (WAQ)window, you mustselect the directory in which you are going to nest water quality results:Click the Select working directory button.Next the Select changing directory window, Figure 3-5, is displayed (your current directorymay differ, depending on the location of your Delft3D installation).Figure 3-5Select working directory windowBrowse to and enter the <Tutorial> sub-directory of your Delft3D Home-directory.Enter the <waq> directory. Next the <nestwq> sub-directory.Enter the <2d-2d> sub-directory and close the Select working directory window by clicking OK, see Figure 3-6.Delft3D-NESTWQ Getting started November, 2006 User Manual Version 1.33Figure 3-6Select working directory window to set the working directory to <waq\nestwq\2d-2d>Next the Water quality (WAQ) window is re-displayed, but now the changed currentworking directory is displayed in the title bar, see Figure 3-7.Figure 3-7 Current working directoryThe nesting tools are part of the Additional tools, hence:Click on Tools.The Additional tools window, Figure 3-8, contains the supporting programs for the varioussteps in the nesting of water quality models.Figure 3-8Selection window for Additional toolsNovember, 2006Getting started Delft3D-NESTWQ Version 1.33User Manual Click on Nest Input (1).The input file for NESTWQ1 is opened, see Figure 3-9.Figure 3-9Input file for NESTWQ1Select File – Exit, to close the input file.Select Return, to close the Additional tools window.Select Return, and Return once again, to enter the main window of Delft3D-MENU.Click Exit.The window is closed and the control is returned to the desk top or the command line.3.3Exploring some menu optionsTo guide you through some menu options please follow the example in Chapter 5, Tutorial.Delft3D-NESTWQ Input and output November, 2006 User Manual Version 1.33 4Input and outputNESTWQ1 and NESTWQ2 have each their own input file. The input files <nestwq1.inp>and <nestwq2.inp>, respectively, are free-formatted ASCII files.4.1Input NESTWQ1The input file <nestwq1.inp> contains the following information:<o>CHARACTER, the overall grid in X,Y co-ordinates at the depthlocations<com-ext1.lga>CHARACTER, the table with (in)active segment numbers of theoverall model<o>CHARACTER, the nested grid in X,Y co-ordinates at the depthlocations<com-ext2.lga>CHARACTER, the table with (in)active segment numbers of thenested model<nestwq1.dia>CHARACTER, diagnostics from NESTWQ1 and the required nestsegments in Delft3D-WAQ monitor format<nestwq1.adm>CHARACTER, per boundary segment the overall nest segments andweight factors required for the nesting procedure in NESTWQ2 The filenames between quotes are free to choose with a maximal length of 128 characters.Remarks:The required information about the vertical structure of the models is contained in the grid files. If the overall model is 2DH and the nested model is 3D, NESTWQ2 will generate auniform 3D profile for the nested model. If the overall model is 3D and the nested model is2DH, NESTWQ2 will generate depth-averaged boundary conditions for the nested model.If both models are 3D then the number of layers in each model must be equal.Example input file <nestwq1.inp>:'..\hkcrs.3d\o' ; X,Y co-ordinates overall model'..\hkcrs.3d\com-o3d.lga' ; grid table with active cells overall model'..\siulam.3d\o' ; X,Y co-ordinates nested model'..\siulam.3d\com-d3d.lga' ; grid table with active cells nested model'3d-3d.dia' ; diagnostics from NESTWQ1'3d-3d.adm' ; nest segments and weight factors overall modelNovember, 2006Input and output Delft3D-NESTWQ Version 1.33User Manual 4.2Output NESTWQ1The output files of NESTWQ1 are:<nestwq1.dia>the diagnostics from NESTWQ1 and the required nest segments inDelft3D-WAQ monitor format<nestwq1.adm>per boundary segment the overall nest segments and weight factorsrequired for the nesting procedure in NESTWQ2Remarks:It is not necessary to include the required nest segments in the simulation with the overall model as the nesting is performed with the results in the map file. The map file containsthe concentrations at every grid point, thus including the required nest segments.The administration file contains the required information about the vertical structure of each model.See Chapter 5 for an example of these files.4.3Input NESTWQ2The input file <nestwq2.inp> contains the following information:<nestwq1.adm>CHARACTER, the nest administration file with per boundarysegment the overall nest segments and weight factors required for thenesting procedure in NESTWQ2<d3d-waq.map>CHARACTER, the map file with results from the overall model<nosys>INTEGER, the number of active substances to be nested<nestwq2.dia>CHARACTER, diagnostics from NESTWQ2<ext.bcc>CHARACTER, the boundary conditions at the (aggregated)boundary segments of the nested modelThe filenames between quotes are free to choose with a maximal length of 128 characters.Remark:The first ‘nosys’ active substances will be transferred as boundary conditions for the nested model.Example input file <nestwq2.inp>:'..\nestwq1.v20\3d-3d.adm'; nest segments and weight factorsoverall model'o3d-waq.map' ; map file overall model4 ; number of active substances to nest'3d-3d.dia' ; diagnostics from NESTWQ2'3d3dwaq.bcc' ; boundary conditions for nested modelDelft3D-NESTWQ Input and output November, 2006 User Manual Version 1.334.4Output NESTWQ2The output files of NESTWQ2 are:<nestwq2.dia>the diagnostics from NESTWQ2<ext.bcc>the boundary conditions at the (aggregated) boundary segments ofthe nested modelSee Chapter 5 for an example of the diagnostics file.November, 2006Input and output Delft3D-NESTWQ Version 1.33User Manual blank pageDelft3D-NESTWQ Tutorial November, 2006 User Manual Version 1.33 5T utorialAt this moment no graphical user interface is available to perform the nesting of water qualitymodels. In order to perform the nesting, correctly, the following steps are required:Edit/Create <nestwq1.inp> file for NESTWQ1Y ou have to specify the names of the <*.lga> and <*.cco> files of the overall and detailedmodel. Specify the administration file. On forehand the hydrodynamics of both the overall andnested model must be converted to formats required for Delft3D-WAQ (Couple menu, seeDelft3D-WAQ User Manusl).Create administration file (execute NESTWQ1)Within this step a diagnostic file and an administration file is created which is required inputfor the second step of the of the nesting (NESTWQ2).Edit/Create <nestwq2.inp> file for NESTWQ2Y ou must specify the name of the administration file (created by step 2), the name of thewater quality map file of the overall model , the number of active substances to nest and thename of the binary boundary output file for the detailed model.Create boundary conditions (execute NESTWQ2)Within this step a diagnostic file and a boundary file is created which is required input forrunning the water quality detailed model.Examine diagnostic files of NESTWQ1 and NESTWQ2After executing NESTWQ1 and/or NESTWQ2 you can inspect the if the modules have runcorrectly.Edit nested WAQ input fileIn this step you must add the created boundary filename (step 4) by editing block 4 of thewater quality input file:goto block #4change‘1 : information in this file’ to‘-2 : information in binary file’write on a new record the name of boundary file between quotesdelete all other information in the following records in block #4 (until block #5)November, 2006Tutorial Delft3D-NESTWQ Version 1.33User Manual In order to demonstrate the use of Delft3D-NESTWQ the following tutorial can be applied:Available data files:<com-d2d.dat> : communication file detailed 2D model (Siu-Lam)<com-d2d.def> : definition file detailed 2D model<com-o2d.dat> : communication file overall 2D model (Upgrade 2x2)<com-o2d.def> : definition file overall 2D model<tracer.sub>: substance file with CTR11 Start Delft3D-MENU.2 Select Water Quality from the main menu.3 Select General from the Far-field water quality (all modules) selection window.4 Select Coupling and start COUP-GUI by selecting Define input.5 Open i n COUP-GUI Data Group Hydrodynamics and open <com-02d.dat>.6 Save the input as <com-o2d.hyd>.7 Select File – Exit to leave COUP-GUI.8 Select Start to execute the coupling. A window opens with messages from the coupling.Close this window when the coupling is finished.9 Go back by selecting Return in the Hydrodynamic coupling window.10 Select Define input to start the WAQ-GUI.11 Activate in WAQ-GUI Data Group Hydrodynamics and select <com-02d.hyd> file.12 Set dispersion to 10 m2/s in x and y direction.13 Activate Data Group Substances and select file <tracer.sub>.14 Set Time Frame to 1-1-2000 - 3-1-2000 , timestep 3 minutes15 Select Numerical option 5 in Data Group Numerical options16 Add two discharges at (32,28) and (44,28) and assign a load of 1000 g/s of CTR1 toboth discharges (Data Group Discharges) by button Edit data17 Select Output Option Data Group and set output timers for the map file to1-1-2000 (start) ; 3-1-2000 (stop) ; 1 hour time step18 Save scenario as <*.scn> file (e.g. <testo.scn>)19 Exit the WAQ-GUI20 Select Waq (1); in selection window select scenario file, e.g. <testo.scn>.21 Check report files on errors.22 Select Waq (2) to start the calculation.23 Visualise the results with Delft3D-GPP.Repeat the above steps for the detailed model (<com-d2d.dat>) without step 16 and save theresults in e.g. <testd.scn> (no discharges added).24 Select Tools in the Water quality (WAQ) menu. The following menu will appear:1.Edit or create input file for NESTWQ1You have to specify the names of the <*.lga> and <*.cco> files of the overall anddetailed model conform the documentation (e.g. <com-o2d>, <com-d2d>). Specifyadministration file (e.g. <2d-2d.adm>).Delft3D-NESTWQ Tutorial November, 2006 User Manual Version 1.332.Start NESTWQ1Within this step a diagnostic file and an administration file is created which isrequired input for the second step of the of the nesting (NESTWQ2)3.Edit or create input file for NESTW2You must specify the name of the administration file (created by step 2), the nameof the water quality map file of the overall model (e.g<testo.map>), the numberof active substances to nest and the name of the binary boundary output file forthe detailed model (e.g. <2d-2d.bcc>).4.Start NESTWQ2Within this step a diagnostic file and an boundary file is created which is requiredinput for running the water quality detailed model.5.Examine diagnostic files of NESTWQ1 and NESTWQ26.Edit nested WAQ input fileIn this step you must add the created boundary file name (step 4) by editing block4 of the water quality input file (e.g. <testd.inp>):- goto block #4- change‘1 : information in this file’ to‘-2 : information in binary file’- write on a new record the boundary filename between quotes e.g.‘2d-2d.bcc ’- delete all other information in the following records in block #4 (until block #5)25 Return to Water quality (WAQ)menu and select Waq(1).and select the adapted <testd.inp> file.26 Run the detailed model and evaluate the results.5.2IntroductionThe Upgraded WAHMO Model is a fine-grid numerical model for the Hong Kong waters. Itis based on the shallow water equations in curvilinear co-ordinates. The spatial resolution istypical 300-1500 m. The model was developed in view of the need for a detailed and accuratetidal and water quality model that could be used for accurate computations. A further interestwas provided by transport and water quality simulations on seasonal and annual scales. Forthis purpose the fine-grid water quality model was aggregated.The SIU LAM model is a fine-grid numerical model for the waters north of Lantau Island. Ituses a curvilinear fine grid. The hydrodynamic model was developed to investigate the effectsof various layouts for a proposed typhoon shelter at Siu Lam.As an example to demonstrate the nesting of water quality models a water quality modelbased upon the hydrodynamic SIU LAM model was set up.For the generation of water quality boundary conditions for the WQ SIU LAM model, themodel is nested in a coarse version of the WQ UPGRADE WAHMO model.Figure 5-1 shows the coarse grid UPGRADE WAHMO together with the fine grid SIU LAM.The locations of the boundary segments of the SIU LAM model are presented in Figure 5-2.November, 2006Tutorial Delft3D-NESTWQ Version 1.33User ManualFigure 5-1 Upgrade and Siu Lam modelsFigure 5-2 Siu Lam model with 2 open boundaries (east and west)In the following application grid cells have not been aggregated in both models. Both 3Dmodels have 5 layers.Delft3D-NESTWQ Tutorial November, 2006 User Manual Version 1.335.3Input and output NESTWQ1Input file <nestwq1.inp>:'o' ; X,Y co-ordinates overall model'com-o3d.lga' ; grid table with active cells overall model'o' ; X,Y co-ordinates nested model'com-d3d.lga' ; grid table with active cells nested model'3d-3d.dia1' ; diagnostics from NESTWQ1'3d-3d.adm' ; nest segments and weight factors overall modelDiagnostics file <3d-3d.dia>:WL | Delft Hydraulics, Delft3D-NESTWQ1, Version 2.01.00, Aug 31 2006>> Input from nestwq1.inpX,Y co-ordinates overall model : oGrid table with active cells overall model : com-o3d.lgaX,Y co-ordinates nested model : oGrid table with active cells nested model : com-d3d.lgaDiagnostics and required nest segments : 3d-3d.dia1Nest segments and weight factors overall model : 3d-3d.adm*** WARNING *** negative 3rd weight for -9 1*** WARNING *** negative 4th weight for -9 1*** WARNING *** negative 3rd weight for -10 1*** WARNING *** negative 4th weight for -10 1*** WARNING *** negative 3rd weight for -53 1*** WARNING *** negative 4th weight for -53 1>> List of required nest segments in DELWAQ monitor formatNumber of required nest segments : 511719 'Nest segment 1719 ' 1720 'Nest segment 1720 ' 1782 'Nest segment 1782 '1781 'Nest segment 1781 ' 1780 'Nest segment 1780 ' 1718 'Nest segment 1718 '2897 'Nest segment 2897 ' 2959 'Nest segment 2959 ' 1779 'Nest segment 1779 '1717 'Nest segment 1717 ' 2958 'Nest segment 2958 ' 2896 'Nest segment 2896 '1778 'Nest segment 1778 ' 1716 'Nest segment 1716 ' 2957 'Nest segment 2957 '2895 'Nest segment 2895 ' 1654 'Nest segment 1654 ' 1655 'Nest segment 1655 '1715 'Nest segment 1715 ' 1653 'Nest segment 1653 ' 1714 'Nest segment 1714 '。

Delft3D-Installation_Manual

Delft3D-Installation_Manual

4.10 Restarting vendor daemons on a license Server ...................................... 4–10
5
Installing Delft3D on Windows ........................................................................... 5–1
4.8.2 Registry keys................................................................................ 4–9
4.9 Running a license server with license files for Delft3D version 3.23.04 or lower generates errors ........................................................................... 4–9
2.2 General definitions.....................................................................................2–1
2.3 Overall structure for Delft3D.....................................................................2–2
1.3 Typographical conventions ........................................................................1–2

matlab命令大全92673

matlab命令大全92673

一、常常利用对象操作:除一般windows窗口的常常利用功能键外。

1、!dir 可以查看当前工作目录的文件。

!dir& 可以在dos状态下查看。

2、who 可以查看当前工作空间变量名,whos 可以查看变量名细节。

3、功能键:功能键快捷键说明方向上键 Ctrl+P 返回前一行输入方向下键 Ctrl+N 返回下一行输入方向左键 Ctrl+B 光标向后移一个字符方向右键 Ctrl+F 光标向前移一个字符Ctrl+方向右键 Ctrl+R 光标向右移一个字符Ctrl+方向左键 Ctrl+L 光标向左移一个字符home Ctrl+A 光标移到行首End Ctrl+E 光标移到行尾Esc Ctrl+U 清除一行Del Ctrl+D 清除光标所在的字符Backspace Ctrl+H 删除光标前一个字符Ctrl+K 删除到行尾Ctrl+C 中断正在执行的命令4、clc可以命令窗口显示的内容,但并不清除工作空间。

二、函数及运算+:加,-:减, *:乘, /:除,\:左除 ^:幂,‘:复数的共轭转置,():制定运算顺序。

2、常用函数表:sin( ) 正弦(变量为弧度)Cot( ) 余切(变量为弧度)sind( ) 正弦(变量为度数)Cotd( ) 余切(变量为度数)asin( ) 反正弦(返回弧度)acot( ) 反余切(返回弧度)Asind( ) 反正弦(返回度数)acotd( ) 反余切(返回度数)cos( ) 余弦(变量为弧度)exp( ) 指数cosd( ) 余弦(变量为度数)log( ) 对数acos( ) 余正弦(返回弧度)log10( ) 以10为底对数acosd( ) 余正弦(返回度数)sqrt( ) 开方tan( ) 正切(变量为弧度)realsqrt( ) 返回非负根tand( ) 正切(变量为度数)abs( ) 取绝对值atan( ) 反正切(返回弧度)angle( ) 返回复数的相位角atand( ) 反正切(返回度数)mod(x,y) 返回x/y的余数sum( ) 向量元素求和3、其余函数可以用help elfun和help specfun命令获得。

matlab教程(完整版)-matlab教程

matlab教程(完整版)-matlab教程
MATLAB 语言及其应用
授课教师:刘晨晨 单位:网络工程与信息安全系 email: lcczzm@ Application of Matlab Language
课程的作用 课程的目的 课程的特点 课程安排
2019/12/23
Application of Matlab Language
Jack Little
2019/12/23
Application of Matlab Language
10
• 在公司初创的五年,Jack Little非常辛苦,常常身兼数职(董事长、总经理、推销、 程序开发等),但公司一直稳定发展,从当初的一人公司,到1993年的200人,到2000年的 500余人,到2005年公司员工达到了1300人,不但打败其他竞争软件,而且前景一片欣欣向 荣。根据Jack Little个人说法,MATLAB早期成功的两大因素是:选用了C语言及选定PC为 主要平台,这似乎和微软的成功有相互呼应之妙。
MATLAB软件功能之强大、应用之广泛,已成为为21世纪最为重要的科学计算 语言。可见学习掌握这一工具的重要性。
2019/12/23
Application of Matlab Language
13
1.2 MATLAB产品的体系结构
围绕着MATLAB这个计算核心,形成了诸多针对不同 习使M实用A际MMTA上LATATMLBLAA产ABTBS间 的呢品LimA或核?由uB围 称 专 Bl离心这若本ilnoM序 的 器 运用绕 为k散。c就干身M核 数是Ak文编标 行模着 模s时AT有模就心 据e窗件译准 效块块StLT间、必块是i与 可Am口L编生的率集集AB的S要组一u基视图i译成C。lB,(mCi动n成了个/础化是形oP生函k如BCm态o仿,解极,于M应(用的位而领l+方ow成数Cp系c+真A不这其ei是一开用工且域详To式kl标库r文eTmosS统核同一丰r集体e发领具新,见的Loy这m准或t件slA建s心的软富bt高的提域箱的可Mu)、种e的可Bo可nm模所模件的Ax性高产供的大工以i,专编cM执C)以TB、a开块产资/能效品的算概具首门tAL译l行,i被Coo分A发T完品源数编家工法有箱先c+用n器文这B任Lk析+的成的库Bs值程族具A程还到在4于可e件些何语0lB和to应不体,多计语的箱序在网线、连以c产,工一言k仿用同系那个算言计,包不上帮S续s将品以具种文ie真g程的结么t,与。算这,断查助时nM、提提箱C件a序功构应另些被增找文A/lD供高的,CT包能该外工称加是档S。+许程L列而P,,从+A还具为。否。多序表生编B其哪有箱专如已M程的以成译中一A其的用 果 有及T有部他总工 你 相L每A:分公数具 有 关个B开司已箱 特 的本工始或有别 工身具着研1的 具所箱0手0究应 箱提的多、单用 ,供使个学,

Delft3D-Functional_Specifications

Delft3D-Functional_Specifications

Delft3D Functional Specifications Version:2.20Revision:1547418May2011Functional Specifications Delft3DPublished and printed by:DeltaresRotterdamseweg185p.o.box1772600MH DelftThe Netherlandstelephone:+31883358273fax:+31883358582e-mail:info@deltares.nlwww:http://www.deltares.nlFor support contact:telephone:+31883358555fax:+31883358111e-mail:delft3d.support@deltares.nlwww:The screen pictures shown in this manual were produced during the development stages and may differ from the actual productCopyright©2011DeltaresAll rights reserved.No part of this document may be reproduced in any form by print, photo print,photo copy,microfilm or any other means,without written permission from the publisher:Deltares.Delft3DFunctional Specifications Contents May20112.20.15474Contents1Introduction11.1Areas of application (1)1.2Delft3D framework overview (2)1.3Utilities (2)2Hydrodynamic module52.1Module description (5)2.2Applications areas (6)2.3Coupling with other modules (7)3Water quality module93.1General introduction (9)3.2Module description (10)3.3Application areas (12)3.4Coupling with other modules (13)4Sediment transport module154.1Module description (15)4.1.1Cohesive sediment (15)4.1.2Non-cohesive sediment (16)4.1.3Limitations (16)4.2Application areas (16)4.3Coupling with other modules (17)5Ecological module195.1Module description (19)5.2Applications (20)5.3Coupling with other modules (21)Deltares iiiMay2011 2.20.15474Contents Delft3DFunctional Specifications6Particle tracking module236.1Module description (23)6.2Application areas (25)7Wave module277.1Module description (27)7.2Application areas (28)7.3Coupling with other modules (28)8Morphodynamic module298.1Module description (29)8.2Numerical aspects (30)8.3Application areas (31)9Pre-processing and post-processing339.1Visualisation (33)9.1.1GPP (33)9.1.2QUICKPLOT (34)9.2Grid generation (34)9.3Grid data manipulation (35)9.4Grid aggregation (36)9.5Tidal analysis and comparison with observations (37)9.6Tidal analysis and prediction (37)9.7Nesting of Delft3D-FLOW models (38)9.8Nesting of Delft3D-WAQ models (38)9.9Interfaces with other programs (39)9.9.1Interface to GIS (39)9.9.2Interface to Matlab (39)10Hardware configuration41 References43iv DeltaresDelft3DFunctional Specifications Introduction May20112.20.15474Chapter1IntroductionDeltares has developed a unique,fully integrated modelling framework for a multi-disciplinary approach and3D computations for coastal,river,lake and estuarine areas.It can carry out numerical modelling offlows,sediment transport,waves,water quality,morphological developments and ecology.It has been designed for experts and non-experts alike.The Delft3D framework is composed of several modules,grouped around a mutual interface,while being capable to interact with one another.Delft3D can switch between the2D vertically averaged and3D mode simply by changing the number of layers.This feature enables to set up and investigate the model behaviour in2D mode before going into full3D simulations.1.1Areas of applicationDelft3D can be applied,but is not limited,to the following areas of applications:flows due to tide,wind,density gradients and wave induced currents;propagation of directionally spreaded short waves over uneven bathymetries,including wave-current interaction;advection and dispersion of effluents;online morphodynamic computations(local scour,short time and length scales);sediment transport of cohesive and non-cohesive sediment;water quality phenomena including ecological modelling,the prediction of heavy metal concentrations,interaction with organic and inorganic suspended sediment,interaction between the water and bottom phase(such as sediment oxygen demand),algae blooms;particle tracking,including oil spill and dredging plume modelling;initial and/or dynamic(time varying)2D-morphological changes,including the effects of waves on sediment stirring and bed-load transport.Deltares1May2011 2.20.15474Introduction Delft3DFunctional Specifications1.2Delft3D framework overviewDelft3D is composed of a number of modules(see Figure1.1),each addressing a specific domain of interest,such asflow,near-field and far-field water quality,wave generation and propagation,morphology and sediment transport,together with pre-processing and post-processing modules.All modules are dynamically interfaced to exchange data and results where process formulations require.In the following chapters these modules are described in more detail.Figure1.1:System architecture of Delft3DAll features are embedded in Graphical User Interface suitable for Linux or the MS Windows (WindowsXP and Vista).An application(model)can be completely defined,inspected and analysed through a menu-driven,user-friendly,graphical interface.The basic processes covered by each of the modules are:Delft3D-FLOW and3DMOR2D and3D hydrodynamic,salinity,temperature,transport and online sediment transport and morphologyDelft3D-WAVEshort wave propagation(using SWAN)Delft3D-WAQgeneral water qualityDelft3D-SEDcohesive and non-cohesive sediment transportDelft3D-ECOcomplex eutrophication and ecological modellingDelft3D-PARTparticle tracking,oil spill modelling1.3UtilitiesThe following utility programs are available for pre-processing and post-processing:Delft3D-RGFGRID:for generating orthogonal curvilinear grids,in Cartesian or spherical co-ordinates2DeltaresDelft3DFunctional Specifications Introduction May20112.20.15474Delft3D-QUICKIN:for preparing and manipulating grid oriented data,such as bathymetry, initial conditions for water levels,salinity,constituents and other parametersDelft3D-TRIANA:for performing off-line tidal analysis of time-series generated by Delft3D-FLOWDelft3D-TIDE:for performing tidal analysis on time series of measured water levels or velocitiesDelft3D-GPP:for visualisation and animation of simulation resultsDelft3D-QUICKPLOT:for visualisation and animation of simulation resultsDelft3D-GISVIEW:ArcGIS extension to export GIS-coverages to Delft3D format and to read,visualise and process results from Delft3D(ArcGIS is not included)Delft3D-MATLAB:user interface and Matlab functions to read Delft3Dfiles and to visualise or process results in Matlab environment(Matlab is not included)Delft3D-DIDO:interactive grid aggregation editor for coupling FLOW with WAQ models For more information please contact:e-mail:@deltares.nlwww:www.deltares.nlDeltares3May2011 2.20.15474Introduction Delft3DFunctional Specifications4DeltaresDelft3DFunctional Specifications Hydrodynamic module May20112.20.15474Chapter2Hydrodynamic moduleThe hydrodynamic module,Delft3D-FLOW,is a multi-dimensional hydrodynamic simula-tion program that calculates non-steadyflow and transport phenomena resulting from tidal and meteorological forcing on a curvilinear,boundary-fitted grid.In3D simulations,the hydrodynamic module applies the so-called sigma co-ordinate transformation in the verti-cal,which results in a smooth representation of the bottom topography.It also results in a high computing efficiency because of the constant number of vertical layers over the whole computational domain.2.1Module descriptionThe hydrodynamic module is based on the full Navier-Stokes equations with the shallow water approximation applied.The equations are solved with a highly accurate unconditionally stable solution procedure.The supported features are:two co-ordinate systems,i.e.Cartesian and spherical,in the horizontal directions two grid systems in the vertical direction;the boundaryfitted sigma grid and the horizontal layer Z-griddomain decomposition both in the horizontal and vertical directiontide generating forces(only in combination with spherical grids);simulation of drying andflooding of inter-tidalflats(moving boundaries);density gradients due to a non-uniform temperature and salinity concentration distri-bution(density drivenflows);for2D horizontal large eddy simulations the horizontal exchange coefficients due to circulations on a sub-grid scale(Smagorinsky concept);turbulence model to account for the vertical turbulent viscosity and diffusivity based on the eddy viscosity concept;selection from four turbulence closure models:k-ε,k-L,algebraic and constant coeffi-cient;Deltares5May2011 2.20.15474Hydrodynamic module Delft3DFunctional Specificationsshear stresses exerted by the turbulentflow on the bottom based on a Ch´e zy,Manning or White-Colebrook formulation;enhancement of the bottom stresses due to waves;automatic conversion of the2D bottom-stress coefficient into a3D coefficient;wind stresses on the water surface modelled by a quadratic friction law;space varying wind and barometric pressure(specified on theflow grid or on a coarser meteo grid),including the hydrostatic pressure correction at open boundaries(op-tional);simulation of the thermal discharge,effluent discharge and the intake of cooling water at any location and any depth in the computationalfield(advection-diffusion module);the effect of the heatflux through the free surface;online analysis of model parameters in terms of Fourier amplitudes and phases enabling the generation of co-tidal maps;drogue tracks;advection-diffusion of substances with afirst order decay rate;online simulation of the transport of sediment(silt or sand)including formulations for erosion and deposition and feedback to theflow by the baroclinic pressure term,the turbulence closure model and the bed changes;the influence of spiral motion in theflow(i.e.in river bends).This phenomenon is especially important when sedimentation and erosion studies are performed;modelling of obstacles like2D spillways,weirs,3D gates,porous plates andfloating structures;wave-current interaction,taking into account the distribution over the vertical;many options for boundary conditions,such as water level,velocity,discharge and weakly reflective conditions;several options to define boundary conditions,such as time series,harmonic and astro-nomical constituents;option for linear decay of conservative substancesonline visualisation of model parameters enabling the production of animations.2.2Applications areasDelft3D-FLOW can be applied to the following application areas:salt intrusion in estuaries;fresh water river discharges in bays;thermal stratification in lakes and seas;6DeltaresDelft3DFunctional Specifications Hydrodynamic module May20112.20.15474cooling water intakes and waste water outlets;sediment transport including feedback on theflow;transport of dissolved material and pollutants;short-term sediment transport including feedback on theflow;storm surges,combined effect of tide and wind/typhoon;riverflows,meandering and braided rivers;floodplains,with or without vegetation;reservoir siltation and degradation below dams;bottom vanes,spurs,groynes,bridges,weirs and levees.2.3Coupling with other modulesThe results of the hydrodynamic module are used in all other modules of Delft3D.The results are dynamically exchanged between the modules through the use of a so-called com-municationfile.Basic(conservative)water quality parameters like concentrations of dissolved material and pollutants,can be included in the computations.But,for more dedicated water quality simulations,the hydrodynamic module is coupled with the far-field water quality mod-ule(Delft3D-WAQ),the nutrient phytoplankton module(Delft3D-ECO)and the near-field particle tracking module(Delft3D-PART).A coupling with the sediment transport module (Delft3D-SED)is available to simulate cohesive and non-cohesive sediment transport pro-cesses,e.g.in the case of erosion and sedimentation studies.For wave-current interaction a dynamic coupling is provided with the wave module(Delft3D-WAVE)and for morpho-dynamic simulations the hydrodynamic module is integrated with the wave module and a sedimentation and erosion module into a morphodynamic module(Delft3D-3DMOR).To simulate a model defined on a curvilinear grid system,an orthogonal grid must be provided. To generate such a grid the program Delft3D-RGFGRID is provided,though the grid can be generated by any grid generator program as long as the grid is delivered in the prescribed (ASCII)file format.The generation of a curvilinear grid is an important and somewhat complex task.Along with the main model parameters,the grid will ultimately determine the accuracy of thefinal model results.To prepare the bottom topography or other grid-related data,such as a non-constant initial conditionfile,the program Delft3D-QUICKIN is provided.This program interpolates the scattered,digitised chart data to depth-values at the grid points in the model.Many powerful interactive processing options to further adjust the topography are supported,e.g.manual adjustment of the values at individual points,selection of the domain of influence,group adjustments,and smoothing.The output of this program(ASCII-file)can be imported into other Delft3D modules.Analysis and interpretation of a hydrodynamic simulation in terms of tidal quantities can be performed by the program Delft3D-TRIANA.Delft3D-TRIANA performs off-line tidal analyses of time-series of either water levels and/or velocities.The results from these analyses can be subsequently compared with observation data supplied by you.May2011 2.20.15474Hydrodynamic module Delft3DFunctional SpecificationsIn case the open boundaries of a(detailed)Delft3D-FLOW model are located within the model domain of a coarser Delft3D-FLOW model,the coarse model can generate the bound-ary conditions of the detailed,nested model.The offline generation of boundary conditions is done by Delft3D-NESTHD.Delft3DFunctional Specifications Water quality module May20112.20.15474Chapter3Water quality module3.1General introductionThe transport of substances in surface and ground water is commonly represented by the so-called advection-diffusion equation.The water quality module,Delft3D-WAQ,is based on this equation and it offers different computational methods to solve it numerically on an arbitrary irregular shaped grid,on a grid of rectangles,triangles or curvilinear computational elements.Delft3D-WAQ can be applied just as easily on0D,1DV,1DH,2DV,2DH and3D schematisations of a water body.Delft3D-WAQ includes the complete natural cycles of C, N,P,Si and O2,as well as cohesive sediments,bacteria,salinity,temperature,heavy metals and organic micro-pollutants(see Figure3.1).To proceed one step in time(t+∆t),Delft3D-WAQ solves equation3.1(a simplified rep-resentation of the advection-diffusion-reaction equation)for each computational cell and for each state variable.M t+∆ti =M t i+∆t×∆M∆tT r+∆t×∆M∆tP+∆t×∆M∆tS(3.1)The mass balance has the following components:1.the mass at the beginning of a time step:M t i2.the mass at the end of a time step:M t+∆ti3.changes by advective and dispersive transport: ∆M∆tT r4.changes by physical,(bio)chemical or biological processes: ∆M∆tP5.changes by sources(e.g.waste loads,river discharges): ∆M∆tSThe basic principles of Delft3D-WAQ are the same whether you have one state variable and only two computational cells,or you have several tens of state variables and thousands of computational cells.The only difference is the number of times that Delft3D-WAQ has to solve equation3.1.Delft3D-WAQ is capable of describing any combination of constituents and is not limited with respect to the number and complexity of the water quality processes. Water quality processes are described by linear or non-linear functions of selected state vari-ables and model parameters.Many process formulations are available in the form of a library,May2011 2.20.15474Water quality module Delft3DFunctional SpecificationsSediment OxygenDemandFigure3.1:General overview of substances included in Delft3D-WAQ.Substances areorganised in functional groups indicated by a grey header,except for some substancesthat form a group of their own.Major processes between substances are indicated byarrows;note that many links are omittedwhich smoothly interfaces with the water quality module.The library contains over50water quality process routines covering140standard substances.A graphical user interface within the WAQ module enables you to select any combination of substances and associated water quality processes.Also,for less experienced users pre-defined sets are available to jump-start the water quality modelling.3.2Module descriptionDelft3D-WAQ simulates a physical system that consists of a surface or ground water body. Strictly speaking,it models a body of a medium that is able to transport passive constituents. In this respect,”passive”means that the influence of the concentration of the constituents on the transport coefficients may be neglected.The transporting medium is characterised by its spatial and time dependent content(mass)of the modelled constituents.Some are transportable;some are non-transportable.An example of the latter is the bottom sediment in a surface water model.The concentration of the transportable constituents is computed by dividing the mass by the water volume.The mass is the state variable and the model is mass conserving by definition.Waste disposals are specified either as mass units per time unit or as a combination of waste flow and concentration.They represent either point sources(urban,industrial,rivers)or diffuse sources(run-off,atmospheric deposition).The case of recirculatingflows,as with cooling water studies,is also taken care of:the water that was let in,will have the sameDelft3DFunctional Specifications Water quality module May20112.20.15474quality at the outlet.The hydrodynamic characteristics of the transporting medium are expressed in terms of the volume and theflux of the transporting medium(”flow”).The combination of water vol-umes andflows must be consistent,i.e.an increase of the water volume must be balanced by a difference between inflow and outflow.Delft3D-WAQ repeats hydrodynamic charac-teristics to extend to simulation times beyond the available hydrodynamic simulation time. Also,Delft3D-WAQ can combine several hydrodynamic simulations into a single water qual-ity simulation.For example,a representative neap tide and a representative spring tide hydrodynamic simulation can be combined to create a complete spring-neap cycle.As part of Delft3D,the coupling module can derive a set of consistent hydrodynamicflows automatically from Delft3D-FLOW,but the methods involved can be applied equally well to third-party hydrodynamic models outside Delft3D.In many cases,the water quality processes in the model are determined by meteorological conditions,by other(modelled or non-modelled)constituents or by other(modelled or non-modelled)processes.Examples are wind,water temperature,acidity(pH),primary produc-tion and the benthic release of nutrients.These entities are referred to as”forcing functions”. Water quality process formulations are often of an empirical or semi-empirical nature and contain”model parameters”which are subject to tuning or calibration.Because of this, Delft3D-WAQ allows complete freedom in selecting the set of water quality processes and the relevant forcing functions and model parameters may vary between individual applica-tions.It therefore providesflexible input facilities for constants,spatially varying parameters, functions of time and functions of space and time.The physical system is affected by two types of processes:transport processes:these processes involve the movement of substances;water quality processes:these processes involve a transformation of one or more substances.The transport of substances in surface and ground water is commonly represented by the so-called advection diffusion equation.Advection is determined by the velocityfield and dispersion by the dispersion coefficient.These basic transport processes operate on all trans-portable substances in the same way.Delft3D-WAQ offers the possibility to model other transport phenomena as well which may differ between individual substances.Examples are the gravity induced settling of particles and the autonomous motion offish.These additional transport processes must be expressed as an extra,substance dependant velocity or dispersion coefficient.Water quality processes are incorporated in the advection diffusion equation by adding an additional source in the mass balance(equation3.1).Examples of water quality processes are:exchange of substances with the atmosphere(oxygen,volatile organic substances,tem-perature);adsorption and desorption of toxicants and ortho-phosphorous;deposition of particles and adsorbed substances to the bed;re-suspension of particles and adsorbed substances from the bed;May2011 2.20.15474Water quality module Delft3DFunctional Specificationsmortality of bacteria;biochemical reactions like the decay of BOD and nitrification;growth of algae(primary production);predation(e.g.zooplankton on phytoplankton).Special attention is paid to the treatment of the interaction with the bottom: all suspended sediment is modelled as cohesive sediment that can be transported with the waterflow just like a dissolved substance;all particulate inorganic matter can be represented by three size fractions or compo-nents;all particulate organic matter is represented by separate components,namely detritus carbon,other organic carbon,diatoms,non-diatom algae(Green),adsorbed phosphorus and organic carbon from loads;the bottom sediment is modelled via two separate layers.Each layer is considered homogeneous(well mixed).The different layers can have different compositions.The density of a layer is variable depending on the sediment layer composition,which is also variable.The porosity within a given layer is constant(user-defined).a third(deeper)layer exists(but is not explicitly modelled)which can supply sedimentfor upward sediment transport’digging’;sedimentation and resuspension are modelled using the Krone-Partheniades approach (see the description of the sediment transport module Delft3D-SED).3.3Application areasDelft3D-WAQ can be applied to the following areas:Environmental Impact Assessment(EIA),objective evaluation of alternativesWater balance studies,including the identification of the origin of water,residence times andflushing capabilitiesSwimming water quality,bacterial decay processes;Sewage and/or storm water outfall studies;Nutrient cycling and eutrophication;Sedimentation and resuspension of particulates,dredging plumes;Sediment-water interaction(including diffusive and benthic mixing);Bio-availability of heavy metals(and organic micro-pollutants;Recirculation of cooling water from power and desalination plants including the release of bio-fouling chemicals such as chlorineDelft3DFunctional Specifications Water quality module May20112.20.15474The processes always require input in the form of rate constants and/or simulation results from other substances.The input could come from:one of the other modelled substances;a user-specified spatially distributed time function;a user-specified time function for the whole area;a user-specified spatially distributed constant;a user-specified constant for the whole area;a processflux originating from one of the water quality processes from the library;output from one of the other processes in the library;a default value from the database containing default values.The pre-processor will report the origin of the input for each process.If information for a process is missing,so that the process cannot be evaluated,it will detail what information is actually required in addition.Results can be presented as spatial patterns or time-series.Statistical processing can be carried out during the simulation for minimum,average and maximum values,percentiles, percentage of exceedance,geometric mean,etc.These values can be calculated for pre-selected periods,so that it is possible to calculate for example winter and summer averages. As a special type of output,mass balances can be generated.These can be used to analyse the fate of substances(e.g.nutrients or heavy metals)or to quantify the contribution of waste loads or certain processes to the ambient concentration of a substance.3.4Coupling with other modulesHydrodynamic conditions can be prescribed by Delft3D-FLOW,SOBEK(Deltares1D soft-ware and SIMONA(2D/3D hydrodynamic model).Transfer of results goes via a so-called communicationfile.Thisfile usually spans a representative period such as a tidal cycle,a spring-neap cycle or even a full year.Delft3D-WAQ is able to calculate beyond the period by repeating the hydrodynamic cycle.Also,Delft3D-WAQ is able to make use of multiple hydrodynamicfiles by either combining them simultaneously or successively.For example,a representative low river discharge hydrodynamicfile and a high river discharge hydrodynamic file may be combined to simulate all river discharges in between.The grid aggregation tool Delft3D-DIDO can be used tofit the grid resolution to the specific needs of the application.Delft3D-DIDO allows regular and irregular aggregation(in the horizontal)and will reduce the number of computational elements and therefore computation time.Delft3D-DIDO is frequently used to reduce the grid resolution in areas far away from the area of interest,while keeping the area of interest at the highest possible resolution. Delft3D-QUICKIN can be used to generate space-varying initial conditions or space-varying process parameters(e.g.wind speed).May2011 2.20.15474Water quality module Delft3DFunctional SpecificationsDelft3DFunctional Specifications Sediment transport module May20112.20.15474Chapter4Sediment transport moduleThe sediment transport module,Delft3D-SED,can be applied to model the transport of cohesive and non-cohesive sediments,i.e.to study the spreading of dredged materials,to study sedimentation/erosion patterns,to carry out water quality and ecology studies where sediment is the dominant factor.It is in fact a sub-module of the water quality module,that is all processes contained in the sediment transport module are also present in the water quality module.For a detailed description of the general aspects we refer to the description of the water quality module. 4.1Module description4.1.1Cohesive sedimentThis section describes the implementation of the physical processes in some detail.For cohesive sediment transport sedimentation,erosion,burial and digging are taken into account. For sedimentation the following assumptions apply:sedimentation takes place when the bottom shear stress drops below a critical value;there is no correlation between the sediment components(i.e.each of the particulate fractions can settle independently);sedimentation always results in an increase of sediment in the uppermost sediment layer;the total shear stress is the linear sum of the shear stresses caused by water velocity and wind effects.Effects of shipping andfisheries can also be included.The effects of’hindered settling’(i.e.decrease in sedimentation velocity at very high sus-pended solids concentration)can be included.For resuspension the assumptions are:the bottom sediments are homogenous within a layer.Therefore,the composition of the resuspending sediment is the same as that of the bottom sediment;。

matlab-三维曲面的自动绘制

matlab-三维曲面的自动绘制

matlab-三维曲面的自动绘制一、设计目的Matlab 有两类绘图命令,一类是直接对图形句柄进行操作的低层绘图命令,另一类是在低层命令基础上建立起来的高层绘图命令。

高层绘图命令简单明了、方便高效。

利用高层绘图函数,用户不需过多考虑绘图细节,只需给出一些基本参数就能得到所需图形。

在三维曲面的绘制中,Matlab提供了meshgrid 函数、mesh waterfall、函数、surf函数、Surfl函数和patch函数。

他们的使用方法基本相同。

在Matlab中,为了表现图形的显示效果,提供了一些控制函数,有视角的控制、光度的控制、色彩的控制和透明度的控制等。

在三维图形的最佳视觉效果中,Matlab提供了两种方法:一是改变观看的角度(视角),二是旋转图形。

视角由函数view控制,旋转有两个指令:rotate和rotate3d。

光照的控制主要有camlight指令、lighting 指令、material函数、light函数、lightangle函数。

色彩控制包括颜色的向量表示、色图、三维表面图形的着色以及浓淡处理。

图形的透明值用0和1之间的值表示,常用alpha来说明。

二、设计思路绘制所代表的三维曲面图,先要在平面选定一矩形区域,假定矩形区域,然后将在方向分成份,将在方向分成份,由各划分点分别作平行于两坐标轴的直线,将区域D分成个小矩形,生成代表每一个小矩形顶点坐标的平面网格坐标矩阵,最后利用有关函数求对应网格坐标的Z矩阵。

在MATLAB中,利用meshgrid函数产生平面区域内的网格坐标矩阵。

其格式为:x=a:d1:b;y=c:d2:d;[X,Y]= meshgrid(x,y);语句执行后,矩阵X的每一行都是向量x,行数等于向量y的元素的个数,矩阵Y的每一列都是向量y,列数等于向量x的元素的个数。

当x=y时,meshgrid 函数可写成meshgrid(x)。

当函数不能简单表示出来时,便只能用for循环或while循环来计算z的元素。

Delft3D模型的应用情况研究初稿

Delft3D模型的应用情况研究初稿

Delft3D模型的应用情况研究摘要:Delft3D 是由荷兰Delft 大学WL Delft Hydraulics 开发的一套功能强大的软件包,能够模拟二维和三维的水流、波浪、水质、生态、泥沙输移及床底地貌,以及各个过程之间的相互作用。

该软件在国内外得到了广泛的应用,并在研究地形演变、咸潮上溯、环境评估、航道整治、洪水演进等方面获得了诸多令人满意的成果。

关键词:Delft3D;数值模拟;应用1.前言Delft3D 是由荷兰Delft 大学WL Delft Hydraulics 开发的一套功能强大的软件包,能够模拟二维和三维的水流、波浪、水质、生态、泥沙输移及床底地貌,以及各个过程之间的相互作用.其核心模块为水动力模块(FLOW),共包括波浪模块(WAVE)、水质模块(WAQ)、颗粒跟踪模块(PART)、生态模块(ECO)、泥沙输移模块(SED)和床底地貌模块(MOR)等七大模块。

Delft3D软件的工作思路是,先利用网格生成工具(RGFGRID)、地形编辑工具(QUICKIN)生成网格和网格节点上的水深文件,再通过相应的模块来计算相应的水流问题,最后根据计算结果利用后处理工具(GPP 和QUICKPLOT)处理得到的数据。

该软件在国内外得到了广泛的应用,并在研究地形演变、咸潮上溯、环境评估、航道整治、洪水演进等方面获得了诸多令人满意的成果。

2。

Delft3D模型介绍2.1模型概述Delft3D软件是由荷兰Delft水力学研究所研究开发的一套水流、泥沙、环境完全集成的计算机软件包,可用于海岸、内河、河口区域的三维计算。

该软件具有灵活的框架,能模拟二维(水平或垂向)和三维的水流、波浪、水质、生态、泥沙输移和床底地貌,以及各个过程之间的相互作用。

它是目前世界上最先进的水动力-水质模型之一。

其主要特征是:所有子模块都具有高度的整合性和互操作性;能直接应用最新过程知识;采用最为友好的图形用户界面(GUI)。

Delft3D-WAQ_Open_Proc_lib_User_Manual

Delft3D-WAQ_Open_Proc_lib_User_Manual

Deltares
1
May ቤተ መጻሕፍቲ ባይዱ011 0.99.15423
A guide to this manual
Open Processes Library User Manual
Example Save
Description Item from a menu, title of a push button or the name of a user interface input field. Upon selecting this item (click or in some cases double click with the left mouse button on it) a related action will be executed; in most cases it will result in displaying some other (sub-)window. In case of an input field you are supposed to enter input data of the required format and in the required domain. Directory names, filenames, and path names are expressed between angle brackets, <>. For the Linux and UNIX environment a forward slash (/) is used instead of the backward slash (\) for PCs. Data to be typed by you into the input fields are displayed between double quotes. Selections of menu items, option boxes etc. are described as such: for instance ‘select Save and go to the next window’. Commands to be typed by you are given in the font Courier New, 10 points. Units are given between square brackets when used next to the formulae. Leaving them out might result in misinterpretation.

Delft3D-NESTWQ_User_Manual

Delft3D-NESTWQ_User_Manual

Delft3D-NESTWQOffline nesting of water quality models User ManualPart of Water QualityVersion:1.34Revision:1542318May2011User Manual Delft3D-NESTWQPublished and printed by:DeltaresRotterdamseweg185p.o.box1772600MH DelftThe Netherlandstelephone:+31883358273fax:+31883358582e-mail:info@deltares.nlwww:http://www.deltares.nlFor support contact:telephone:+31883358555fax:+31883358111e-mail:delft3d.support@deltares.nlwww:The screen pictures shown in this manual were produced during the development stages and may differ from the actual productCopyright©2011DeltaresAll rights reserved.No part of this document may be reproduced in any form by print, photo print,photo copy,microfilm or any other means,without written permission from the publisher:Deltares.Delft3D-NESTWQ User Manual Contents May20111.34.15423Contents1A guide to this manual11.1Introduction (1)1.2Manual version and revisions (1)1.3Typographical conventions (2)2Introduction to Delft3D-NESTWQ32.1System name and subsystems (3)2.2Functionality (3)2.3Overview subsystems (4)3Getting started53.1Starting Delft3D (5)3.2Getting into Delft3D-NESTWQ (6)3.3Exploring some menu options (9)4Input and output114.1Input NESTWQ1 (11)4.2Output NESTWQ1 (12)4.3Input NESTWQ2 (12)4.4Output NESTWQ2 (13)5Tutorial155.1Introduction (18)5.2Input and output NESTWQ1 (18)5.3Input and output NESTWQ2 (22)6Limitations,warnings and errors256.1Limitations (25)Deltares iiiMay2011 1.34.15423Contents Delft3D-NESTWQUser Manual6.2Warnings (26)6.3Errors (26)7Descriptionfiles298Theoretical background318.1Boundary segments (31)8.2Nest segments and weights (31)References33 iv DeltaresDelft3D-NESTWQ User Manual A guide to this manual May20111.34.15423Chapter1A guide to this manual1.1IntroductionThis User Manual concerns the offline water quality nesting module,Delft3D-NESTWQ,of the Delft3D software suite.To make this manual more accessible we will briefly describe the contents of each chapter and appendix.If this is yourfirst time to start working with Delft3D-NESTWQ we suggest you to read and practice the getting started of Chapter3and the tutorial of Chapter5.These chapters explain the user input and guide you through the definition of yourfirst nested simulation.Chapter2:Introduction to Delft3D-NESTWQ,provides specifications of Delft3D-NESTWQ,such as the areas of applications,the functionality provided and an overview of the system.Chapter3:Getting started,explains the use of the overall menu program,which gives access to all Delft3D modules and to the pre-and post-processing tools.Delft3D-NESTWQ being one of them as part of the WAQ module.Chapter4:Input and output,provides detailed information on the parameters in the inputfile and the outputfiles from Delft3D-NESTWQ.Chapter5:Tutorial,emphasis at giving you somefirst hands-on experience in using the Delft3D-NESTWQ tool.Chapter6:Limitations,warnings and errors,discusses the underlying assumptions and warnings and errors that might occur.Chapter7:Descriptionfiles,explains in detail the contents of input and outputfiles.Chapter8:Theoretical background,provides information about boundary segments, nest segments and weights.References,provides a list of related Delft3D modules and background information.1.2Manual version and revisionsA manual applies to a certain release of the related numerical program.This manual applies to Delft3D-NESTWQ1version2.00.02and Delft3D-NESTWQ2version2.00.03.Deltares1May2011 1.34.15423A guide to this manual Delft3D-NESTWQUser Manual1.3Typographical conventionsThroughout this manual,the following conventions in text formats help you to distinguish between different types of text elements.Example DescriptionWaves Boundaries Title of a window or sub-window.Sub-windows are displayed in the Module window and cannot be moved.Windows can be moved independently from the Module window,such as the Visualisation Area window.Save Item from a menu,title of a push button or the name ofa user interface inputfield.Upon selecting this item(click or in some cases doubleclick with the left mouse button on it)a related actionwill be executed;in most cases it will result in displayingsome other(sub-)window.In case of an inputfield you are supposed to enter inputdata of the required format and in the required domain.<\tutorial\wave\swan-curvi> <siu.mdw>Directory names,filenames,and path names are expressed between angle brackets,<>.For the Linux and UNIX environment a forward slash(/)is used instead of the backward slash(\)for PCs.“27081999”Data to be typed by you into the inputfields are displayedbetween double quotes.Selections of menu items,option boxes etc.are describedas such:for instance‘select Save and go to the nextwindow’.delft3d-menu Commands to be typed by you are given in the fontCourier New,10points.[m/s][-]Units are given between square brackets when used nextto the formulae.Leaving them out might result inmisinterpretation.2DeltaresDelft3D-NESTWQ User Manual Introduction to Delft3D-NESTWQ May20111.34.15423Chapter2Introduction to Delft3D-NESTWQ The transfer of data from an encompassing or’overall’numerical model to an embedded or’nested’numerical model is called nesting.In general the overall model has a coarse resolution of grid cells,whereas the nested model has a higher resolution.At the boundary locations of the nested model the results from the overall model are required as boundary conditions for the nested model.The boundary conditions can be water levels,currents,fluxes or discharges in case of hydrodynamic models,and water quality parameters in case of water quality models.2.1System name and subsystemsThe procedure of nesting through concentrations between Delft3D-WAQ(Deltares,2008c) (or PART Deltares(2008a))models is performed by the system NESTWQ.In this procedure two steps can be distinguished which are handled by separate subsystems: NESTWQ1,for the determination of nest segments and nest weights in the overall model.The concentrations at these segments are used by the next subsystem.NESTWQ2,for the generation of boundary conditions for the boundary segments in the nested model from the results at the nest segments in the overall model.2.2FunctionalityThe functionality of the subsystem NESTWQ1is:determine for each boundary segment in the nested model which nest segments in the overall model are required for the nesting of results to these boundary segmentsdetermine for each nest segment the weight factors for the interpolation from the sur-rounding nest segments to the boundary segment in the nested modelThe functionality of the subsystem NESTWQ2is:interpolate the concentration time-series from the nest segments in the overall model to boundary conditions for the boundary segments in the nested modelDeltares3Figure2.1:Dataflow diagram of Delft3D-NESTWQ4DeltaresDelft3D-NESTWQ User Manual Getting started May20111.34.15423Chapter3Getting started3.1Starting Delft3DTo start Delft3D:On an MS Windows platform:select Delft3D in the Applications menu or click on the Delft3D icon on the desktop.On Linux and UNIX machines:type Delft3D-MENU on the command line.Next the title window of Delft3D is displayed,Figure3.1:After a short while the main window of the Delft3D-MENU appears,Figure3-2.Whether or not you may use specific Delft3D modules and features depends on the license file you have.For now,only concentrate on exiting Delft3D-MENU,hence: Select Exit.The window will be closed and you are back in the Windows Desk Top screen for PCs or on the command line for Linux and UNIX workstations.Figure3.1:Title window of Delft3DDeltares5May2011 1.34.15423Getting started Delft3D-NESTWQUser ManualFigure3.2:Main window Delft3D-MENURemark:•In this and the following chapters several windows are shown to illustrate the presenta-tion of Delft3D-MENU and Delft3D-NESTWQ.These windows are grabbed from the PC-platform.For Linux and UNIX workstations the content of the windows is the same,but the colours may be different.On the PC-platform you can set your preferred colours by using the Display Properties.3.2Getting into Delft3D-NESTWQTo continue restart the menu program as indicated above.To access the nesting tool between an overall water quality model and a detailed water quality model,select the far-field water quality module.Select Water Quality in the main window,see Figure3.2.Next the selection window for Far-field water quality(all modules)is displayed,see Figure3.3.The nesting functionality is exactly the same for all water quality modules,therefore: Select General.The selection window for Water quality(W AQ)is displayed(Figure3.4),in which you can convert and/or aggregate hydrodynamic results,prepare a substancefile using the Process Library Configuration Tool,prepare a water quality inputfile,run the pre-processor,execute a computation,inspect the reportfiles with information on the execution,visualise the results, and access additional tools.Before continuing with any of the selections of this Water quality(W AQ)window,you must select the directory in which you are going to nest water quality results:6DeltaresDelft3D-NESTWQ User Manual Getting started May20111.34.15423Figure3.3:Selection window for Far-field water quality(all modules)Figure3.4:Selection window for Water Quality(general)May2011 1.34.15423Getting started Delft3D-NESTWQUser ManualFigure3.5:Select working directory windowFigure 3.6:Select working directory window to set the working directory to<waq\nestwq\2d-2d>Click the Select working directory button.Next the Select changing directory window,Figure3.5,is displayed(your current direc-tory may differ,depending on the location of your Delft3D installation).Browse to and enter the<Tutorial>sub-directory of your Delft3D Home-directory.Enter the<waq>directory.Next the<nestwq>sub-directory.Enter the<2d-2d>sub-directory and close the Select working directory window by clicking OK,see Figure3.6.Next the Water quality(W AQ)window is re-displayed,but now the changed current working directory is displayed in the title bar,see Figure3.7.The nesting tools are part of the Additional tools,hence:Click on Tools.Delft3D-NESTWQ User ManualGetting started May20111.34.15423Figure3.7:Current working directoryFigure3.8:Selection window for Additional toolsThe Additional tools window,Figure3.8,contains the supporting programs to configure your own Processes Library and to nest water quality models.Click on Nesting to show the various steps in the nesting of water quality models,see Figure3.9.Click on Nest Input(1).The inputfile for NESTWQ1is opened,see Figure3.10.Select File–Exit,to close the inputfile.Select Return,to close the Additional tools window.Select Return,and Return twice again,to enter the main window of Delft3D-MENU.Click Exit.The window is closed and the control is returned to the desk top or the command line. 3.3Exploring some menu optionsTo guide you through some menu options please follow the example in Chapter5,Tutorial.May2011 1.34.15423Getting started Delft3D-NESTWQUser ManualFigure3.9:election window for Additional tools,nesting water quality modelsFigure3.10:Inputfile for NESTWQ1Delft3D-NESTWQ User Manual Input and output May20111.34.15423Chapter4Input and outputNESTWQ1and NESTWQ2have each their own inputfile.The inputfiles<nestwq1.inp> and<nestwq2.inp>,respectively,are free-formatted ASCIIfiles.4.1Input NESTWQ1The inputfile<nestwq1.inp>contains the following information:<o>CHARACTER,the overall grid in X,Y co-ordinates at the depth lo-cations<com-ext1.lga>CHARACTER,the table with(in)active segment numbers of the over-all model<o>CHARACTER,the nested grid in X,Y co-ordinates at the depth lo-cations<com-ext2.lga>CHARACTER,the table with(in)active segment numbers of thenested model<nestwq1.dia>CHARACTER,diagnostics from NESTWQ1and the required nestsegments in Delft3D-WAQ monitor format<nestwq1.adm>CHARACTER,per boundary segment the overall nest segments andweight factors required for the nesting procedure in NESTWQ2Thefilenames between quotes are free to choose with a maximal length of128characters. Remarks:•The required information about the vertical structure of the models is contained in the gridfiles.If the overall model is2DH and the nested model is3D,NESTWQ2will generate a uniform3D profile for the nested model.If the overall model is3D and the nested model is2DH,NESTWQ2will generate depth-averaged boundary conditions for the nested model.•If both models are3D then the number of layers in each model must be equal. Example inputfile<nestwq1.inp>:’..\hkcrs.3d\o’;X,Y co-ordinates overall modelMay2011 1.34.15423Input and output Delft3D-NESTWQUser Manual’..\hkcrs.3d\com-o3d.lga’;grid table with active cells overall model ’..\siulam.3d\o’;X,Y co-ordinates nested model’..\siulam.3d\com-d3d.lga’;grid table with active cells nested model’3d-3d.dia’;diagnostics from NESTWQ1’3d-3d.adm’;nest segments and weight factors overall model 4.2Output NESTWQ1The outputfiles of NESTWQ1are:<nestwq1.dia>the diagnostics from NESTWQ1and the required nest segments inDelft3D-WAQ monitor format<nestwq1.adm>per boundary segment the overall nest segments and weight factorsrequired for the nesting procedure in NESTWQ2Remarks:•It is not necessary to include the required nest segments in the simulation with the overall model as the nesting is performed with the results in the mapfile.The map file contains the concentrations at every grid point,thus including the required nest segments.•The administrationfile contains the required information about the vertical structure of each model.See Chapter5for an example of thesefiles.4.3Input NESTWQ2The inputfile<nestwq2.inp>contains the following information:<nestwq1.adm>CHARACTER,the nest administrationfile with per boundary seg-ment the overall nest segments and weight factors required for thenesting procedure in NESTWQ2<d3d-waq.map>CHARACTER,the mapfile with results from the overall model nosys INTEGER,the number of active substances to be nested<nestwq2.dia>CHARACTER,diagnostics from NESTWQ2<ext.bcc>CHARACTER,the boundary conditions at the(aggregated)bound-ary segments of the nested modelThefilenames between quotes are free to choose with a maximal length of128characters. Remark:•Thefirst‘nosys’active substances will be transferred as boundary conditions for the nested model.Example inputfile<nestwq2.inp>:Delft3D-NESTWQ User Manual Input and output May20111.34.15423’..\nestwq1.v20\3d-3d.adm’;nest segments and weight factors overall model ’o3d-waq.map’;map file overall model4;number of active substances to nest’3d-3d.dia’;diagnostics from NESTWQ2’3d3dwaq.bcc’;boundary conditions for nested model4.4Output NESTWQ2The outputfiles of NESTWQ2are:<nestwq2.dia>the diagnostics from NESTWQ2<ext.bcc>the boundary conditions at the(aggregated)boundary segments ofthe nested modelSee Chapter5for an example of the diagnosticsfile.May2011 1.34.15423Input and output Delft3D-NESTWQUser ManualDelft3D-NESTWQ User Manual Tutorial May20111.34.15423Chapter5TutorialAt this moment no graphical user interface is available to perform the nesting of water quality models.In order to perform the nesting,correctly,the following steps are required:Edit/Create<nestwq1.inp>file for NESTWQ1You have to specify the names of the<∗.lga>and<∗.cco>files of the overall and detailed model.Specify the administrationfile.On forehand the hydrodynamics of both the overall and nested model must be converted to formats required for Delft3D-WAQ(Couple menu, see Deltares(2008c)).Create administrationfile(execute NESTWQ1)Within this step a diagnosticfile and an administrationfile is created which is required input for the second step of the of the nesting(NESTWQ2).Edit/Create<nestwq2.inp>file for NESTWQ2You must specify the name of the administrationfile(created by step2),the name of the water quality mapfile of the overall model,the number of active substances to nest and the name of the binary boundary outputfile for the detailed model.Create boundary conditions(execute NESTWQ2)Within this step a diagnosticfile and a boundaryfile is created which is required input for running the water quality detailed model.Examine diagnosticfiles of NESTWQ1and NESTWQ2After executing NESTWQ1and/or NESTWQ2you can inspect the if the modules have run correctly.Edit nested W AQ inputfileIn this step you must add the created boundaryfilename(step4)by editing block4of the water quality inputfile:May2011 1.34.15423Tutorial Delft3D-NESTWQUser Manualgoto block#4change‘1:information in thisfile’to‘-2:information in binaryfile’write on a new record the name of boundaryfile between quotesdelete all other information in the following records in block#4(until block#5)In order to demonstrate the use of Delft3D-NESTWQ the following tutorial can be applied: Available datafiles:<com-d2d.dat>:communicationfile detailed2D model(Siu-Lam)<com-d2d.def>:definitionfile detailed2D model<com-o2d.dat>:communicationfile overall2D model(Upgrade2x2)<com-o2d.def>:definitionfile overall2D model<tracer.sub>:substancefile with CTR11.Start Delft3D-MENU.2.Select Water Quality from the main menu.3.Select General from the Far-field water quality(all modules)selection window.4.Select Coupling and start COUP-GUI by selecting Define input.5.Open in COUP-GUI Data Group Hydrodynamics and open<com-02d.dat>.6.Save the input as<com-o2d.hyd>.7.Select File–Exit to leave COUP-GUI.8.Select Start to execute the coupling.A window opens with messages from the coupling.Close this window when the coupling isfinished.9.Go back by selecting Return in the Hydrodynamic coupling window.10.Select Define input to start the WAQ-GUI.11.Activate in WAQ-GUI Data Group Hydrodynamics and select<com-02d.hyd>file.12.Set dispersion to10m2/s in x and y direction.13.Activate Data Group Substances and selectfile<tracer.sub>.14.Set Time Frame to1-1-2000-3-1-2000,timestep3minutes15.Select Numerical option5in Data Group Numerical options16.Add two discharges at(32,28)and(44,28)and assign a load of1000g/s of CTR1toboth discharges(Data Group Discharges)by button Edit data17.Select Output Option Data Group and set output timers for the mapfile to1-1-2000(start);3-1-2000(stop);1hour time step18.Save scenario as<∗.scn>file(e.g.<testo.scn>)19.Exit the WAQ-GUIDelft3D-NESTWQ User Manual Tutorial May20111.34.1542320.Select Waq(1);in selection window select scenariofile,e.g.<testo.scn>.21.Check reportfiles on errors.22.Select Waq(2)to start the calculation.23.Visualise the results with Delft3D-QUICKPLOT or Delft3D-GPP(Deltares,2008b,2006).Repeat the above steps for the detailed model(<com-d2d.dat>)without step16and save the results in e.g.<testd.scn>(no discharges added).24.Select Tools in the Water quality(WAQ)menu.The following menu will appear:(a)Edit or create inputfile for NESTWQ1You have to specify the names of the<∗.lga>and<∗.cco>files of the overalland detailed model conform the documentation(e.g.<com-o2d>,<com-d2d>).Specify administrationfile(e.g.<2d-2d.adm>).(b)Start NESTWQ1Within this step a diagnosticfile and an administrationfile is created which isrequired input for the second step of the of the nesting(NESTWQ2)(c)Edit or create inputfile for NESTWQ2You must specify the name of theadministrationfile(created by step2),the name of the water quality mapfile ofthe overall model(e.g.<testo.map>),the number of active substances to nestand the name of the binary boundary outputfile for the detailed model(e.g.<2d-2d.bcc>).(d)Start NESTWQ2Within this step a diagnosticfile and an boundaryfile is created which is requiredinput for running the water quality detailed model.(e)Examine diagnosticfiles of NESTWQ1and NESTWQ2(f)Edit nested WAQ inputfileIn this step you must add the created boundaryfile name(step4)by editing block4of the water quality inputfile(e.g.<testd.inp>)-goto block#4-replace the block of lines starting with”ITEM”(right after the Thatcher-Harleman timelags for each boundary segment)up to(but not including)theline#5;delimiter for thefifth block by the single line‘-2:information in binaryfile’.-write on a new record the boundaryfilename between quotes e.g.‘2d-2d.bcc’-delete all other information in the following records in block#4(until block#5) Note:You can also use the Delft3D-WAQ user-interface:select the Boundary Condi-tions datagroup and press the Datafile button.The dialogue that appears allows you to select the outputfile from NESTWQ2.This will then be included automatically in the input to Delft3D-WAQ.The advantage of this method is that the name of this outputfile becomes part of the scenario and it will be included when you edit the input via the user-interface.25.Return to Water quality(W AQ)menu and select Waq(1)and select the adapted<testd.inp>file.26.Run the detailed model and evaluate the results.May2011 1.34.15423Tutorial Delft3D-NESTWQUser ManualFigure5.1:Dialog for selecting output from NESTWQ2in Delft3D-WAQ GUI5.1IntroductionThe Upgraded WAHMO Model is afine-grid numerical model for the placeHong Kong waters. It is based on the shallow water equations in curvilinear co-ordinates.The spatial resolution is typical300–1500m.The model was developed in view of the need for a detailed and accurate tidal and water quality model that could be used for accurate computations.A further interest was provided by transport and water quality simulations on seasonal and annual scales.For this purpose thefine-grid water quality model was aggregated.The SIU LAM model is afine-grid numerical model for the waters north of Lantau Island. It uses a curvilinearfine grid.The hydrodynamic model was developed to investigate the effects of various layouts for a proposed typhoon shelter at Siu Lam.As an example to demonstrate the nesting of water quality models a water quality model based upon the hydrodynamic SIU LAM model was set up.For the generation of water quality boundary conditions for the WQ SIU LAM model,the model is nested in a coarse version of the WQ UPGRADE WAHMO model.Figure5.1shows the coarse grid UPGRADE WAHMO together with thefine grid SIU LAM. The locations of the boundary segments of the SIU LAM model are presented in Figure5.2. In the following application grid cells have not been aggregated in both models.Both3D models have5layers.5.2Input and output NESTWQ1InputfileInputfile<nestwq1.inp>:’o’;X,Y co-ordinates overall model’com-o3d.lga’;grid table with active cells overall model’o’;X,Y co-ordinates nested model’com-d3d.lga’;grid table with active cells nested model’3d-3d.dia1’;diagnostics from NESTWQ1Delft3D-NESTWQ User Manual Tutorial May20111.34.15423Figure5.2:Upgrade and Siu Lam modelsFigure5.3:Siu Lam model with2open boundaries(east and west)May2011 1.34.15423Tutorial Delft3D-NESTWQUser Manual’3d-3d.adm’;nest segments and weight factors overall modelDiagnosticsfileDiagnosticsfile<3d-3d.dia1>:WL|Delft Hydraulics,\DNESTWQ1,Version2.01.00,Aug312006>>Input from nestwq1.inpX,Y co-ordinates overall model:oGrid table with active cells overall model:com-o3d.lgaX,Y co-ordinates nested model:oGrid table with active cells nested model:com-d3d.lgaDiagnostics and required nest segments:3d-3d.dia1Nest segments and weight factors overall model:3d-3d.adm***WARNING***negative3rd weight for-91***WARNING***negative4th weight for-91***WARNING***negative3rd weight for-101***WARNING***negative4th weight for-101***WARNING***negative3rd weight for-531***WARNING***negative4th weight for-531>>List of required nest segments in DELWAQ monitor formatNumber of required nest segments:511719’Nest segment1719’1720’Nest segment1720’1782’Nest segment1782’1781’Nest segment1781’1780’Nest segment1780’1718’Nest segment1718’2897’Nest segment2897’2959’Nest segment2959’1779’Nest segment1779’1717’Nest segment1717’2958’Nest segment2958’2896’Nest segment2896’1778’Nest segment1778’1716’Nest segment1716’2957’Nest segment2957’2895’Nest segment2895’1654’Nest segment1654’1655’Nest segment1655’1715’Nest segment1715’1653’Nest segment1653’1714’Nest segment1714’1652’Nest segment1652’1713’Nest segment1713’1651’Nest segment1651’2956’Nest segment2956’2894’Nest segment2894’1712’Nest segment1712’1650’Nest segment1650’1711’Nest segment1711’1649’Nest segment1649’..............1766’Nest segment1766’1890’Nest segment1890’1889’Nest segment1889’1827’Nest segment1827’1888’Nest segment1888’1826’Nest segment1826’Delft3D-NESTWQ User Manual Tutorial May20111.34.15423>>Number of warnings:6AdministrationfileNest administration datafile<3d-3d.adm>(only part is given):Deltares,NESTWQ1Version2.04.02.10724,Mar82010,13:05:47>>Files used to determine nest characteristicsX,Y co-ordinates overall model:oGrid table with active cells overall model:com-o3d.lgaNumber of segments overall model per layer:4774Number of layers overall model:5X,Y co-ordinates nested model:oGrid table with active cells nested model:com-d3d.lgaNumber of segments nested model per layer:7400Number of layers nested model:5>>List of boundary segments,required nest segments and weight factors Nest model Overall model------------------------SEGNR#NST SEGNR WEIGHT-1417190.4712717200.2868217820.0915217810.15038SEGNR#NST SEGNR WEIGHT-2417190.6819517200.0922417820.0269017810.19890SEGNR#NST SEGNR WEIGHT-3417190.6979417810.1931617800.0236117180.08529..................SEGNR#NST SEGNR WEIGHT-68418270.4379318890.2571618880.1128118260.19211May2011 1.34.15423Tutorial Delft3D-NESTWQUser Manual5.3Input and output NESTWQ2InputfileInputfile<nestwq2.inp>:’3d-3d.adm’;nest segments and weight factors overall model’o3d-waq.map’;WAQ map file overall model4;number of active substances for nested model’3d-3d.dia2’;diagnostics from NESTWQ2’3d3dwaq.bcc’;WAQ boundary conditions for nested modelDiagnosticfileThe diagnosticsfile<3d-3d.dia2>:WL|Delft Hydraulics,\DNESTWQ2,Version2.01.00,Aug312006>>Input from nestwq2.inpNest segments and weight factors overall model:3d-3d.admMap file overall model:o3d-waq.mapNumber of active substances to nest:4Diagnostics NESTWQ2:3d-3d.diaBoundary conditions for nested model:3d3dwaq.bccWL|Delft Hydraulics,\DNESTWQ1,Version2.01.00,Aug312006>>Files used to determine nest characteristicsX,Y co-ordinates overall model:oGrid table with active cells overall model:com-o3d.lgaNumber of segments overall model per layer:4774Number of layers overall model:5X,Y co-ordinates nested model:oGrid table with active cells nested model:com-d3d.lgaNumber of segments nested model per layer:7400Number of layers nested model:5>>\DWAQ\map file characteristicsModel and run identification:1-\DWAQ\-----------------------12-Upgrade WAHMO coarse model--------23-test------------------------------34-map results to nest SIU LAM-------4 Total number of variables:7Variable names on map file:Substance1。

matlab学习笔记8基本绘图命令-三维绘图

matlab学习笔记8基本绘图命令-三维绘图

matlab学习笔记8基本绘图命令-三维绘图⼀起来学matlab-matlab学习笔记8基本绘图命令_6 三维绘图觉得有⽤的话,欢迎⼀起讨论相互学习~参考书籍《matlab 程序设计与综合应⽤》张德丰等著感谢张⽼师的书籍,让我领略到matlab的便捷《MATLAB技术⼤全》葛超等编著感谢葛⽼师的书籍,让我领略到matlab的⾼效三维绘图命令三维绘图命令plot3plot3命令将绘制⼆维图形的函数plot的特性扩展到三维空间图形。

函数格式除了包括第三维的信息(如Z⽅向)之外,与⼆维函数plot相同。

其调⽤格式如下。

plot3(x,y,z):当x,y和z是相同的向量时,则绘制以x,y和z元素为坐标的三维曲线;当x,y和z是同型矩阵时,则绘制以x,y和z元素为坐标的三维曲线,且曲线的条数等于矩阵的列数。

plot3(x,y,z,'s'):s是指定绘制三维曲线的线型、数据点形和颜⾊的字符串,省略s时,将⾃动选择线型、数据点形和颜⾊。

使⽤plot3绘制三维螺旋曲线图t=0:pi/50:10*pi;plot3(sin(t),cos(t),t,'g*')grid绘制空间曲⾯三维空间曲⾯可以绘制出在某⼀区间内完整的曲⾯,⽽不是单根曲线。

三维⽹格图是将邻近的⽹格顶点(x,Y)对应曲⾯上的点(X,Y,Z)⽤线条连接起来形成的。

利⽤mesh和surf绘制三维⽹线图和曲⾯图。

其中mesh(X,Y,Z)是绘制⽹格曲⾯,surf(X,Y,Z)是绘制光滑曲⾯。

mesh(x,y,z,c):绘制由x、y和z指定的参数曲⾯。

x和y必须为向量。

若x和y的长度为m和n,则z必须为m×n的矩阵,c是颜⾊映射数组,决定图形的颜⾊。

mesh(z)和mesh(x,y,z):绘制三维⽹格图。

当只有参数z时,以z矩阵的⾏下标作为x坐标轴,把z的列下标当作坐标轴;x和y分别为x和y坐标轴的⾃变量。

当有x,y和z参数时,绘制出由坐标(x,y,z)确定的三维⽹格图形surf(x,y,z,c):完整地画出由c指定⽤⾊的曲⾯图,在完整调⽤格式中,4个输⼊量必须是维数相同的矩阵。

美赛matlab3D绘图必备

美赛matlab3D绘图必备

设置坐标轴标签:使用xlbel、ylbel、zlbel函数设置坐标轴标签
设置坐标轴颜色:使用color函数设置坐标轴颜色
设置坐标轴刻度:使用set函数设置坐标轴刻度
设置坐标轴样式:使用set函数设置坐标轴样式,如线型、颜色等
绘制基本图形
图形注释与修饰
注释:在图形上添加文字说明,如坐标轴标签、图例等
保存和展示:将绘制好的三维模型保存为图片格式,并在PPT中展示
绘制三维数据可视化交互界面
导入Mtlb库:使用import语句导入Mtlb库
绘制三维图形:使用plot3函数绘制三维图形
添加交互功能:使用uicontrol函数添加交互按钮,使用cllbck函数实现交互功能
创建三维数据:使用rndn函数生成三维数据
使用isosurfce函数绘制三维曲面
使用plot3函数绘制三维曲面
使用surf函数绘制三维曲面
使用mesh函数绘制三维曲面
绘制等高线图
什么是等高线图:表示地形、地貌等高线分布的图形
等高线图的作用:直观展示地形、地貌特征,便于分析和研究
等高线图的绘制方法:使用Mtlb的surf函数或conur3函数
向量场图的应用: . 流体力学:模拟流体流动 b. 电磁学:模拟电磁场分布
Mtlb 3D绘图应用实例
PRT 04
绘制三维数据分布图
设置图形属性:使用title、colorbr、legend等函数设置图形属性
保存图形:使用sves函数将图形保存为文件
展示图形:使用show函数展示三维数据分布图
导入数据:将三维数据导入Mtlb
可以通过设置不同的参数,如点的大小、颜色、透明度等,来调整散点图的视觉效果。
绘制向量场图

MATLAB для工程师第三版说明书

MATLAB для工程师第三版说明书

M ATLAB® for EngineersMATLAB® for Engineers T hird EditionH OLLY M OORES alt Lake Community CollegeS alt Lake City, UtahB oston • Columbus • Indianapolis • New YorkSan Francisco • Upper Saddle River • A msterdamCape Town • Dubai • London • Madrid • Milan Munich • Paris • Montreal • Toronto • D elhiMexico City • Sao Paulo • Sydney • Hong KongSeoul • Singapore • Taipei • TokyoV ice President and Editorial Director, Engineering/Computer Science: Marcia J. HortonE xecutive Editor: Holly StarkE ditorial Assistant: William OpaluchM arketing Manager: Tim GalliganP roduction Manager: Pat BrownA rt Director: Jayne ConteC over Designer: Bruce KenselaarM edia Editor: Daniel SandinF ull-Service Project Management: Pavithra Jayapaul, TexTech InternationalC omposition: TexTech InternationalP rinter/Binder: Edwards BrothersC over Printer: Lehigh-Phoenix Color/HagerstownC redits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on appropriate page within text.M ATLAB® and Simulink® are registered trademarks of The Mathworks, Inc., 3 Apple Hill Drive, Natick MA 01760-2098.C opyright © 2012 Pearson Education, Inc., publishing as Prentice Hall, One Lake Street, Upper Saddle River, New Jersey 07458.All rights reserved. Manufactured in the United States of America. This publication is protected by Copyright, and permission shouldbe obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or byany means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission(s) to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458.M any of the designations by manufacturers and seller to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial caps or all caps.L ibrary of Congress Cataloging–in–Publication DataMoore, Holly.MATLAB® for engineers / Holly Moore. — 3rd ed.p. cm.Includes index.ISBN-13: 978-0-13-210325-1ISBN-10: 0-13-210325-71. Engineering mathematics—Data processing.2. MATLAB®. I. Title.TA345.M585 2011620.001'51—dc23201102273910 9 8 7 6 5 4 3 2 1I SBN 10: 0-13-210325-7I SBN 13: 978-0-13-210325-1C ontentsA BOUT THIS BOOK XI DEDICATION AND ACKNOWLEDGMENTS XV1 • ABOUT MAT LAB® 11.1W hat Is MAT LAB®?11.2S tudent Edition of MAT LAB® 21.3H ow Is MAT LAB®Used in Industry?31.4P roblem Solving in Engineering and Science52 • M ATLAB® ENVIRONMENT 92.1G etting Started92.2M AT LAB®Windows112.3S olving Problems with MAT LAB®182.4S aving Your Work42S ummary52M AT LAB®Summary54K ey T erms55P roblems553 • B UILT-IN MATLAB® FUNCTIONS 63I ntroduction633.1U sing Built-In Functions633.2U sing the Help Feature653.3E lementary Math Functions683.4T rigonometric Functions763.5D ata Analysis Functions803.6R andom Numbers1003.7C omplex Numbers1043.8C omputational Limitations1083.9S pecial Values and Miscellaneous Functions109vvi Contents3.10S ummary111M AT LAB®Summary112K ey T erms113P roblems1144 • M ANIPULATING MATLAB® MATRICES 1214.1M anipulating Matrices1214.2P roblems with T wo Variables1284.3S pecial Matrices135S ummary141M AT LAB®Summary142K ey T erms142P roblems1425 • P LOTTING 149I ntroduction1495.1T wo-Dimensional Plots1495.2S ubplots1665.3O ther T ypes of T wo-Dimensional Plots1685.4T hree-Dimensional Plotting1835.5E diting Plots from the Menu Bar1895.6C reating Plots from the Workspace Window1915.7S aving Your Plots192S ummary193M AT LAB®Summary193P roblems1956 • U SER-DEFINED FUNCTIONS 205I ntroduction2056.1C reating Function M-Files2056.2C reating Your Own T oolbox of Functions2246.3A nonymous Functions and Function Handles2266.4F unction Functions2276.5S ubfunctions228S ummary231M AT LAB®Summary232K ey T erms233P roblems2337 • U SER-CONTROLLED INPUT AND OUTPUT 240I ntroduction2407.1U ser-Defi ned Input2407.2O utput Options2447.3G raphical Input254C ontents vii7.4M ore Cell Mode Features2557.5R eading and Writing Data from Files2607.6D ebugging Your Code263S ummary266M AT LAB®Summary267K ey T erms268P roblems2688 • L OGICAL FUNCTIONS AND SELECTION STRUCTURES 273I ntroduction2738.1R elational and Logical Operators2748.2F lowcharts and Pseudocode2768.3L ogical Functions2778.4S election Structures2848.5D ebugging300S ummary301M AT LAB®Summary301K ey T erms302P roblems3029 • R EPETITION STRUCTURES 311I ntroduction3119.1F or Loops3129.2W hile Loops3209.3B reak and Continue3289.4M idpoint Break Loops3299.5N ested Loops3339.6I mproving the Effi ciency of Loops334S ummary336K ey T erms337P roblems33710 • M ATRIX ALGEBRA 343I ntroduction34310.1M atrix Operations and Functions34310.2S olutions of Systems of Linear Equations36310.3S pecial Matrices379S ummary381M AT LAB®Summary383K ey T erms384P roblems38411 • O THER KINDS OF ARRAYS 391I ntroduction39111.1D ata T ypes39211.2M ultidimensional Arrays401viii Contents11.3C haracter Arrays40311.4C ell Arrays40811.5S tructure Arrays409S ummary417M AT LAB®Summary417K ey T erms418P roblems41812 • S YMBOLIC MATHEMATICS 424I ntroduction42412.1S ymbolic Algebra42512.2S olving Expressions and Equations43512.3S ymbolic Plotting44612.4C alculus45412.5D ifferential Equations46812.6C onverting Symbolic Expressions to MAT LAB®Functions470S ummary471M AT LAB®Summary473P roblems47413 • N UMERICAL TECHNIQUES 48413.1I nterpolation48413.2C urve Fitting49413.3U sing the Interactive Fitting T ools50513.4D ifferences and Numerical Differentiation51213.5N umerical Integration52013.6S olving Differential Equations Numerically526S ummary533M AT LAB®Summary535K ey T erms536P roblems53614 • A DVANCED GRAPHICS 545I ntroduction54514.1I mages54514.2H andle Graphics56114.3A nimation56514.4O ther Visualization T echniques57114.5I ntroduction to Volume Visualization573S ummary576M AT LAB®Summary577K ey T erms578P roblems579C ontents ix15 • C REATING GRAPHICAL USER INTERFACES 581I ntroduction58115.1A Simple GUI with One User Interaction58215.2 A Graphical User Interface with Multiple UserInteractions—Ready_Aim_Fire 59015.3A n Improved Ready_Aim_Fire Program59315.4A Much Better Ready_Aim_Fire Program59415.5B uilt-In GUI T emplates598S ummary602K ey T erms602P roblems60216 • S IMULINK®—A BRIEF INTRODUCTION 604I ntroduction60416.1A pplications60416.2G etting Started60516.3S olving Differential Equations with Simulink®613S ummary618K ey T erms619P roblems619A PPENDIX A • S PECIAL CHARACTERS, COMMANDS, ANDFUNC IONS 623A PPENDIXB • SCALING T ECHNIQUES 638A PPENDIX C • THE READY_AIM_FIRE GUI 641I NDEX 646A bout This BookT his book grew out of my experience teaching MATLAB® and other computinglanguages to freshmen engineering students at Salt Lake Community College.I was frustrated by the lack of a text that “started at the beginning.” Although therewere many comprehensive reference books, they assumed a level of both mathem-atical and computer sophistication that my students did not possess. Also, becauseMATLAB® was originally adopted by practitioners in the fi elds of signal processingand electrical engineering, most of these texts provided examples primarily fromthose areas, an approach that didn’t fi t with a general engineering curriculum.This text starts with basic algebra and shows how MATLAB® can be used to solveengineering problems from a wide range of disciplines. The examples are drawnfrom concepts introduced in early chemistry and physics classes and freshman andsophomore engineering classes. A standard problem-solving methodology is usedconsistently.T he text assumes that the student has a basic understanding of college algebraand has been introduced to trigonometric concepts; students who are mathematicallymore advanced generally progress through the material more rapidly. Although thetext is not intended to teach subjects such as statistics or matrix algebra, when theMATLAB® techniques related to these subjects are introduced, a brief background isincluded. In addition, sections describing MATLAB® techniques for solving problemsby means of calculus and differential equations are introduced near the end of appro-priate chapters. These sections can be assigned for additional study to students with amore advanced mathematics background, or they may be useful as reference materialas students progress through an engineering curriculum.T he book is intended to be a “hands-on” manual. My students have been mostsuccessful when they read the book while sitting beside a computer and typing in theexamples as they go. Numerous examples are embedded in the text, with more com-plicated numbered examples included in each chapter to reinforce the conceptsintroduced. Practice exercises are included in each chapter to give students animmediate opportunity to use their new skills, and complete solutions are availableonline at: /moore .T he material is grouped into three sections. The fi rst, A n Introduction to BasicMATLAB® Skills, gets the student started and contains the following chapters:• C hapter 1shows how MATLAB® is used in engineering and introduces a stand-ard problem-solving methodology.• C hapter 2introduces the MATLAB® environment and the skills required toperform basic computations. This chapter also introduces M-fi les, and the con-cept of organizing code into cells. Doing so early in the text makes it easier forstudents to save their work and develop a consistent programming strategy.• C hapter 3details the wide variety of problems that can be solved with built-inMATLAB® functions. Background material on many of the functions is providedto help the student understand how they might be used. For example, the differ-ence between Gaussian random numbers and uniform random numbers isdescribed, and examples of each are presented.xixii About This Book• C hapter 4demonstrates the power of formulating problems by using matricesin MATLAB® and expanding on the techniques employed to defi ne thosematrices. The m eshgrid function is introduced in this chapter and is used tosolve problems with two variables. The diffi cult concept of meshing variables isrevisited in C hapter 5when surface plots are introduced.• C hapter 5describes the wide variety of both two-dimensional and three-dimensional plotting techniques available in MATLAB®. Creating plots viaMATLAB® commands, either from the command window or from within anM-fi le, is emphasized. However, the extremely valuable techniques of interac-tively editing plots and creating plots directly from the workspace window arealso introduced.M ATLAB® is a powerful programming language that includes the basicconstructs common to most programming languages. Because it is a scriptinglanguage, creating programs and debugging them in MATLAB® is often easierthan in traditional programming languages such as C++. This makes MATLAB®a valuable tool for introductory programming classes. The second section ofthe text, P rogramming in MATLAB®, introduces students to programming andconsists of the following chapters:• C hapter 6describes how to create and use user-defi ned functions. This chapteralso teaches students how to create a “toolbox” of functions to use in their ownprogramming projects.• C hapter 7introduces functions that interact with the program user, includinguser-defi ned input, formatted output, and graphical input techniques. The useof MATLAB®’s debugging tools is also introduced.• C hapter 8describes logical functions such as f ind and demonstrates how theyvary from the i f and i f/else structures. The s witch case structure is also intro-duced. The use of logical functions over control structures is emphasized,partly because students (and teachers) who have previous programmingexperience often overlook the advantages of using MATLAB®’s built-in mat-rix functionality.• C hapter 9introduces repetition structures, including f or loops, w hile loops, andmidpoint break loops which utilize the b reak command. Numerous examplesare included because students fi nd these concepts particularly challenging.C hapters 1through 9should be taught sequentially, but the chapters inSection 3, A dvanced MATLAB® Concepts , do not depend upon each other. Any orall of these chapters could be used in an introductory course or could serve as ref-erence material for self-study. Most of the material is appropriate for freshmen. Atwo-credit course might include C hapters 1through 9plus C hapter 10 , while athree-credit course might include C hapters 1through 14 , but eliminate Sections 12.4,12.5, 13.4, 13.5, and 13.6, which describe differentiation techniques, integrationtechniques, and solution techniques for differential equations. Chapters 15 and16 will be interesting to more advanced students, and might be included in acourse delivered to sophomore or junior students instead of to freshmen. Theskills developed in these will be especially useful as students become moreinvolved in solving engineering problems:• C hapter 10 discusses problem solving with matrix algebra, including dot prod-ucts, cross products, and the solution of linear systems of equations. Althoughmatrix algebra is widely used in all engineering fi elds, it fi nds early applicationin the statics and dynamics classes taken by most engineering majors.About This Book xiii • C hapter 11 is an introduction to the wide variety of data types available inMATLAB®. This chapter is especially useful for electrical engineering and com-puter engineering students.• C hapter 12 introduces MATLAB®’s symbolic mathematics package, built onthe MuPad engine. Students will fi nd this material especially valuable in math-ematics classes. My students tell me that the package is one of the most valu-able sets of techniques introduced in the course. It is something they startusing immediately.• C hapter 13 presents numerical techniques used in a wide variety of applica-tions, especially curve fi tting and statistics. Students value these techniqueswhen they take laboratory classes such as chemistry or physics or when they takethe labs associated with engineering classes such as heat transfer, fl uid dynam-ics, or strengths of materials.• C hapter 14 examines graphical techniques used to visualize data. These tech-niques are especially useful for analyzing the results of numerical analysis calcu-lations, including results from structural analysis, fl uid dynamics, and heattransfer codes.• C hapter 15 introduces MATLAB®’s graphical user interface capability, using theGUIDE application. Creating their own GUI’s gives students insight into how thegraphical user interfaces they use daily on other computer platforms are created.• C hapter 16 introduces Simulink®, which is a simulation package built on top ofthe MATLAB® platform. Simulink® uses a graphical user interface that allowsprogrammers to build models of dynamic systems. Simulink® has found signifi-cant acceptance in the fi eld of Electrical Engineering but has wide applicationacross the engineering spectrum.A ppendix A lists all of the functions and special symbols (or characters) intro-duced in the text. A ppendix B describes strategies for scaling data, so that theresulting plots are linear. A ppendix C includes the complete MATLAB® code tocreate the Ready_Aim_Fire graphical user interface described in C hapter 15 . Aninstructor web -site includes the following material:• M-fi les containing solutions to practice exercises• M-fi les containing solutions to example problems• M-fi les containing solutions to homework problems• P owerPoint slides for each chapter• A ll of the fi gures used in the text, suitable for inclusion in your own PowerPointpresentations• A series of lectures (including narration) suitable for use with online classes oras reviewsA BOUT THE THIRD EDITIONN ew versions of MATLAB® are rolled out every 6 months, which makes keepingany text up-to-date a challenge. The major changes included in this edition are asfollows:• A ll of the screen shots throughout the book were updated to refl ect the 2011arelease.• T he introduction to cell mode was moved to C hapter 2from C hapter 7. Thedescription of the cell mode publishing features was expanded and updated inC hapter 7.xiv About This Book• I nformation on debugging features was added to Chapters 7 and 8.• B ased on student and instructor feedback, C hapter 8was signifi cantly revisedand split into two chapters.❍T he new C hapter 8introduces MATLAB®’s logical functions such as f ind,and the more traditional selection structures i f,i f/else, and s witch/case.❍T he new C hapter 9deals exclusively with repetition structures.• T he symbolic toolbox was changed signifi cantly in the 2007b edition, whichrequired changes to the symbolic algebra materials in C hapter 12 .• T wo additional chapters were added in an attempt to make the text useful to awider audience.❍C hapter 15 describes graphical user interfaces.❍C hapter 16 is an introduction to Simulink®.• P roblems were added at the end of each chapter.• A dditional example problems were added.• A number of new functions are introduced throughout the book, suggested tous by adopters of the text.D edication and AcknowledgmentsT his project would not have been possible without the support of my family, whichendured reading multiple drafts of the text and ate a lot of frozen pizza while I con-centrated on writing. Thanks to Mike, Heidi, Meagan, and David, and to my hus-band, Dr. Steven Purcell. I also benefi ted greatly from the suggestions for problemsrelated to electricity from Lee Brinton and Gene Riggs of the SLCC ElectricalEngineering Department. Their cheerful efforts to educate me on the mysteries ofelectricity are much appreciated. I’d also like to thank Dr. Ghassan Hamarneh forhis careful review of the second edition, which helped tremendously as I preparedthis latest manuscript.T his book is dedicated to my father, Professor George Moore, who taught in theDepartment of Electrical Engineering at the South Dakota School of Mines andTechnology for almost 20 years. Professor Moore earned his college degree at the ageof 54 after a successful career as a pilot in the United States Air Force and was a livingreminder that you are never too old to learn. My mother, Jean Moore, encouragedboth him and her two daughters to explore outside the box. Her loving support madeit possible for both my sister and I to enjoy careers in engineering—something fewwomen attempted in the early 1970s. I hope that readers of this text will take a minuteto thank those people in their lives who’ve helped them make their dreams cometrue. Thanks Mom and Dad.xv。

Delft3D-GISVIEW_User_Manual

Delft3D-GISVIEW_User_Manual

Delft3D-GISVIEW Presentation of results in a GIS User ManualPart of Hydro-Morphodynamics Version:1.04Revision:1542318May2011User Manual Delft3D-GISVIEWPublished and printed by:DeltaresRotterdamseweg185p.o.box1772600MH DelftThe Netherlandstelephone:+31883358273fax:+31883358582e-mail:info@deltares.nlwww:http://www.deltares.nlFor support contact:telephone:+31883358555fax:+31883358111e-mail:delft3d.support@deltares.nlwww:The screen pictures shown in this manual were produced during the development stages and may differ from the actual productCopyright©2011DeltaresAll rights reserved.No part of this document may be reproduced in any form by print, photo print,photo copy,microfilm or any other means,without written permission from the publisher:Deltares.Delft3D-GISVIEW User Manual Contents May20111.04.15423Contents1A guide to this manual11.1Introduction (1)1.2Typographical conventions (1)2Introduction to Delft3D-GISVIEW32.1Short description of the program functionality (3)2.2Installing the program (4)3Getting started53.1Starting Delft3D-GISVIEW/ArcMap (5)3.2Quitting the program (6)4Describing the user interface74.1Introduction (7)4.2Get results (7)4.3View results (9)4.4View vectors (10)5Remarks13 References15Deltares iiiMay2011 1.04.15423Contents Delft3D-GISVIEWUser Manualiv DeltaresDelft3D-GISVIEW User Manual A guide to this manual May20111.04.15423Chapter1A guide to this manual1.1IntroductionIn order to make this manual more accessible,a brief description of the contents of each of the chapters will be given here.This manual describes the operation of Delft3D-GISVIEW.Chapter2:Introduction to Delft3D-GISVIEW,a short overview of the program and the general functionality is given.Chapter3:Getting started,it is described how to start and quit the program,together with thefirst steps using the program.Chapter4:Describing the user interface,provides a detailed description of the User Interface.Chapter5:Remarks,gives some remarks about this application.1.2Typographical conventionsThroughout this manual,the following conventions in text formats help you to distinguish between different types of text elements.Example DescriptionWaves Boundaries Title of a window or sub-window.Sub-windows are displayed in the Module window and cannot be moved.Windows can be moved independently from the Module window,such as the Visualisation Area window.Deltares1May2011 1.04.15423A guide to this manual Delft3D-GISVIEWUser ManualExample DescriptionSave Item from a menu,title of a push button or the name ofa user interface inputfield.Upon selecting this item(click or in some cases doubleclick with the left mouse button on it)a related actionwill be executed;in most cases it will result in displayingsome other(sub-)window.In case of an inputfield you are supposed to enter inputdata of the required format and in the required domain.<\tutorial\wave\swan-curvi> <siu.mdw>Directory names,filenames,and path names are expressed between angle brackets,<>.For the Linux and UNIX environment a forward slash(/)is used instead of the backward slash(\)for PCs.“27081999”Data to be typed by you into the inputfields are displayedbetween double quotes.Selections of menu items,option boxes etc.are describedas such:for instance‘select Save and go to the nextwindow’.delft3d-menu Commands to be typed by you are given in the fontCourier New,10points.[m/s][-]Units are given between square brackets when used nextto the formulae.Leaving them out might result inmisinterpretation.2DeltaresDelft3D-GISVIEW User Manual Introduction to Delft3D-GISVIEW May20111.04.15423Chapter2Introduction to Delft3D-GISVIEW2.1Short description of the program functionalityThe program Delft3D-GISVIEW makes it possible to show results from Delft3D programs in the GIS environment of ArcMap R O(a product of ESRI R O ArcGIS R O suite).So Delft3D results are shown into maps1.The program is a so-called extension of ArcMap and thus is used within ArcMap(and not as a stand-alone program).Delft3D-GISVIEW is a postprocessing program of Delft3D and belongs to the visualisation tools.Figure2.1shows the suite of Delft3D programs.It is supposed that you are familiar with the ArcMap program as well with the calculation results(e.g.paramters)of the Delft3D programs.Till now,files of the type Communicationfile,Hydrodynamic mapfile,Waves mapfile, Sediment transport mapfile can be used.From thesefiles you can select parameters,times and layers,which is done in the same way as in the program Delft3D-GPP.After this selection a dataset is composed and shown in the GIS.The underlying result data is transformed into GIS data(a shapefile)and is presented and available as a layer in ArcMap.1ArcMap,ESRI,ArcGis,ArcMap are trade marks of ESRI Inc.,Redlands,California,USA.They are used in the manual because of the close relation of the program Delft3D-GISVIEW and the ESRI program ArcMap.Figure2.1:System architecture of Delft3DDeltares3May2011 1.04.15423Introduction to Delft3D-GISVIEW Delft3D-GISVIEWUser ManualSo you have all possibilities of ArcMap to classify the results,to print resulting maps,etc.2.2Installing the programInstalling the program is part of the installation of the Delft3D program suite.It is described in the manual that is supplied with these software.As a result of the installation,the program becomes a known extension of ArcMap.Its toolbar(the user interface)is available and active in the user interface of ArcMap.The toolbar is named”GISPlugins”.The program uses environment variables,which are set by the Delft3D installation.This new toolbar is used by each Delft3D program,which can be run in the ArcMap envi-ronment.In the left part of the toolbar you can choose the program you want to work with from a drop down menu.Remark:•Delft3D should be installed after ArcMap.4DeltaresDelft3D-GISVIEW User Manual Getting started May20111.04.15423Chapter3Getting started3.1Starting Delft3D-GISVIEW/ArcMapBecause of Delft3D-GISVIEW is an ArcMap extension you start ArcMap from an icon on your desktop,or via the Start menu.Then Delft3D-GISVIEW can be used by a specific toolbar.The toolbar is named”GISPlugins”.In order to work with Delft3D-GISVIEW,the resultfiles of a Delft3D calculation should be available.It is supposed you have the knowledge to activate or de-activate toolbars.As you know, ArcMap stores the latest user interface including the visible toolbars.So the next time it comes up with this user interface,you have composed.Figure3.1shows a user interface of ArcMap.You see the toolbar containing the text “Delft3D-GISVIEW4.01.01.This is a drop-down list to choose the Delft3D program you want to work with in ArcMap.Sofirst you start to select Delft3D-GISVIEW.Then the next step is to read a resultfile,by clicking on the menu Get results.Then click on item Add layer from Delft3D resultfiles.Afile selection box will come up.Navigate to a directory and choose a resultfile.A new window pops up andchoose a parameter,a time and a layer.use the button Add to add your selection to the atribute list.click the OK button,and as a result you will see a new layer in the map.Now the results can be classified in the map.At the right side of the menus in the toolbar youfind some bottons to get quick access for some commands.Move the mouse cursor slowly over the button,to see which command it is.This is just a short description,and Chapter4describes detailed the user interface. Remarks:Deltares5May2011 1.04.15423Getting started Delft3D-GISVIEWUser ManualFigure3.1:User interface of ArcMap•When you are clicking commands or buttons of the toolbar of Delft3D-GISVIEW,you have access to the program Delft3D-GISVIEW.•When clicking on the menus and tools of the ArcMap user interface,you are using ArcMap.3.2Quitting the programJust quit the ArcMap program to quit also Delft3D-GISVIEW.You can leave the program by selecting another Delft3D program(if available)in the drop down list of the toolbar.In this way you can get back to Delft3D-GISVIEW by selecting it again.6DeltaresDelft3D-GISVIEW User Manual Describing the user interface May20111.04.15423Chapter4Describing the user interface4.1IntroductionThe user interface of Delft3D-GISVIEW is the toolbar as shown in Figure4.1.The program Delft3D-GISVIEW has been selected from the drop down menu at the left side in this toolbar,as already mentioned in previous chapters.The toolbar has the menu Get results to read a resultfile of Delft3D.After all actions a layer (based on a shapefile)is added to the layers of the map.In this way you can add more layers from one ore more resultfiles of Delft3D to the map.The second menu Vectors can be used to view vectors from an already existing layer containing Delft3D results.This menu has two other items to change the size of the drawn vectors and to draw yes/no the vectorfield.For your convenience some often used menu items(commands)are also available as a button (the three buttons at the right side).When moving the mouse cursor slowly over these buttons you see the underlying command.4.2Get resultsThe menu Get results has the menu item Add layer from Delft3D resultfiing this command afile selection window comes up.In thisfile window you can navigate to a directory with resultfiles.Till now thefile types Communicationfile,Hydrodynamic mapfile,Waves mapfile,Sediment transport mapfile can be used(Deltares,2010,2008).Thefile window looks like Figure4.2.As you can see all knownfile types(<∗.dat>)can be shown and selected,or a specific known type can be shown and selected via the drop down list.After afile has been selected the following window comes up,see Figure4.3.With this window you make the selection of parameter,time and layer from Delft3D.Each selectionFigure4.1:Delft3D-GISVIEW toolbarMay2011 1.04.15423Describing the user interface Delft3D-GISVIEWUser ManualFigure4.2:File selection window to open Delft3D resultfilescan be added to a list and becomes an attribute of the layer in the map.Using your mouse cursor you can make a selection for parameter,time and layer,independent of each other.Selecting a parameter updates the list of available times and layers for that parameter.You can select more times by using the Shift or Control key.The Add button adds your selection to the list of attributes.You can remove one or all members of these list by the buttons Remove and Remove All.The attributes in the above window get a generated name,which is at the left side in the “Attribute”part.As you will see the names become the timestep Txxx and a description after it.These names become the attribute names of the layer in the map.Note that these attribute names must be different in one layer(shapefile),so they must different here in the“Attribute”part.This is especiallay important when you select both current magnitude and current direction to drawflow vectors.You can change this name by double clicking on it,type a new attribute name and confirm with the Enter key.You can use the F2key for the same purpose after selecting a row in the list of attributes. It is possible to compose a list of attributes for the layer(shapefile)in different ways.You can select a parameter at one layer and select several time steps.The attribute names are different(Txxx).You can select some parameters at different timesteps and at one ore more layers.Be aware that in this case attribute names at the left side may have the same name.Change this names into more meaningfull names.Using the OK button the resultfile is read to compose a dataset and this dataset is trans-formed into GIS data(a shapefile).The results now become a layer in ArcMap.These layers get names like D3D results...in the table of contents(TOC)of ArcMap.From this moment,you have all the tools and possibilities of ArcMap to classify,colour,print etc theDelft3D-GISVIEW User Manual Describing the user interface May20111.04.15423Figure4.3:Selection window for parameter,time and layeratrtributes of this GIS-data.You can ask for attribute values by using the I-tool of ArcMap. The above actions including the OK button,can be performed several times and each time a new layer of the composed dataset is added to the map in ArcMap.Therefor it is also possible to put results of different resultfiles from Delft3D into separate layers(shapefiles)to the map.Using the Cancel button nothing happens and you go back to the map in ArcMap.Each selection of parameter,time and layer in the above window becomes an attribute value of the GIS data.The geometry of the Delft3D grid of course is added to the GIS data.For Delft3D-GISVIEW the curvilinear grid of the model is transformed into polygons in the GIS. Each polygon(cell)has attribute value(s).So you have the concept of the well-known shapefile,which has one geometry(shape)column and one ore more attribute columns.4.3View resultsAs described in Section4.2results become layers in ArcMap.These layers have a name like D3D results....From then on,you can use all the possibilities of ArcMap to classify (colour)the results,to see the attribute table,to see attribute values of a polygon(=cell)by using the I-tool etc.Even you can save these layers into your own shapefile by exporting the data.The geometry of the Delft3D results consist of polygons for each cell of the curvilinear grid. Each polygon has attribute values.May2011 1.04.15423Describing the user interface Delft3D-GISVIEWUser ManualTo show the grid only,choose the“Hollow”colour and a value for the outline width.4.4View vectorsVector values like current velocity are drawn by Delft3D-GISVIEW as arrows on the map. In order to be able to do this the following actions have to be done.Vector values are also attribute values of the GIS data.So add these data to the composed dataset.Read the actions in Section4.1and see thefigure in this paragraph.There you will see the parameters current mag(horiz)and current dir.(horiz)are added to the attributes list.Change their attribute names into convenient names if you add more velocities to this list.As mentioned in section4.2each attribute name must be unique.Use the OK button to add the composed dataset as a layer to the map.The layer(the dataset)may contain vector values as well as scalair values.Use from the Vector menu the command Draw vectors from the results layer or use the button.When using this command a result layer(named as D3D result...)must be the active layer.Now you get the following window to select the attribute name for magnitude and direction of the vector value.Eventually use I-tool or attribute table of ArcMap to know the atribute names.Use OK button and the vectors will be drawn.When using the Cancel button the state of the map does not change.It means when there are no vectors,you will see no vectors.When there are vectors drawn,these vectors are drawn again.Drawing yes or no vectors,if their values are selected as mentioned above,can be done byusing the button or the command Draw yes/no the vectors from the Vector menu.Note that each time just one vector belonging to a time and a Delft3D layer will be drawn. Of course you can select new attribute values for the vector,belonging to another time and/or Delft3D layer.When using the command Change vector scale of the menu Vectors,you get a property window about the vectors.See Figure4.4.You will see the map layer and the attributefields of the currently drawn vectors.Vectors will be drawn bij the program in such a way that the vector length is related to the size of the Delft3D grid cell.This makes the map has no overlapping vectors(arrows).Delft3D-GISVIEW User ManualDescribing the user interface May20111.04.15423Figure4.4:Vector properties windowHowever you can change the size of the arrows and the number of drawn arrows by clicking the command Change vector scale of the menu Vectors.The following window pops up.You see several properties related tot the vectors.You canfill in the last2properties.Vector scale in GIS A factor for the vector scale.The length of the vectors in the map becomes the factor multipied by the mininum cell diameter of the Delft3D grid and multiplied by their ing this vector scale you can draw the most suitable vectorfield in the map.Min.gap between vector points Give the minimum gap(in pixels)on the screen between the start points of the vectors and this gap will be in all directions.So the number of drawn arrows can be reduced.The value0means that all vectors will be drawn.The gap is related to the screen and not to the map scale.So when zooming in you will see more arrows and when zooming out,less vectors.Note that the maximum size(value)of the vectors of all grid cells is given too.If you want to know the size(value)of the vector use the I-tool of ArcMap,which shows you the attribute values of a polygon(cell).May2011 1.04.15423Describing the user interface Delft3D-GISVIEWUser ManualDelft3D-GISVIEW User Manual Remarks May20111.04.15423Chapter5RemarksRemarks:•This version of Delft3D-GISVIEW uses an executable forfile selection and selecting parameters,times and layers from Delft3D calculations.All things go smoothly.How-ever,if you move the windows,the screen of ArcMap will not be refreshed.This will be improved in upcomming releases.•Do not use the parameter“Model grid”from the window as shown in paragraph4.2 Get Results.The program will crash.Instead use an attribute of the layer and the choose the“Hollow”colour and a value for the outline width.•You see the attribute m and n which are grid indices of the curvilinear grid used internally by Delft3D-FLOW.May2011 1.04.15423Remarks Delft3D-GISVIEWUser ManualDelft3D-GISVIEW User Manual References May20111.04.15423ReferencesDeltares,2008.Delft3D-WAVE User Manual.WL|Delft Hydraulics,Delft,The Netherlands, 3.03ed.7—,2010.Delft3D-FLOW User Manual.WL|Delft Hydraulics,Delft,The Netherlands,3.14 ed.7May2011 1.04.15423References Delft3D-GISVIEWUser Manual。

MATLAB中文手册命令汇总

MATLAB中文手册命令汇总

1.2、
函数极值、零点求解 P3 求解函数零点:xsolv=fzero(‘func’, x0 )其中 func 可以说用户自定义函数名或者内联 inline 函数定义的函数, x0 为开始计算的一个初始近似值。 求解一元函数 fun 在区间[a,b]中的无条件极小值(点):[x,f]=fminbnd(fun,a,b)其中 fun 定义同上,x 存放极小值点,f 存放极小值。 求解多元目标函数 fun 在点 x0 (向量)附近的无条件极小值(点): [x,f]=fminsearch(fun, x0 )
axis off 或者 axis(‘off’) 1.1.5、绘制二元函数图像 %绘制网格 %绘制完整表面
%使绘图区域为正方形
contour %绘制等高线 waterfall sphere(n) %专用于绘制单位球面,n 默认值为 20. 1.1.6、在同一画面上建立 n 个坐标系(可同时分区显示 n 个图形) Subplot(m,n,p) Eg:画函数 z %把一个画面分成 m*n 个图形区域,p 代表当前区域号; 的图像,其中(x,y)属于[-3,3]x[-3,3].命令如下: %准备数据
【命令集 27】矩阵函数 P44 expm(A): 使用 Pade 近似法计算 e expm2(A):使用泰勒级数计算 e
A A
expm3(A):使用特征值和特征向量计算 e logm(A):计算 A 的对数
1
A
2 sqrtm(A):计算 A ,当 A 是对称正定阵时,平方根唯一;
polyvalm(p,A)估算矩阵 A 的一个多项式,p 为多项式系数向量 3.6、逻辑运算符 P46 A&B、A|B、 A 、xor(A,B) 3.7、逻辑函数 【命令集 29】查找非零元素 P47 find(x): 返回一个 x 中包含非零元素的下标向量; find(A):返回一个列向量,表示 A 中包含非零元素的下标向量 [u,v]=find(A):返回向量 u 和 v,记录 A 中非零元的下标; [u,v,b]=find(A):返回向量 u,v,b,其中 u,v 记录 A 中非零元下标,b 记录非零元素的值。 注:find 命令可以和关系运算符一起使用,如 index=find(x>0.5) 【命令集 30】逻辑函数(一) P30 any(x): 当向量 x 中含有非零元时返回 1,否则返回 0; any(A): 对矩阵 A 进行列运算,根据相应列是否含有非零元,返回一个带 1 和 0 的行向 量; all(x): 如果向量 x 的元素都非零,这返回 1,否则 0; all(A): 对矩阵 A 进行列运算,根据相应列是否都是非零元,返回一个带 1 和 0 的行向 量; any(any(A)),all(all(A))返回一个标量 1 或 0; 【命令集 31】逻辑函数(二) P30-P31 isnan(A): 返回一个与 A 同维的矩阵,对应 A 中‘NaN’处为 1,其余全为 0; isinf(A): 返回一个与 A 同维的矩阵,对应 A 中‘inf’处为 1,其余全为 0; isempty(A): 如果 A 是一个空矩阵,这返回 1,否则返回 0; isequal(A,B):当 A 与 B 相同时返回 1; isreal(A):当 A 是一个实矩阵时返回 1; isfinite(A):返回一个与 A 维数相同的矩阵, 在该矩阵中, 若对应 A 中元素是有限的则相 应位置为 1,否则为 0;

DEFORM-3D-操作指南(清华大学)

DEFORM-3D-操作指南(清华大学)

机械工程系版权所有翻印必究DEFORM-3D v5.0基本操作指南编写方刚刘海军清华大学机械工程系2004年02月机械工程系版权所有翻印必究DEFORM 软件简介DEFORM 系列软件是由位于美国Ohio Clumbus 的科学成形技术公司(Science Forming Technology Corporation)开发的。

该系列软件主要应用于金属塑性加工、热处理等工艺数值模拟。

它的前身是美国空军Battelle 试验室开发的ALPID 软件。

在1991年成立的SFTC 公司将其商业化,目前,DEFORM 软件已经成为国际上流行的金属加工数值模拟的软件之一。

主要软件产品有:DEFORM-2DDEFORM-3DDEFORM-PCDEFORM-HT ModuleDEFORM-Tools机械工程系版权所有翻印必究练习01金属塑性成形的前处理前处理是有限元分析的主要步骤,它所占用的操作时间占到用户操作时间的80%,有很多定义都是在前处理阶段进行的。

前处理出要包括:1.几何模型建立或导入2.网格划分3.材料定义4.物体的接触和摩擦定义5.模拟参数的设定机械工程系版权所有翻印必究几何模型建立或导入在DEFORM-3D 软件中,不能直接建立三维的几何模型,必须通过其他CAD/CAE 软件建模后导入到系统中。

目前,DEFORM-3D 的几何模型接口格式有:1.STL: 几乎所有CAD 软件都有这个接口,它是通过一系列的三角形拟合曲面而成;2.UNV: SDRC 公司(现合并到EDS 公司)软件IDEAS 的三维实体造型及有限元网格文件格式,DEFORM 接受其划分的网格。

3.PDA: MSC 公司的软件Patran 的三维实体造型及有限元网格文件格式。

4.AMG :这种格式DEFORM 存储已经导入的几何实体。

机械工程系版权所有翻印必究网格划分在DEFORM-3D 中,如果用其自身带的网格剖分程序,只能划分四面体单元,这主要是为了考虑网格重划分时的方便和快捷。

MATLAB中的三维绘图函数总结_百度文库

MATLAB中的三维绘图函数总结_百度文库

2015/5/23
MATLAB中的三维绘图函数总结_­2y­3
­2
­1 x
0
Peaks(60):
Peaks
5
0
­5
2 0 ­2 y ­3 ­2 ­1 x 0 1
2
3
Peaks(100):
Peaks
5
0
/link?url=6ILG2zDJbXhoWlef7TzAyLb73N3XKdrOzj9kzfUw5oKvbCSilGthT­W4N3zz9H18uVSRNclTOTGNpd0V4bp­rIgCUGMd… 5/14
0.5
0
­0.5 2 1 0 ­1 ­2 ­2 ­1 1 0 2
3、为了方便测试立体绘图, MATLAB 提供了一个 peaks 函数,可产生一个凹凸有致的曲 面,包含了三个局部极大点及三个局部极小点,其方程式2
2 ( y 1)
x 3 5 x 2 y 2 1 ( x 1) 2 y 2 10 ( y 2 一、基本 XYZ 举报文档 立体绘图命令(画出函数 z xe 形成的立体网状图为例)
MATLAB中的三维绘图函数总结
(120人评价) | 8887人阅读 | 504次下载 | m​ a​ t​ l​ a​ b​ ​ 三​ 维​ 绘​ 图​ 函​ 数​ 介​ 绍​ 及​ 生​ 成​ 的​ 图​ 行
13/14
2015/5/23
MATLAB中的三维绘图函数总结_/link?url=6ILG2zDJbXhoWlef7TzAyLb73N3XKdrOzj9kzfUw5oKvbCSilGthT­W4N3zz9H18uVSRNclTOTGNpd0V4bp­rIgCUGM…
11/14
2015/5/23
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Delft3D-MATLAB Interface to MATLAB for flexibility in visualisation and data analysisUser ManualAugust, 2004User Manual Delft3D-MATLABPublished and printed by:WL | Delft Hydraulicsmain officeRotterdamseweg 185p.o. box 1772600 MH DelftThe Netherlandstelephone +31 15 285 85 85fax +31 15 285 85 82internet info@wldelft.nlwww http://www.wldelft.nlFor support contact:e-mail: delft3d.support@wldelft.nlwww: http://www.wldelft.nl/d3d/telephone: +31 15 285 85 55fax: +31 15 285 85 82Copyright© 2004 WL | Delft HydraulicsAll rights reserved. No part of this document may be reproduced in any form by print, photo print, photo copy, microfilm or any other means, without written permission from the publisher: WL | Delft Hydraulics.2004 Delft3D-MATLAB Contents August, User Manual Version 2.07Contents1Introduction...........................................................................................................1–11.1Version information...................................................................................1–11.2Compatibility.............................................................................................1–11.3List of major changes.................................................................................1–12Low level routines.................................................................................................2–12.1Open NEFIS file VS_USE........................................................................2–12.2Display information of groups and elements VS_DISP............................2–22.3Get data from a NEFIS file VS_LET/VS_GET........................................2–52.4Determine the type of a NEFIS file VS_TYPE........................................2–82.5Find group to which element belongs VS_FIND.....................................2–92.6Find differences between two NEFIS files VS_DIFF................................2–93High level routines................................................................................................3–13.1DRAWGRID..............................................................................................3–13.2THINDAM................................................................................................3–33.3TRIRST......................................................................................................3–63.4WLDEP......................................................................................................3–63.5WLGRID...................................................................................................3–83.6XYVELOC................................................................................................3–83.7QPREAD.................................................................................................3–103.8QPFOPEN................................................................................................3–123.9QPFILE....................................................................................................3–134QUICKPLOT functionality.................................................................................4–15References..............................................................................................................5–12004 Delft3D-MATLAB Introduction August,2.07 User Manual Version 1IntroductionThe MATLAB interface for Delft3D has been developed to expand the flexibility in theprocessing of Delft3D data in general and of NEFIS data files in particular. The interfaceconsists of three parts:•First, low level routines to access data stored in NEFIS files. The routines aredescribed in the second chapter of this manual. A thorough knowledge of theDelft3D system is required.•Second, high level routines to access the data. These functions support a pre-defined(but extensive) set of spatial data stored in the NEFIS files. Routines for reading andwriting flow restart files, grid and depth files are also provided. These routines aredescribed in Chapter 3.•Third, a graphical user interface for basic plotting. The QUICKPLOT interface isdescribed in Chapter 4.All functions are provided in source code. The routines described in chapters three and fourcan be used as examples for development of other routines.1.1Version informationThis manual describes the functionality of Delft3D-MATLAB interface version 2.07.00 andlater versions with minor revisions.1.2CompatibilityThe routines have been tested for compatibility with the Windows versions of MATLAB 5.3(R11), 6.5 (R13) and 7.0 (R14). Due to restrictions in the MEX (i.e. MATLAB sharedlibrary) files used, the toolbox is only available for MATLAB 6.0 and later on Linux.1.3List of major changesVersion Changes2.07.00 Update of QUICKPLOT interface to match standalone version 2.07.00 ofDelft3D-QUICKPLOT2.05.00 Update of QUICKPLOT interface to match standalone version 2.05.00 ofDelft3D-QUICKPLOTDelft3D-MATLAB Low level routines August, 20042.07 User Manual Version 2Low level routinesA set of MATLAB files has been created to access NEFIS files from within MATLAB. Thefollowing functions have been implemented:vs_use open NEFIS filevs_disp display information of groups and elements contained in a NEFIS filevs_let/vs_get get data from a NEFIS filevs_type determine type of a NEFIS filevs_find find group to which an element belongsvs_diff find differences between two NEFIS filesIf no NEFIS file is specified when using the commands vs_disp, vs_let, vs_get,vs_type, and vs_find the last opened NEFIS is used. The commands are discussed belowin more detail.Remark:•Spatial data sets are stored in the NEFIS file with the M and N dimensions reversed.2.1Open NEFIS file VS_USEPurposeOpen/scan NEFIS fileSyntaxNfs=VS_USE(FileName)DescriptionNfs=VS_USE(FileName) opens a NEFIS file where the filename is the name of either thedefinition or the data file, and returns a handle Nfs to the file, which must be used whencalling the other commands. When no filename is specified, the command will ask for one.The vs_use command scans the structure of the definition and data files; this will takesome time. MATLAB can store the structure information in a file with the same name base(as indicated by filename) and extension <*.mat>, and read that information when the file isre-opened a next time. This used to be the default behaviour but is now optional: use optionusemat. The old option nomat is still accepted and overrules usemat. If changes were madeto the <*.def> and/or <*.dat> files, you should add refresh as additional argument to preventreading the existing mat-file. The addition of the argument quiet as last argument reads thefile structure without showing the wait bar. When the option debug is used a fileAugust, 2004 Low level routines Delft3D-MATLABManual Version2.07 User<vs_use.dbg> is created in the default temporary directory, containing information on thereading of the data structure from the NEFIS file.The returned Nfs can be interpreted as a file handle as used in all programmingenvironments for file access. However, it is not an integer but a structure containing theinternal structure of the NEFIS file.Example» Nfs=vs_useNfs =FileName: 'I:\OCTOPUS\sbod_gf3.66_tot\output\TS11520000\com-d16'DatExt: '.dat'DefExt: '.def'Format: 'b'gNames: [21x368 char ]gData: [21x27 double]eNames: [89x112 char ]eData: [89x11 double]2.2Display information of groups and elementsVS_DISPPurposeDisplay NEFIS file contents.SyntaxVS_DISP(Nfs)Output=VS_DISP(Nfs)VS_DISP(Nfs,[])Output=VS_DISP(Nfs,[])VS_DISP(Nfs, GroupName)Output=VS_DISP(Nfs, GroupName)Output=VS_DISP(Nfs, GroupName,[])Output=VS_DISP(Nfs,GroupName,ElementName)DescriptionVS_DISP(Nfs) lists all group names, group elements, and all group and element propertieslike the <disp stat> command of the Viewer Selector.VS_DISP(Nfs,[]) lists group names, group dimensions, and number of elements per grouponly. This can be used as a short summary of the file contents.Output=VS_DISP(Nfs) and Output=VS_DISP(Nfs,[]) return a char matrix containing thenames of the groups.Delft3D-MATLAB Low level routines August, 20042.07 User Manual VersionVS_DISP(Nfs, GroupName) lists all group elements, and all element properties like the<disp GroupName> command of Viewer Selector.Output=VS_DISP(Nfs, GroupName) returns a char matrix containing the names of theelements of the group.Output=VS_DISP(Nfs, GroupName,[]) gives detailed data about the specified groupcontained in the Nfs structure. The information includes group data name, cell name,definition name, number of elements, dimensions, and the offsets within the NEFIS file atwhich locations data of the group are stored.Output=VS_DISP(Nfs,GroupName,ElementName) gives detailed data about the specifiedelement contained in the Nfs structure. The information includes element description, unitand size.Examples» vs_disp(Nfs)Groupname:BOTNT Dimensions:(1)No attributesNTBOT INTEGER * 4 [ - ] ( 1 )Number of bottom fields in group BOTTIMGroupname:BOTTIM Dimensions:(24)No attributesTIMBOT INTEGER * 4 [ TSCALE] ( 1 )Communication times bottom fields rel. to referencedate/timeDP REAL * 4 [ M ] ( 98 62 )Bottom depth in bottom points, positive downwardsand so on …» vs_disp(Nfs,[])BOTNT (1) - No attributes, 1 element(s).BOTTIM (24) No attributes, 2 element(s).PARAMS (1) - No attributes, 8 element(s).GRID (1) - No attributes, 16 element(s).SPECPOINTS (1) - No attributes, 4 element(s).BOUNDCNST (1) - No attributes, 8 element(s).KENMCNST (1) - No attributes, 3 element(s).INITBOT (1) - No attributes, 4 element(s).ROUGHNESS (1) - No attributes, 3 element(s).TEMPOUT (1) - No attributes, 4 element(s).com-version (1) - No attributes, 3 element(s).KENMNT (1) - No attributes, 1 element(s).KENMTIM (1) - No attributes, 3 element(s).CURNT (1) - No attributes, 1 element(s).CURTIM (1) - No attributes, 7 element(s).DWQTIM (1) - No attributes, 5 element(s).TAUTIM (1) - No attributes, 1 element(s).INITI (1) - No attributes, 1 element(s).TRANNT (1) - No attributes, 2 element(s).BOUNDMOR (1) - No attributes, 1 element(s).TRANSTIM (1) - No attributes, 11 element(s).» Output=vs_disp(Nfs) %or Output=vs_disp(Nfs,[])Output =August, 2004 Low level routines Delft3D-MATLABManual2.07 User VersionBOTNTBOTTIMPARAMSGRIDSPECPOINTSBOUNDCNSTKENMCNSTINITBOTROUGHNESSTEMPOUTcom-versionKENMNTKENMTIMCURNTCURTIMDWQTIMTAUTIMINITITRANNTBOUNDMORTRANSTIM» vs_disp(Nfs,'BOTTIM')Groupname:BOTTIM Dimensions:(24)No attributesTIMBOT INTEGER * 4 [ TSCALE] ( 1 )Communication times bottom fields rel. to referencedate/timeDP REAL * 4 [ M ] ( 98 62 )Bottom depth in bottom points, positive downwards» Output=vs_disp(Nfs,'BOTTIM')Output =TIMBOTDP» Output=vs_disp(Nfs,'BOTTIM',[]) % get group informationOutput =Name: 'BOTTIM'GroupDatOffset: 8560DefName: 'BOTTIM'GroupDefOffset: 12728CellName: 'BOTTIM'CellDefOffset: 12660CellNByte: 24308CellNElm: 2NDim: 1VarDim: 1SizeDim: 24OrderDim: 1Attrib: [1x1 struct]» Output=vs_disp(Nfs,'BOTTIM','DP') % get element informationDelft3D-MATLAB Low level routines August, 20042.07 User Manual VersionOutput =GrpNname: 'BOTTIM'ElmName: 'DP'ElmQuantity: ''ElmUnits: '[ M ]'ElmDescription: 'Bottom depth in bottom points, positivedownwards'ElmDefOffset: 12496NDim: 2SizeDim: [98 62]TypeVal: 5NByteVal: 4NByte: 243042.3Get data from a NEFIS file VS_LET/VS_GETPurposeRead data from file (groups as columns or cells).Syntax[Data,Succes]=VS_LET(Nfs, GroupName,GroupIndex,ElementName,ElementIndex)[Data,Succes]=VS_GET(Nfs, GroupName,GroupIndex,ElementName,ElementIndex)DescriptionData=VS_LET(Nfs, GroupName,GroupIndex,ElementName,ElementIndex)Data=VS_GET(Nfs, GroupName,GroupIndex,ElementName,ElementIndex)These commands read the requested element from the specified group from the specifiedfile. The GroupIndex should be a 1x N cell array, where N equals the number of dimensionsof the group. Each element of the cell array should contain either 0 (zero) or the indices ofthe cells that should be read. The 0 means that all cells should be read. The ElementIndexshould be a 1x M cell array, where M equals the number of dimensions of the element.Again, each element of the cell array should contain either 0 (zero) or the indices of theelements that should be read, where 0 means that the complete dimension should be read.When the option debug is used a file <vs_let.dbg> is created in the default temporarydirectory, containing information on the reading of the data from the NEFIS file.The command VS_LET reads all data in one big matrix, using the first dimensions for thegroups and the last dimensions for the elements. The command vs_get returns a matrixcontaining the data if data from only one group is read, and a cell array of matrices whendata from more than one group is read.An additional output option succes [Data,Succes]=...indicates whether the data has beenread successfully.August, 2004 Low level routines Delft3D-MATLABManual Version2.07 UserWhen the GroupIndex and/or ElementIndex are skipped all fields of the group/element areselected. When no GroupName or ElementName is specified or when an error isencountered while interpreting the input a graphical user interface is presented to enter theselection. To help new users to get acquainted to the command line syntax of the VS_GETand VS_LET routines, the command line `-cmdhelp' option is provided. When used, theroutine does not actually load the data, but it displays the command line equivalent of theselection that you have made in the user interface.ExamplesFor example: To read from the depth data the first 10 rows (and of those rows all columns)of the 1st, 3rd, 5th, 7th, and 9th time steps, you should type:» Data=vs_let(Nfs,'BOTTIM',{1:2:10},'DP',{1:10 0});which returns a 5x10x62 matrix; or» Data=vs_get(Nfs,'BOTTIM',{1:2:10},'DP',{1:10 0})Data =[10x62 double][10x62 double][10x62 double][10x62 double][10x62 double]Indicating that a 5 x 1 cell array is returned, each cell containing one bottom field (10 x 62data points). Character strings are contained in cell arrays. The most common cases ofreading from are:Data=vs_get(Nfs,'BOTTIM',{0},'DP',{0 0})Read all bottom data completely. Group/Element indices containing only zeros don’t have tobe specified. So, the following is also accepted:Data=vs_get(Nfs,'BOTTIM','DP')Data=vs_get(Nfs,'BOTTIM',{0},'DP',{n 0}), orData=vs_get(Nfs,'BOTTIM','DP',{n 0})Read cross-section n at all time stepsData=vs_get(Nfs,'BOTTIM',{t},'DP',{0 0}), orData=vs_get(Nfs,'BOTTIM',{t},'DP')Read the bottom at time step t. This will return a 10 x 62 matrix if vs_get is used, and a1x10x62 matrix if vs_let is used.Data=vs_get(Nfs,'BOTTIM',{0},'DP',{n m}), orData=vs_get(Nfs,'BOTTIM','DP',{n m})User Manual Version 2.07WL | Delft Hydraulics 2–7Read the variation of the bottom at indicated (n,m )-point. If this is followed by aData=[Data{:}]; command to convert the cell array containing single values into a vector; it can be replaced byData=vs_let(Nfs,'BOTTIM','DP',{m n})which gives that result immediately and is faster.When besides the Nfs no further arguments are used (or when no element name is specified), an interface will appear asking for the other arguments. Adding the string ‘quiet’ as last parameters will suppress the wait bar during loading. When ‘*’ is specified as element name all elements of the group are returned; if an element index is specified it is ignored. Example:Data=vs_let(Nfs,'BOTTIM',{1:2:10},'*')returnsData =TIMBOT: [5x1 double] DP: [5x10x62 double]andData=vs_get(Nfs,'BOTTIM',{1:2:10},'*')returns the data of five time stepsData =5x1 struct array with fields: TIMBOT DPTo assist the novice user with the syntax of the VS_LET and VS_GET commands a help functionality has been added to these functions which allows the interactive generation of command lines. This functionality is activated by supplying ‘-cmdhelp’ as one of the input arguments. For instance:» vs_let -cmdhelpresults after the following data has been entered in the user interfaceVersion 2.07 User Manual2–8 WL | Delft Hydraulicsin the following output stringData=vs_let(NFStruct,'BOTTIM',{[ 1:2:9 ]},'DP',{[ 1:10 ],0});You can copy this string into a text editor for use in a script. As indicated above, variations on the syntax are allowed. The following line is also validData=vs_let('BOTTIM',{1:2:9},'DP',{1:10,1:73});The result will be exactly the same provided that the variable NFStruct in the first command line contains the information of the last opened NEFIS file.2.4 Determine the type of a NEFIS fileVS_TYPEPurposeShow type of NEFIS file.SyntaxType=VS_TYPE(Nfs)DescriptionThe function returns the type of the loaded NEFIS file. Currently the following NEFIS files are detected: ‘Delft3D-com’, ‘Delft3D-trim’, ‘Delft3D-trih’, ‘Delft3D-trid’ ‘Delft3D-tram’, ‘Delft3D-trah’, ‘Delft3D-botm’. Other NEFIS files will return ‘unknown’. For example:Example» Type=vs_type(Nfs)User Manual Version 2.07WL | Delft Hydraulics 2–9Type =Delft3D-com2.5 Find group to which element belongsVS_FINDPurposeFind elements in a NEFIS file.SyntaxGroups=VS_FIND(Nfs, ElementName)DescriptionThe function returns a list of group names containing the specified element. For example the element ‘TIMCUR’ occurs in several groups of the com-file:Example» Groups=vs_find(Nfs,'TIMCUR')Groups =KENMTIM CURTIM DWQTIM2.6 Find differences between two NEFIS files VS_DIFFPurposeCompare NEFIS file contents and find differences in groups, elements and data.SyntaxVS_DIFF(Nfs1,Nfs2)DescriptionThe function analyses the specified NEFIS files for differences. The analyses searches first for differences in the contained groups. If it finds differences it stops, if not it continues to search for differences in the elements, element properties, and element data.Version 2.07 User Manual2–10 WL | Delft HydraulicsExampleThe following comparison between two com-files, of which the first was obtained by a restart run from the second one, indicates• differences in the water and sediment transport data fields;• a difference in the group properties of the BOTTIM group (which is caused by oneadditional depth field); and• differences in the ‘RUNTXT’ and ‘SIMDAT’ texts.» vs_diff(Nfs,Nfs2)Comparing NEFIS files ...File 1: I:\OCTOPUS\sbod_gf3.66_tot\output\TS11520000\com-d16 File 2: I:\OCTOPUS\sbod_gf3.66_tot\output\TS11160000\com-d16Data of element NTBOT of group BOTNT differ. Group properties differ for: BOTTIMData of element QU of group CURTIM differ. Data of element QV of group CURTIM differ. Data of element S1 of group CURTIM differ.Data of element TIMCUR of group CURTIM differ. Data of element U1 of group CURTIM differ. Data of element V1 of group CURTIM differ.Data of element TIMCUR of group DWQTIM differ. Data of element KFU of group KENMTIM differ. Data of element KFV of group KENMTIM differ. Data of element TIMCUR of group KENMTIM differ. Data of element TAUMAX of group TAUTIM differ. Data of element TSEDB of group TRANSTIM differ. Data of element TSEDE of group TRANSTIM differ. Data of element TTXA of group TRANSTIM differ. Data of element TTYA of group TRANSTIM differ.Data of element RUNTXT of group com-version differ. Data of element SIMDAT of group com-version differ. ... comparison finished.User Manual Version 2.07WL | Delft Hydraulics 3–13High level routinesAlthough the low level routines provide access to all data in the NEFIS files, obtaining auseful, consistent data set can be difficult. For instance, to plot a 2D vector field you have to combine the information stored at about seven locations in the Delft3D communication file. Therefore, a number of high level routines has been provided to simplify the plotting and data retrieval operations. Routines are provided for plotting a grid (with grid number labels), plotting thin dams and inactive velocity points, and retrieving data to plot velocity vectors. Functions are also provided for reading and writing Delft3D-RGFGRID grid files, Delft3D-QUICKIN depth files, and Delft3D-FLOW restart files.3.1 DRAWGRIDPurposePlot the morphological grid.SyntaxDRAWGRID(NFStruct)[X,Y]=DRAWGRID(NFStruct); DRAWGRID(X,Y)DescriptionDRAWGRID(NFStruct) where NFStruct is the structure obtained from the VS_USE command. The function adds the morphological grid (that is, the user-defined grid) to the current axes. <trim-*>, <tram-*>, <botm-*>, and <com-*> files are supported. The morphological grid equals the grid specified in the input file; the bed level points are specified on the grid line crossings.[X,Y]=DRAWGRID(NFStruct) returns the X and Y co-ordinates, but it does not actually draw the morphological grid.DRAWGRID(X,Y) draws the user specified grid in the current axes.This function accepts a number of optional arguments, which consist of property - value pairs similar to those use by the MATLAB SET command:DRAWGRID(…,'optionname1',optionval1,'optionname2',optionval2,…) The supported options areVersion 2.07 User Manual3–2 WL | Delft Hydraulics• 'color'The value can be an RGB-triplet, a colour character ('r','g','b','c','m','y','k','w'), or the string 'ortho' for colouring based on the orthogonality of grid, 'msmo' for the M-smoothness of grid, 'nsmo' for the N-smoothness of grid • 'm1n1'[N M] number of grid point(1,1). Useful when plotting only part of the grid. • 'fontsize'The size of the font used for grid numbering (default 4) • 'gridstep'Label step used for grid numbering (default 10). For instance, 5 will number every fifth grid line. If grid step is [], grid lines are not labelled. • 'thicklength'Length of ticks in axes co-ordinates or ‘auto’ (default) • 'parent'The axes handle in which to plot grid (default the current axes, gca ) • 'clipzero'By default co-ordinate pairs of (0,0) are clipped. Set to 'off' to plot co-ordinates at (0,0))Example» G=wlgrid('read','D:\wl\delft3d\tutorial\flow\f33\f33.grd')G =X: [14x21 double] Y: [14x21 double] Enclosure: [15x2 double]FileName: 'D:\wl\delft3d\tutorial\flow\f33\f33.grd'» drawgrid(G.X,G.Y,'fontsize',8,'gridstep',4) » set(gca,'dataaspectratio',[1 1 1])Figure 3-1Grid layout from the Friesian Tidal Inlet modelUser Manual Version 2.07WL | Delft Hydraulics 3–33.2 THINDAMPurposePlot dams, weirs and vanes.SyntaxTHINDAM(NFStruct,T)THINDAM(NFStruct,T,'3D')THINDAM(XCOR,YCOR,UDAM,VDAM) THINDAM('xyw',XDAM,YDAM,WDAM) THINDAM(..., 'PropertyName',PropertyValue) H=THINDAM(...) [X,Y]=THINDAM(...) [X,Y ,M,N]=THINDAM(...) [X,Y ,Z]=THINDAM(...)[X,Y ,BOTTOM,TOP]=THINDAM(...)[X,Y ,BOTTOM,TOP,M,N]=THINDAM(...)DescriptionTHINDAM(NFStruct,T) plots the KFU/V (drying/flooding) dams for time step T if T>0. It plots the KCU/V thin dams if T==0 (default if T is not specified). The function supports <trim-*> and <com-*> files.THINDAM(NFStruct,T,'3D') same as above but now the dams will be plotted as 3D surfaces based on the bottom and water level information in the specified NEFIS file, <trim-*> or <com-*> file.THINDAM(XCOR,YCOR,UDAM,VDAM) plots the specified U and V dams on the specified grid. The XCOR and YCOR represent the bottom points. Valid entries for UDAM and VDAM are:• matrix of same size as XCOR/YCOR with a 1 representing a dam and a 0 indicatingno dam.• D x 2 matrix specifying the N, M co-ordinates of the dams• D x 4 matrix specifying the begin/end N, M co-ordinates of the dams like in theDelft3D input files.THINDAM('xyw',XDAM,YDAM,WDAM,...) plots dams with their centre at specified (XDAM,YDAM) locations with specified width/length WDAM. This function is useful for non-grid oriented dams.Version 2.07 User Manual A 3D effect can be added to these user-specified dams by specifying bottom and top levelsusing THINDAM(..., 'bottom',<bottom_args>, 'top',<top_args>). It plots the dams as 3Dsurfaces with specified top and bottom elevations. The elevation data should be specifiedwith positive direction up. Additional supported options are:•'angle',<angle_args>The dams/vanes are rotated to match the specified angle in degrees with respect tothe positive X-axis (positive angle in anti-clockwise direction).•'color',<color_args>The dams are coloured using the specified data.•'thickness',<thickness_args>The thickness of the dams is specified (default 0).Valid entries for all options are:• a constant, uniform value for all dams• a matrix of same size as XCOR/YCOR containing data in the depth points.• a matrix of same size as XCOR/YCOR containing data in the water level points. To distinguish this entry from the former you need to add the string 'H' or 'S' as an extraargument after the matrix. For example THINDAM(... ,'top',ELEVMATRIX,'H', ...)indicates that the top level of the dams are derived from the specified data in waterlevel points (the value will be used uniformly along each elementary dam).•two matrices of same size as XCOR/YCOR containing data in the U and V points.•two D x s arrays specifying the property of the individual dams. If the array is D x 1 the value is constant along each elementary dam. If the array is D x 2 the first valueis taken for the dam end with lowest (N,M) while the second elevation for the damend with highest (N,M). The first array specifies the elevation for dams in Udirection the second array for dams in the V direction. For example THINDAM(...,'top',ELEVU,ELEVV, ...). This option cannot be used in combination with option 1for the UDAM and VDAM entries. The number of values should match the numberof dam records/elementary dams.If a colour data field has been specified, there are a few more options available:•‘shape’,<type>The dam shape: ‘dam’ (default) or ‘rhombus’.•‘drawdams’,<onoff>Flag to draw dams. Can be set to ‘on’ (default) or ‘off’.•‘drawlabels’,<onoff>Flag to draw the colour values as text labels. Can be set to ‘on’ or ‘off’ (default).•‘labelformat’,<format>Defines the format for displaying the values (default ‘%g’)•‘fontsize’,<size>Defines the size of the labels.If the 'xyw' syntax is used, then valid entries for the options are• a constant (uniform value for all dams), and3–4 WL | Delft Hydraulics。

相关文档
最新文档