Opened 11 years ago

Closed 11 years ago

#2397 closed enhancement (fixed)

More infos in backenddaeinfo would be nice

Reported by: Christian Schubert Owned by: Lennart Ochel
Priority: high Milestone: 1.9.3
Component: Backend Version: trunk
Keywords: Cc: Patrick Täuber

Description

Currently, the output of +d=backenddaeinfo looks like this

No. of Equations: 4543
No. of Variables: 4543
##########################################################
Statistics
##########################################################
Number of independent Subsystems: 8
Number of States:                 36
Toplevel Inputs:                  0
[...]

it would be nice though if not only the number of continous states but also the number of discrete states (variables with a pre) would be displayed. Moreover, an option would be nice to show the names of both the continous and the discrete states.

Change History (8)

comment:1 by Lennart Ochel, 11 years ago

Status: newaccepted

comment:2 by Patrick Täuber, 11 years ago

What exactly do you mean with "discrete states"? I think states are always continuous variables... I am about to add the number of discrete variables to the output of backendaeinfo. Is this what you expected?

comment:3 by Patrick Täuber, 11 years ago

Cc: Patrick Täuber added

comment:4 by Christian Schubert, 11 years ago

Hi,

I know that "discrete" state, can be a little misleading. Sorry.
What I mean is all discrete variables, that are used in pre(.) operator.

As to the "discrete states":
For me as an engineer, the der(.) applied to a continous variable is the same concept as applying pre(.) to a discrete variable as they both describe some kind of memory about the past in the system.

Although, if one introduces an integration scheme (i.e. inline integration) directly into the equations you would essentially transform the der(.) operator to a pre(.) operator.

comment:5 by Lennart Ochel, 11 years ago

Well, I get your point. But I strongly advice to not call it “discrete state” because a state is handled different to a discrete variable in many places. Also fixed=true may introduce pre-calls (for discrete variables, not for states). Are you interested in those variables too? And what if the pre-operator occurs only in initial equations? Maybe you are interested into a list of all lhs variables of when-clauses? The pre-operator can be also used for continuous variables. Is that also interesting for you? Anyway, it is not that clear what you are looking for. Can you try to explain it even more precisely?

comment:6 by Christian Schubert, 11 years ago

I'll try my best ;-)
I am interested in the "memories" of a system. That is the best definition I can think of at the moment.

  • fixed=true, does not lead to a new memory, => not interesting
  • pre-operator only in initial equations should not lead to a new memory => not interesting
  • lhs variables of when-clauses => not interesting
  • pre operator on continous variables => not interesting

A clear yes, would be the following model

model Counter
  discrete Real x(start=-1, fixed=true);
  parameter Real h = 0.5;
  parameter Real a = 3;
  Real y(start=-1, fixed=true);
algorithm 
  when (sample(h,h)) then
    x := pre(x) + a*h;
  end when;
  der(y) := a;
end Counter;

Here x represents a sampled version of y and shall illustrate the similarity to a continous state.

comment:7 by Christian Schubert, 11 years ago

A look at wikipedia brought up a definition I quite like (although it is in German):
http://de.wikipedia.org/wiki/Zustand_%28Physik%29

Der Zustand eines physikalischen Systems zu einem bestimmten Zeitpunkt umfasst die Gesamtheit aller Informationen, die zur vollständigen Beschreibung der momentanen Eigenschaften des Systems erforderlich sind, sofern sie nicht schon mit den unveränderlichen Eigenschaften des Systems als solches festliegen.

So a state according to that definition should comprise all information that are needed to calculate all other variables in the system. The information can be of continous or discrete nature.

The question about the initial system is interesting as the initial system might have a completely different flow of information.

comment:8 by Lennart Ochel, 11 years ago

Resolution: fixed
Status: acceptedclosed

I added the quantity of "discrete states" to +d=backenddaeinfo. A list of all "discrete states" gets displayed with +d=backenddaeinfo,discreteinfo.
Christian, please check if this is what you are looking for.

##########################################################
Statistics (backenddaeinfo)
##########################################################
Number of independent subsystems: 6
Number of states:                 3
Number of discrete variables:     4
 discrete variables: d1, d2, $whenCondition1, d3
Number of discrete states:        3
 discrete states: d3, d2, d1
Toplevel inputs:                  0
Note: See TracTickets for help on using tickets.