- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » An Error in simulation
An Error in simulation
An Error in simulation
When I established a pump model,the code is as follows:
model ActualPump
annotation(Icon(coordinateSystem(extent = {{ -100, -100},{100,100}})), Diagram(coordinateSystem(extent = {{ -100, -100},{100,100}})));
extends Actuator.Interfaces.TwoPorts;
parameter Real Dp = 1e-06 / (2 * 3.14);
Actuator.SIunits.AngularVelocity w;
Actuator.Interfaces.Flange_b f annotation(Placement(transformation(origin = { -108.0,0.0}, extent = {{ -129.0, -21.0},{ -87.0,21.0}}), iconTransformation(origin = { -100.0, -5.0}, extent = {{ -109.0, -14.0},{ -91.0,4.0}})));
equation
w = f.phi;
q = der(w) * Dp;
f.tau = P * Dp;
end ActualPump;
partial model TwoPorts
annotation(Icon(coordinateSystem(extent = {{ -100, -100},{100,100}}), graphics = {Text(lineColor = {0,0,204}, extent = {{33,184},{209,71}}, textString = "%name")}), Diagram(coordinateSystem(extent = {{ -100, -100},{100,100}})));
Actuator.SIunits.Pressure P;
Actuator.SIunits.VolumeFlowRate q;
Actuator.Interfaces.FlowPort_a flowportA annotation(Placement(transformation(origin = {1.0, -108.0}, extent = {{ -20.0, -129.0},{22.0, -87.0}}), iconTransformation(origin = {2.0, -120.0}, extent = {{ -19.0, -141.0},{23.0, -99.0}})));
Actuator.Interfaces.FlowPort_b flowportB annotation(Placement(transformation(origin = { -1.0,108.0}, extent = {{ -22.0,87.0},{20.0,129.0}}), iconTransformation(origin = {1.0,121.0}, extent = {{ -20.0,100.0},{22.0,142.0}})));
equation
P = flowportA.P - flowportB.P;
0 = flowportA.q + flowportB.q;
q = flowportA.q;
end TwoPorts;
When I simulated the model,there is an error:
" Error:Model is structually singular,error found sorting equations 0.0=0.0; for variables "
I don't know the reason.Who can help me? Thank you very much.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » An Error in simulation