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

Dependencies problems #30

Open
DeadParrot opened this issue Dec 24, 2022 · 1 comment
Open

Dependencies problems #30

DeadParrot opened this issue Dec 24, 2022 · 1 comment
Labels
bug Something isn't working OCT OPTIMICA Compiler Toolkit QSS Quantized State System
Milestone

Comments

@DeadParrot
Copy link
Collaborator

DeadParrot commented Dec 24, 2022

The Dependencies section does not yet provide the complete dependency graph that is needed for QSS to simulate correctly. An example of this is detailed below.

The Case600 model was found to not be tracking correctly with the latest QSS, which uses the Dependencies section to get the dependency graph. Investigation showed that Dependencies does not contain equivalent information to the Derivatives section. For example for the variable roo.conExt[4].opa.T[2]:

Variable
roo.conExt[4].opa.T[2]	#6225
der(roo.conExt[4].opa.T[2])	#6226

the <Derivatives> section has dependencies on three continuous state variables:

<Derivatives>	#6226	All are states:
 #6225	roo.conExt[4].opa.T[2]			(state) (self)
 #6227	roo.conExt[4].opa.T[3]			(state)
 #6247	roo.conExt[4].opa.lay[1].T[2]	(state)

but the <Dependencies> section has dependencies on three non-state variables for which no dependencies are provided:

<Dependencies>	#6226	None are states or have any dependents:
 #6241	roo.conExt[4].opa.lay[1].Q_flow[3]	"Heat flow rates to each state"
 #6305	roo.conExt[4].opa.lay[2].CInv[1]	"Inverse of heat capacity associated with the temperature state"
 #6307	roo.conExt[4].opa.lay[2].Q_flow[2]	"Heat flow rates to each state"

With no dependency graph out of these variables, that presumably leads to the three states shown in <Derivatives>, QSS cannot get the necessary information from <Dependencies>.

The Dependencies behavior described is based on the OCT update version OCT-master-7245bce03ab2ebdfdaaf0805d75209efaa009c67.

Edit: This issue is still present in OCT-master-8bb4688ea939e98a3f23be67236795ab5f2d3ac4 from June 2023.

@DeadParrot DeadParrot added bug Something isn't working OCT OPTIMICA Compiler Toolkit QSS Quantized State System labels Dec 24, 2022
@DeadParrot DeadParrot added this to the 0.0.1 milestone Dec 24, 2022
@DeadParrot
Copy link
Collaborator Author

DeadParrot commented May 6, 2023

The BouncingBall model has this conditional block:

  when h < 0 then
    reinit(v, -e*pre(v));
  end when;

For QSS this means that the FMU value of v must be set just before the FMU event handling occurs so v needs a self-dependency. As of OCT 1.43.4 this dependency is missing and must be added before running QSS for accurate results.

Edit: Created a separate issue for this: #31.

Edit: The reinit + pre issue was resolved by OCT-master-8bb4688ea939e98a3f23be67236795ab5f2d3ac4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OCT OPTIMICA Compiler Toolkit QSS Quantized State System
Projects
None yet
Development

No branches or pull requests

1 participant