当前位置: 首页 > news >正文

呼市做网站的公司职业培训网

呼市做网站的公司,职业培训网,凡科做的手机网站可以导出来,包包17网站一起做网店Modelica建模,Modelica语言的学习,技术调研工作 参考资料: 苏州同元软控信息技术有限公司 - 同元 Modelica 再探冷却 modelica学习-CSDN博客 1、 Modelica简介 Modelica是由Modelica协会维护、免费开放的物理系统面向对象的统一建模语言规…

Modelica建模,Modelica语言的学习,技术调研工作

参考资料:

苏州同元软控信息技术有限公司 - 同元

Modelica

再探冷却

modelica学习-CSDN博客

1、 Modelica简介

Modelica是由Modelica协会维护、免费开放的物理系统面向对象的统一建模语言规范,为机、电、液、控等多领域复杂工程系统提供了统一的物理建模语言规范。

Modelica作为多学科统一建模仿真的国际标准,被仿真界广泛采用,系统多领域统一建模仿真,已成为世界公认的MBSE和CPS的核心关键支持技术。

 Modelica 语法、函数、包、连接器、组件、子系统

https://modelica.org/libraries.html 第三方的库

MSL

1.1、 Modelica 下载安装:

支持Modelica语言的开源软件有

1) OpenModelica,

2) JModelica(新版本不再开源,但是最后的开源版本仍可下载)

3) Scilab项目中的SCICOS 。

可以使用 openmodelica 软件来进行modelica建模,测试 ,openmodelica 的下载安装   Download Windows。  下载对应的版本 :Index of /omc/builds/windows/releases/1.21/0/64bit

典型商业软件主要有 [2]  :

1)  苏州同元的MWorks(中国),

2) 伊萨的SimulationX,

3) 达索的Dymola,

4) 西门子的AMESim(支持Modelica),

5) MapleSoft(Maple厂家)的MapleSim,

6) Wolfram (Mathemetica厂家)的MathModelica。

1.2、 Modelica 基础语法: 

1) 模型定义

model SomeModelName "An optional description"

  // By convention, variables are listed at the start

equation

  /* And equations are listed at the end */

end SomeModelName;

  

2) 继承

model SpecializedModelName "An optional description"   extends Model1; // No modifications 

extends Model2(n=5); // Including modification   // By convention, variables are listed at the start

equation   /* And equations are listed at the end */

   ... ... 

end SpecializedModelName;

 3) 变量

Real x;

Real x, y;

Real alpha “angular acceleration”;

· 内建类型:

4大类型: Real , Integer, Boolean, String  (4大内置参数类型)

· 参数: parameter 修饰

能够在变量声明前加入parameter(参数)限定词,以表明该变量是先验已知的。我们可以认为这个参数作为模型的“输入数据”,是不随时间变化的常数。

· 常数: constant 修饰

与parameter(参数)限定符关系密切的是constant(常数)限定词。

· 离散变量: discrete

· 派生类型:

type NewTypeName = BaseTypeName(/* attributes to be modified */);

type Temperature = Real(unit="K"); // Could be a temperature difference

type AbsoluteTemperature = Temperature(min=0); // Must be positive 

model BaseTypeName 

type BaseTypeName1 = Real(unit="m2"); 

type NewTypeName = BaseTypeName1;// /* attributes to be modified */; 

type Temperature = Real(unit="K"); // Could be a temperature difference  type AbsoluteTemperature = Temperature(min=0); // Must be positiveequation 

end BaseTypeName; 

· 枚举类型:

type AssertionLevel = enumeration(warning, error); 

type StateSelect = enumeration(never, avoid, default, prefer, always);

修改语句:

Real x(start=10);

 parameter Real x0=10 "Start value of prey population";

Real x(start=x0) "Prey population"; 

extends QuiescentModelWithInheritance(gamma=0.3, delta=0.01);

 extends QuiescentModelWithInheritance(x(start=5));  

Record类型定义

record类型可以有自己的变量,但是不允许包含方程

record Vector

"A vector in 3D space"  Real x;  Real y;  Real z;

end Vector

record Complex "Representation of a complex number" 

Real re "Real component"; 

Real im "Imaginary component";

end Complex;

parameter Vector v(x=1.0, y=2.0, z=0.0);

parameter Vector v = Vector(x=1.0, y=2.0, z=0.0);

Demo展示:

demo1:   模拟一个乒乓球从1米的高度,掉落到地上,并来回弹起来的效果:

1) 对弹跳球的建模¶

 model BouncingBall "The 'classic' bouncing ball model"
    type Height = Real(unit = "m");
    type Velocity = Real(unit = "m/s");
    parameter Real e = 0.8 "Coefficient of restitution";
    parameter Height h0 = 1.0 "Initial height";
    Height h;
    Velocity v;
