6

Modelica modeling is the first principle modeling, so how to test the model and set an effective benchmark is important, for example, I could design a fluid network as my wish, but when building a dynamic simulation model, I need to know the detailed geometry structure and parameters to set up every piece of my model. Usually, I would build a steady-state model with simple energy and mass conservation laws, then design every piece of equipment based on the corresponding design manual, but when I put every dynamic component together, when simulation till steady-state, the result is different from the steady-state model more or less. So I was wondering if I should modify my workflow to make the dynamic model agree with the steady-state model. Any suggestions are welcome.

#dymola #modelica

Jack
  • 1,094
  • 6
  • 16
  • 1
    Why would you expect the detailed dynamic model at steady state to identically agree with the simplified steady-state model? or what is the purpose? What kind of modifications are permitted? e.g. model parameters/start-values, or reduction of detailed subsystems, removal of insignificant components etc.? – Atiyah Elsheikh Jun 30 '21 at 12:32
  • @when the boundary conditions are the same, the steady-state model's result and the dynamic model's steady-state should be the same, so I could validate my dynamic model is right. – Jack Jul 01 '21 at 06:46
  • Your question is still so generic and vague to me. To my understanding to your question would be, some of your black-box detailed submodels somehow deviate from the white sub-models based on first-principle simplified assumptions and you want to find out the reason? right? well, one can replace the white-box step by step / a component after a component with grayer components and find out where does it happen that steady-state behavior between the white-boxes model and gray-boxes model don't agree any more. Are you seeking a kind of model selection algorithm? – Atiyah Elsheikh Jul 01 '21 at 10:08
  • To replace every component and test the model would be a lot of work, I am wondering if I could do it in an easier way. – Jack Jul 01 '21 at 10:46

1 Answers1

-1

To my understanding of the question, your parameter values are fixed and physically known. I would attempt the following approach as a heuristic to identify the (few) component(s) that one needs to carefully investigate in order to understand how they influence or violates the assumed first principles.

This is just as a first trial and it could be subject to further improvement and fine-tuning.

  1. Consider the set of significant set of variables xd(p,t) \in R^n and parameters p. Note that p also includes significant start values. p in R^m includes only the set of additional parameters not available in the steady state model.

  2. Denote the corresponding variables of the steady state model by x_s

  3. Denote a time point where the dynamic model is "numerically" in "semi-" steady-state by t*

  4. Consider the function C(xd(p,t*),xs) = ||D||^2 with D = xd(p,t*) - xs

It could be beneficial to describe C as a vector rather than a single valued function.

  1. Compute the partial derivatives of C w.t. p expressed in terms of dxd/dp, i.e.

    dC/dp = d[D^T D]/dp

       = d[(x_d-x_s)^T (x_d - x_s)]/dp
    
       = (dx_d/dp)^T D + ...
    
  2. Consider scaling the above function, i.e. dC/dp * p/C (avoid expected numerical issues via some epsilon-tricks)

Here you get a ranking of most significant parameters which are causing the apparent differences. The hopefully few number of components including these parameters could be the ones causing such violation.

If this still does not help, may be due to expected high correlation among parameters, I would go further and consider a dummy parameter identification problem, out of which a more rigorous ranking of significant model parameters can be obtained.

If the Modelica language had capabilities for expressing dynamic parameter sensitivities, all the above computation can be easily carried out as a single Modelica model (with a slightly modified formulation).

For instance, if we had something like der(x,p) corresponding to dx/dp, one could simply state

dcdp = der(C,p)  

An alternative approach is proposed via the DerXP library

Atiyah Elsheikh
  • 568
  • 3
  • 12