是否有可能使用模拟的结果,Sim 1在时间t的模拟的初始值Sim 2?使用extend不适用于起始值.
例:
model Sim 1
Real a;
equation
a=2*time;
end Sim 1;
Run Code Online (Sandbox Code Playgroud)
对于模型Sim 2,我需要
Real b (start=a at time t)
Run Code Online (Sandbox Code Playgroud)
在其他几组方程中使用.
我不理解Modelica上下文中"class"的含义
从modelica.org教程:"在Modelica中,基本的结构元素是一个类.有七个具有特定名称的受限类,例如模型......".谁有更简单的解释?我对Modelica很新.
我正在使用Dymola平台制作PI控制器,但遇到如下错误消息
这是我的一些代码,其中包括用于计算分配量的阀和控制分配量的PI控制器。他们正在使用标志互相交流
//PI controller///
if flag_input==1 then //flag_input==1 : Stop control / flag_input==0 : Restart control//
control:=0;
else
control:=(P_term+I_term)/unit;
end if;
if error<0 then // error<0 : flag to Valve to restart calculating the disp//
flag_output:=1;
else
flag_output:=0;
end if;
//Valve//
if (26/5)*(thetta/(2*pi))*0.001>0.026 and flag_input==0 then
//restart calculating the disp when received flag==1 from the PI controller//
disp:=0.026;
flag:=1;
elseif (26/5)*(thetta/(2*pi))*0.001<0 and flag_input==0 then
disp:=0;
flag:=1;
else
disp:=(26/5)*(thetta/(2*pi))*0.001;
flag:=0;
end if;
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我代数循环错误的含义并找出问题所在吗?
我有一个没有annotation (uses(Modelica(version="X.Y.Z")));在顶级 package.mo 文件中的库。我可以手动执行转换脚本来更新我的库吗?它位于哪里?我正在使用 Dymola。
我在 Modelica 中制作了包角代码,如下所示。
thetta_eq=mod(thetta, 720);
Run Code Online (Sandbox Code Playgroud)
thetta 不断增加 0 到无限角,thetta_eq 是包裹角 0 到 720deg。
但是,当我区分包裹角时会出现问题。
此外,我无法在 Modelica 标准库 3.2.3 中使用 wrapangle 块,因为我必须使用 3.2.2 版本。
有没有人有解决这个问题的方法?代码、逻辑还是选项?
我已经知道当角度从 720 度下降到 0 度时无法区分,因为它是不连续的。
所以,我想问的是使它即使在下降区域也是连续的。
实际上,上图是 sigmoid 函数,我想当包角下降 720 到 0 度时我可以使用这个函数。
如果我使 sigmoid 函数的倾斜度非常高,我认为这可以像原始包角一样起作用。并且导数不是无限的或无限的,因此可以微分。
你怎么想?以及我如何为这个想法制定逻辑?
ps) 非常感谢您的回复!
为了使我在 Modelica 中的模型模拟运行得更快,我问以下问题:Modelica 中的模拟运行时间有什么影响?
我会感谢任何可能的帮助。
我想做一个实时模拟,如果我想在 Dymola 中使用固定步长求解器,具有不同的步长,结果可能会有所不同,那么是否有任何标准程序来选择步长?或者我是否必须进行大量计算来证明步长独立性,就像在 CFD 区域中我需要证明网格独立性一样?
I am trying to compile a Modelica model (built in Dymola) using Jmodelica, but got the following error:
Compiler arguments: Generating code...
====== Model compiled successfully ======= OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x24): undefined reference to 'ModelicaStandardTables_CombiTable1D_minimumAbscissa'
OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0xbc): undefined reference to 'ModelicaStandardTables_CombiTable1D_maximumAbscissa' OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x1e7): undefined reference to 'ModelicaStandardTables_CombiTable1D_init2'
collect2.exe: error: ld returned 1 exit status
mingw32-make1: *** [fmume20_] Error 1
mingw32-make: *** [fmume20] Error 2
"C:/Users/taoy/AppData/Roaming/JModelica.org-2.14/MinGW/bin/mingw32-make" -f "C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile" "PLATFORM_FLAG=-m64" "RUNTIMELIBRARY_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib/RuntimeLibrary64" "MINPACK_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/Minpack/lib64" "SUNDIALS_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/lib64" "WINPTHREADS_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/winpthreads/lib/winpthreads64" fmume20_
mingw32-make1: Entering directory
'C:/Users/taoy/AppData/Local/Temp/1/jmc7241264750773945049out' "gcc" -m64 -std=c89 -pedantic …