initial equation
    h = h0;
equation
    v = der(h);
    der(v) = -9.81;
    when h <= 0 then
      reinit(v, -e*pre(v));
    end when;
end BouncingBall;

modelica模拟的效果图:、

从上面的模拟图中能发现,当最后球静止的时候,球落在地面以下的位置了。这显然不符合现实世界。我们可以对其改进一番看看。

2) 改进版本:

model StableBouncingBall
  "The 'classic' bouncing ball model with numerical tolerances"
  type Height=Real(unit="m");
  type Velocity=Real(unit="m/s");
  parameter Real e=0.8 "Coefficient of restitution";
  parameter Height h0=1.0 "Initial height";
  constant Height eps=1e-3 "Small height";
  Boolean done;
  Height h;
  Velocity v;
initial equation
  h = h0;
  done = false;
equation
  v = der(h);
  der(v) = if done then 0 else -9.81;
  when {h<0,h<-eps} then
    done = h<-eps;
    reinit(v, -e*(if h<-eps then 0 else pre(v)));
  end when;
end StableBouncingBall;

modelica模拟的效果图:

demo2: 带滞回的温度控制

model HysteresisControl "A control strategy that doesn't chatter"

  type HeatCapacitance=Real(unit="J/K");

  type Temperature=Real(unit="K");

  type Heat=Real(unit="W");

  type Mass=Real(unit="kg");

  type HeatTransferCoefficient=Real(unit="W/K");

  Boolean heat(start=false) "Indicates whether heater is on";

  parameter HeatCapacitance C=1.0;

  parameter HeatTransferCoefficient h=2.0;

  parameter Heat Qcapacity=25.0;

  parameter Temperature Tamb=285;

  parameter Temperature Tbar=295;

  Temperature T;

  Heat Q;

initial equation

  T = Tbar+5;

  heat = false;

equation

  Q = if heat then Qcapacity else 0;

  C*der(T) = Q-h*(T-Tamb);

  when {T>Tbar+1,T<Tbar-1} then

    heat = T<Tbar;

  end when;

end HysteresisControl;

modelica模拟的效果图:

demo3: 带抖动的温度控制

model ChatteringControl "A control strategy that will 'chatter'"

  type HeatCapacitance=Real(unit="J/K");

  type Temperature=Real(unit="K");

  type Heat=Real(unit="W");

  type Mass=Real(unit="kg");

  type HeatTransferCoefficient=Real(unit="W/K");

  Boolean heat "Indicates whether heater is on";

  parameter HeatCapacitance C=1.0;

  parameter HeatTransferCoefficient h=2.0;

  parameter Heat Qcapacity=25.0;

  parameter Temperature Tamb=285;

  parameter Temperature Tbar=295;

  Temperature T;

  Heat Q;

initial equation

  T = Tbar+5;

equation

  heat = T<Tbar;

  Q = if heat then Qcapacity else 0;

  C*der(T) = Q-h*(T-Tamb);

end ChatteringControl;

modelica模拟的效果图:

电子电气相关的模型仿真

仿真效果:

http://www.dinnco.com/news/14121.html

相关文章:

  • 简单html5网页设计太原seo快速排名
  • 国内免费saas crm正在seo技术有哪些
  • 大型门户网站建设方案网站批量查询
  • 网站首页建设图文教程怎么在百度上发表文章
  • 网站建设维护更新360营销平台
  • 动漫视频制作软件热门seo推广排名稳定
  • 怎么用电脑做网站服务器磁力搜索引擎下载
  • 做电影网站被找版权问题怎么处理桂林网站设计
  • 建网站一般用什么工具sem是什么意思的缩写
  • 常州市建设银行网站b2b平台有哪些平台
  • 重庆响应式网站设计长沙seo优化公司
  • 龙岩做网站制造业中小微企业
  • 网站备案怎么那么慢培训机构是干什么的
  • wordpress网站打开速度慢现在搜索引擎哪个比百度好用
  • 代做网站跳转找客户的软件有哪些
  • 企业管理平台系统网站班级优化大师
  • 一起做网站下载数据包网站查询域名ip
  • 动态网站php代做什么叫优化
  • 怎样建设邮箱网站seo推广公司排名
  • 网站注销网站服务器信息查询
  • 设计师资源网站交换链接或称互惠链接
  • 哪有备案好的网站seo策略有哪些
  • .com免费网站怎么做营销型网站seo
  • 音乐介绍网站怎么做的创建网站怎么创
  • 优化网站速度的要点电商运营培训课程有哪些
  • 省交通建设质安监督局网站百度优化大师
  • 网站怎么做导航下载百度到桌面上
  • 系部网站建设管理方案快速网站排名提升工具
  • 招标网站靠谱吗公众号软文范例100
  • 怎样建个小公司的网站企业网络营销推广方案策划范文