Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structurally singular initial equation system in PPM model #1830

Closed
maltelenz opened this issue Feb 1, 2024 · 2 comments · Fixed by #1834
Closed

Structurally singular initial equation system in PPM model #1830

maltelenz opened this issue Feb 1, 2024 · 2 comments · Fixed by #1834

Comments

@maltelenz
Copy link

For IBPSA.Fluid.Sensors.Examples.PPM Wolfram System Modeler gives the following error:

Error: Overdetermined initial equation system.
Error: The initialization problem is structurally singular, the following equations cannot be solved for any variable:
volSte.dynBal.ports_H_flow[1] = semiLinear(0.0, 0.0, volSte.dynBal.hOut)
sin.p = volDyn.p_start
Given the following equations:
$START.volSte.dynBal.m = volSte.V * volSte.rho_start
volSte.dynBal.m = 1.18430792005922e-05 * volSte.V * volSte.p_start
volSte.dynBal.ports_mXi_flow[1,1] = semiLinear(0.0, 0.0, volSte.dynBal.medium.Xi[1])
$START.volSte.dynBal.mXi[1] = 0.01 * volSte.dynBal.fluidVolume * volSte.dynBal.rho_start
$START.volSte.dynBal.hOut = volSte.dynBal.hStart
$START.volSte.heatPort.T = volSte.T_start
volSte.heatPort.T = volSte.T
0.0 = volSte.dynBal.ports_mXi_flow[3,1] + volSte.dynBal.ports_mXi_flow[1,1] + volSte.dynBal.ports_mXi_flow[2,1]
volSte.dynBal.ports_mXi_flow[2,1] = semiLinear(mSouSta.m_flow, 0.01, volSte.dynBal.medium.Xi[1])
volSte.dynBal.medium.state.X[1] = volSte.dynBal.medium.Xi[1]
volSte.dynBal.medium.R_s = 461.523329085088 * volSte.dynBal.medium.Xi[1] + 287.051224952979 * volSte.dynBal.medium.X[2]
volSte.dynBal.medium.MM = 1 / (55.508435061792 * volSte.dynBal.medium.Xi[1] + 34.5242878865884 * volSte.dynBal.medium.X[2])
volSte.dynBal.mXi[1] = volSte.dynBal.m * volSte.dynBal.medium.Xi[1]
volSte.dynBal.hOut = 1006.0 * volSte.dynBal.medium.X[2] * volSte.dynBal.medium.dT + (1860.0 * volSte.dynBal.medium.dT + 2501014.5) * volSte.dynBal.medium.Xi[1]
volSte.T = IBPSA.Fluid.Sensors.Examples.PPM.volDyn.Medium.temperature_phX(0.0, volSte.dynBal.hOut, {volSte.dynBal.medium.Xi[1], 1.0 - volSte.dynBal.medium.Xi[1]})
-volSte.dynBal.ports_mXi_flow[3,1] = semiLinear(mSouSta.m_flow, volSte.dynBal.medium.Xi[1], 0.01)
volSte.dynBal.medium.X[2] = 1.0 - volSte.dynBal.medium.Xi[1]
volSte.dynBal.medium.X[1] = volSte.dynBal.medium.Xi[1]
senPPMSta.port_a.h_outflow = 995.94 * (sin.T + (-273.15)) + 0.01 * (1860.0 * sin.T + 1992955.5)
mSouSta.h_internal = 995.94 * (mSouSta.T + (-273.15)) + 0.01 * (1860.0 * mSouSta.T + 1992955.5)
volSte.dynBal.ports_H_flow[2] = semiLinear(mSouSta.m_flow, mSouSta.h_internal, volSte.dynBal.hOut)
-volSte.dynBal.ports_H_flow[3] = semiLinear(mSouSta.m_flow, volSte.dynBal.hOut, senPPMSta.port_a.h_outflow)
0.0 = volSte.dynBal.ports_H_flow[3] + volSte.dynBal.ports_H_flow[1] + volSte.dynBal.ports_H_flow[2]

We (System Modeler) don't typically allow for overdetermined and inconsistent initial equations.

We can see that OpenModelica agrees that the initialization problem is overspecified in their test run log here, but that they decide to drop an equation and go on anyway:

Warning: The initial conditions are over specified. The following 1 initial equations are redundant, so they are removed from the initialization system:
volDyn.dynBal.medium.p = volDyn.dynBal.p_start.

Perhaps the model could be improved to have a consistently specified initialization?

@mwetter
Copy link
Contributor

mwetter commented Feb 1, 2024

@maltelenz : Can you please check if #1834 corrects the issue for System Modeler. (Note that as far as I see, the initial conditions were over-specified but consistent. The change in the model should remove this problem.)

@maltelenz
Copy link
Author

I can confirm it simulates cleanly in System Modeler with #1834 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants