Dymola2023安装

 最近在接触Dymola,在安装过程中遇到一些问题,着实浪费了一些时间。故在此记录、分享下,希望以后大家少走些弯路。

1 安装

双击安装文件进入安装向导。

在安装时需要注意Libraries是默认不安装的,如有需要,可以单击选择本地安装。

一路点击Next后即可完成安装。

2 编译器配置与安装

安装完成之后,首次打开会提示配置编译器,点击确定进入编译器配置页面。

如果之前曾经安装过相关的编译环境,选择可用编译器即可,若没有则需要安装编译器

。此处以Visual Studio 2019为例。在官方说明里提到,Visual Studio 2019有四种选择,因为我电脑上已经有高版本Visual Studio,只想安装生成工具,所以选择了Visual Studio 2019 Build Tools安装,而只需勾选C++ build tools和C++/CLI即可。

Visual Studio 2019 Build Tools可通过如下链接下载生成工具:

Microsoft C++ Build Tools - Visual Studio

安装完成之后,重新启动Dymola,选择安装后的编译器,可以点击‘Verify Compiler’来验证下,如出现如下窗口则说明安装成功。

3 全版本使用

安装完成后,若没有license,则Dymola界面会提示使用版本,试用版本只能运行简单模型,若想使用所有功能,则还需要license。我曾在网上找到一些Patch包,但是在放入相应文件夹后会有一些问题。

问题一:无法编译

Error: The Dymola block in Simulink assumes a fixed set of states. Unfortunately, Dymola was not able to make a fixed selection of states. but prepared for dynamic selection of states during simulation.

弹出的窗口里有一些建议:

  1. In Dymola and in Simulation mode, before translation, select Experiment Setup, tab Translation and tick "Evaluate parameters to reduce models" and"List continuous states selected". Translate and check the tranlation log and see what Dymola selected as states and if it was a fixed set.
  2. Modelica allows the user to control the selection of states You can force a variable to be a state by setting its stateSelect attribute to StateSelect.always. More generally, you can at translation log the states selected. Select ExperimentSetup, tab Translation, tick "List continuous states selected". You can during simulation log the result of the dynamic selection of states. Select ExperimentSetup, tab Debug, tick "Dynamic selection of states". Hopefully this log aids you in making a fixed selection. A partial selection may work, if Dymola then is able to make a fixed selection for remaining states. Please, note that Dymola does not support individual setting of the stateSelect attribute for elements of arrays.

但是尝试上述方法后并不能解决问题,最后经查询发现是License文件的问题,解决方法是删除license文件中的前三行。但是第二个问题并没有解决。

问题二:使用过程中闪退

在尝试使用Dymola时,发现软件会闪退,没有任何报错信息,而且闪退的频率很高,基本上每次运行模型后都会闪退,后来发现依然是license导致的...

解决的方式是更换了新的license文件,更换后,上述两个问题均不存在。

现在将上述资源分享,防止大家走弯路浪费时间。关注公众号“机器人杂货铺”,回复Dymola即可免费获取上述资源。

需要注意,上述资源仅供学习交流,请勿用于商业用途!

  • 18
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值