在两个法兰之间切换
我目前正在使用标准 Modelica 发行版中包含的 MultiBody 库处理多体机械系统.
I am currently working with multibody mechanical systems using the MultiBody library included in the standard Modelica distribution.
我需要在法兰之间实现切换,以便为给定的关节选择位置或力控制.
I need to implement a switch between flanges, in order to select position or force control for a given joint.
model FlangeSwitch "Switch between flanges"
Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a_1;
Modelica.Mechanics.Translational.Interfaces.Flange_b flange_b_1;
Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a_2;
Modelica.Mechanics.Translational.Interfaces.Flange_b flange_b_2;
Modelica.Mechanics.Translational.Interfaces.Flange_a flange_a_exit;
Modelica.Mechanics.Translational.Interfaces.Flange_b flange_b_exit;
Modelica.Blocks.Interfaces.BooleanInput u;
equation
if u then
flange_a_exit = flange_a_2;
flange_b_exit = flange_b_2;
else
flange_a_exit = flange_a_1;
flange_b_exit = flange_b_1;
end if;
end FlangeSwitch;
但是这种方法行不通,系统不平衡:10 个方程和 12 个变量.
But this approach does not work, the system is not balanced: 10 equations and 12 variables.
有没有办法做到这一点?
Is there any way to do this?
您发布的链接与非物理连接器相关,与物理连接器相比,非物理连接器的限制较少.因此,应该非常仔细地比较这两种解决方案.
The link you posted is related to non-phyiscal connectors, which are less restrictive compared to the physical connectors. So comparing the two solutions should be done very carefully.
从位置作为输入切换到力作为输入需要在执行此切换时重建方程组.这对于当前的 Modelica 来说是不可能的.您需要为整个模拟找到一个基于相同输入的解决方案.
Switching from position as an input to force as an input would require the system of equations to be rebuilt when executing this switch. This will not be possible with current generation Modelica. You will need to find a solution that is based on the same input for the whole simulation.
以系统在您希望首先移动到的点(使用位置源)开始模拟的方式初始化位置是否足够?你失去的是系统移动到这个位置.
Would it be enough to initialize position in a way that the system starts the simulation in the point where you want to move it to first (using the Position Source)? What you loose is the movement of the system to this position.