modelica

External Functions: Alternative Method to use .dll from a C-script

安稳与你 提交于 2019-12-02 05:17:20
This is a companion question to External Functions: Reference headers in C-script to compiled dll . That stack overflow question is using a Modelica external function call to a c-script. That c-script then uses c-functions contained within a .dll. Below is the initial preferred method I had attempted and a working attempt that I do not prefer. Initial Attempt: The following code would not work. My assumption was since I loaded the .dll Library libgsl in Modelica I could then simply use headers in the C-script to use function calls from that .dll. However, the dslog.txt file indicated that it

Integration Methods in OpenModelica

两盒软妹~` 提交于 2019-12-02 04:53:55
问题 I have noticed that there are several integration methods available in OpenModelica simulation setup. I dont know what these are. Can I get some sort of information regarding these? Will the quality of results vary if the integration methods are changed? 回答1: Short document on the integration methods available in OpenModelica: https://openmodelica.org/svn/OpenModelica/trunk/doc/SimulationRuntime/IntegrationAlgorithms/ Yes, the quality (simulation speed, even finding a solution) could vary if

Current version of the modelica translator can only handle array of components with fixed size

做~自己de王妃 提交于 2019-12-02 03:01:20
I created an part with the AC library, and when I was trying to simulate the model, there is an error says "Current version of the modelica translator can only handle array of components with fixed size". Not sure what is the meaning of it, and is there anyone has the same issue like this one? Thank you enter image description here Consider the following simple model: model M parameter Integer n(start=3, fixed=false); initial algorithm n := n; end M; It has a parameter n which can be changed before simulation starts. And array dimensions need to be parameter expressions. So you would think

How to compile with /bigobj within Dymola (Modelica)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 02:46:58
I am integrating a relative small Finite Element (FE) model into Modelica. In doing so, I created a Model (Modelica class) that can read the mass (M) and stiffness (K) matrix in Matlab binary file format. I connected the FE model with some components from the Modelica Standard Library (Modelica.Mechanics.MultiBody). If M and K are very small (say 20x20), then Dymola is able to run the Model and provides pretty accurate results compared to Abaqus (but computational not that efficient). However, if I increase the complexity of the FE model that includes larger M and K (e.g. size(M)=[200,200]),

Initial guesses for nonlinear algebraic eqtns

喜你入骨 提交于 2019-12-02 02:03:16
问题 I have a system of nonlinear algebraic equations to solve. How can I use computed values (with continuous-time variability) as initial guess for the variables of solution instead of using parameters as start values? Can initial equation section be used for this purpose? I have created a test model to explain the issue: model Teststartvalue Real value1=1000;//calculated by some model Real value2=-1000;//calculated by some model parameter Real InputValue = 100;//Input to model Real StartValue

Integration Methods in OpenModelica

寵の児 提交于 2019-12-02 00:48:29
I have noticed that there are several integration methods available in OpenModelica simulation setup. I dont know what these are. Can I get some sort of information regarding these? Will the quality of results vary if the integration methods are changed? Short document on the integration methods available in OpenModelica: https://openmodelica.org/svn/OpenModelica/trunk/doc/SimulationRuntime/IntegrationAlgorithms/ Yes, the quality (simulation speed, even finding a solution) could vary if you choose different methods. The default is dassl. 来源: https://stackoverflow.com/questions/24257285

Modelica Parameter studies with python

你。 提交于 2019-12-02 00:17:05
问题 I want to run parameter studies in different modelica building libraries (buildings, IDEAS) with python: For example: change the infiltration rate. I tried: simulateModel and simulateExtendedModel(..."zone.n50", [value]) My questions:Why is it not possible to translate the model and then change the parameter: Warning: Setting zone.n50 has no effect in model. After translation you can only set literal start-values and non-evaluated parameters. It is also not possible to run:

External Functions: Reference headers in C-script to compiled dll

无人久伴 提交于 2019-12-01 20:20:50
Using Dymola 2017. Case A) Calling an external c-script I have had success implementing simple external c functions that have no “# include <-->” statements: Modelica Function: function chirp input Modelica.SIunits.AngularVelocity w_start; input Modelica.SIunits.AngularVelocity w_end; input Real A; input Real M; input Real t; output Real u "output signal"; external "C" u=chirp(w_start,w_end,A,M,t) annotation(IncludeDirectory="modelica://ExternalFuncTest/Resources/Source/", Include="#include \"chirp.c\""); end chirp; C-script: double chirp(double w1, double w2, double A, double M, double time)

Evaluating variables at a specific time in Modelica

本小妞迷上赌 提交于 2019-12-01 11:54:15
问题 I have a selection of variables in my Modelica simulation (using Dymola) which is running good. Now I want to plot the behaviour of certain of these variables, which are numbered (with indices). I do not wish to plot the variables versus time, but versus their index. I'm planning to use the plotArray function, but that's not really what I'm curious about in this post. The problem is, all variables are zero when I call them, which indeed is their initial value, but I want to attain their value

Modeling closed hydraulic cycle in OpenModelica

蓝咒 提交于 2019-12-01 09:28:50
I'd like to model a closed hydraulic cycle as one can find in the Modelica Standard Library/Fluid/Examples/HeatingSystem. With the heating system as well as with my (minimalistic) example I've got the same problem: The system is overdetermined. You can find the HeatingSystem as a "bad example" in the following lecture, so I guess this is a well known problem, but I don't really get the point. http://www.modprod.liu.se/MODPROD2011/1.252944/modprod2011-day2-talk3-Keynote-Francesco-Casella-Control-and-Modelica.pdf (page 20) My example is: a pump model producer pipe_flange w,k; parameter Real a,b