南京邮电大学系统工程实验报告.docVIP

  • 189
  • 0
  • 约3.71千字
  • 约 16页
  • 2019-06-22 发布于江西
  • 举报
PAGE 2 PAGE 3 课内实验报告 课 程 名: 系统工程 任课教师: 专 业: 学 号: 姓 名: 二○ 一二 至二○ 一三 年度 第 1 学期 南京邮电大学 经济与管理学院 《 系统工程》课程实验报告 实验内容及基本要求: 实验项目名称: 实验类型:设计 每组人数: 1 实验内容及要求: 1) 了解Netlogo编程语言的特点和基本语法。 2) 用系统动力学建模工具完成狼吃羊生态系统模型的仿真和仿真流程分析。 实验过程与结果: 一 系统动力学建模 第一步:羊群繁殖 在NetLogo里打开一个新模型,并启动系统动力学建模工具。 该模型中包括狼群和羊群,从羊群开始建模。首先创建一个存量Stock,保存羊的数量。该存量命名为sheep,初始值设为240,并选择羊群始终不能为负。 (3)创建一个进入羊群存量的流量Flow,来表示伴随着羊的出生而导致的数量的增加,命名为sheep-births,设置其表达式为sheep-birth-rate * sheep (4)创建一个变量Variable作为羊的出生率,命名为sheep-birth-rate,设置它的值是0.04 (5)建立一条Link从存量sheep到sheep-births流量 (6)创建一条Link从变量sheep-birth-rate到sheep-births (7)NetLogo流图产生的代码 二 NetLogo集成 (1)构建NetLogo模型来运行由流图产生的代码,构建system-dynamics-setup和system-dynamics-go例程,代码如下: (2)创建一个setup按钮 (3) 创建go按钮,设为forever (4) 创建sheep监视器 (5)创建绘图populations,提供画笔sheep和wolves 三 系统仿真狼捕食羊 (1)在原有基础上增加一个存量Stock,命名为wolves,设初值为90 (2) 创建相应的变量、流和连接,如图: 给各个变量、流和连接命名,设置初值表达式,分别为: (4)添加一条从wolves到sheep-deaths的连接,一条从wolves到wolves-deaths的连接,如图所示: 四 运行程序 (1)运行过程,如图所示: (2)运行结果,如图所示: 五 程序代码 ;; System dynamics model globals globals [ ;; constants sheep-birth-rate predation-rate wolf-death-rate predator-efficiency ;; stock values sheep wolves ;; size of each step, see SYSTEM-DYNAMICS-GO dt ] ;; Initializes the system dynamics model. ;; Call this in your models SETUP procedure. to system-dynamics-setup reset-ticks set dt 1.0 ;; initialize constant values set sheep-birth-rate 0.04 set predation-rate 3.0E-4 set wolf-death-rate 0.15 set predator-efficiency .8 ;; initialize stock values set sheep 240 set wolves 90 end ;; Step through the system dynamics model by performing next iteration of Eulers method. ;; Call this in your models GO procedure. to system-dynamics-go ;; compute variable and flow values once per step let local-sheep-births sheep-births let local-sheep-deaths sheep-deaths let local-wolf-births wolf-births let local-wolf-deaths wolf-deaths ;; update stock

文档评论(0)

1亿VIP精品文档

相关文档