dymola

Dymola mos script environment variables

烂漫一生 提交于 2021-01-28 09:21:59
问题 Is there a way to use the Windows environment variables in Dymolas .mos scripts? Something like this: // Load libraries, last one determines the working directory openModel(%USERPROFILE% + "Documents/Dymola/MyTestLib/package.mo"); Alternatively, does Dymola know some other predefined pathes? I would like to make .mos script a bit more portable to a different PC. 回答1: You can use the getEnvironmentVariable function from the MSL. So this should do what you want: user_profile = Modelica

Modelica Dymola: How to change component parameters during state graph simulation?

帅比萌擦擦* 提交于 2021-01-28 04:40:45
问题 Say I have a fluid model, with initial pressures, temperatures, valve settings, etc. Is there a way to run a State Graph simulation where each of the states contains new component parameter settings for the model, i.e. some parameters of some selected components are changed during one state, and are changed again during the next state? For example, during State1 let's set the values for the following component parameters: source.pressure = 1 source.temperature = 1 valve1.opening = 1 Until

Modelica Dymola: How to change component parameters during state graph simulation?

蹲街弑〆低调 提交于 2021-01-28 04:28:12
问题 Say I have a fluid model, with initial pressures, temperatures, valve settings, etc. Is there a way to run a State Graph simulation where each of the states contains new component parameter settings for the model, i.e. some parameters of some selected components are changed during one state, and are changed again during the next state? For example, during State1 let's set the values for the following component parameters: source.pressure = 1 source.temperature = 1 valve1.opening = 1 Until

mkdir from Dymola mos script

落花浮王杯 提交于 2021-01-28 02:03:17
问题 I have a mos script for running multiple simulations. Before running a simulation, I want to cd to a new directory, so that all result and log files are saved and never overwritten. Currently it is only possible to cd to existing directories, as far as I know. Anybody has a recommendation how to create a directory named e.g. temp_modelname and cd to that directory from a mos script? I could use mkdir in a system call, or is there a convenience wrapper prepared and I just missed it? EDIT:

Using “Save start values in the model” option to help the convergence in Dymola

前提是你 提交于 2021-01-27 13:03:53
问题 I build a model in dymola. Even though there are some errors during the initialization process, but the calculation succeeded at last. After the model converged successfully, I tried to use the "Save start values in the model" option to get the right iteration variable strat values stored into the model so that the model would NOT get errors in the next calculation. But after I did this and tried to do calculation once more, I still got the same errors. So, my question is: Could I use the

Why does the “der()” operator in Modelica apply to the time variable only?

喜夏-厌秋 提交于 2020-12-30 03:13:37
问题 I build a simple to model in Dymola, but I got confused about the der() operator, why does the der() operator apply to the time variable only? What if I want to use the derivate to other variables In the following code, if I want to calculate dy/dx (derivative of y to x), how should I do this? model A Real x, y, z; equation x=10; y=sin(x); z=der(y); end A; 回答1: Partial derivatives are supported via functions. See chapter 12.7.2 in Modelica Spec 3.4: Partial Derivatives of Functions . You have