﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4783	Synchronous solverMethod ExplicitEuler and ImplicitTrapezoid generate too many states	Rüdiger Franke	Lennart Ochel	"This error was introduced during the last year after the solver methods `""ExplicitEuler""` and `""ImplicitTrapezoid""` had been implemented initially (see also #4237).

FMI export works for the following example using `""ImplicitEuler""`:
{{{#!mo
model DID ""Double Integrator Discrete-time""
  parameter Real p = 1 ""gain for input"";
  parameter Real y1_start = 1 ""start value for first state"";
  parameter Real y2_start = 0 ""start value for second state"";
  input Real u(start = -2);
  output Real y1(start = y1_start, fixed = true);
  output Real y2(start = y2_start, fixed = true);
  Real ud;
equation
  ud = sample(u, Clock(Clock(/*inferred*/), solverMethod = ""ImplicitEuler""));
  der(y1) = p * ud;
  der(y2) = previous(y1) + 0.5 * p * ud * interval(ud);
end DID;
}}}

Invoke the `omc` commands:
{{{#!mo
//setCommandLineOptions(""--std=3.3"");
setCommandLineOptions(""+simCodeTarget=Cpp"");
translateModelFMU(DID, version=""2.0"");
}}}

This generates a correct FMU with the two discrete states `previous(y1)` and `previous(y2)`.

Changing the `solverMethod` to `""ExplicitEuler""` or `""ImplicitTrapezoid""` results in four discrete states `previous(der(y1))`, `previous(der(y2))`, `previous(y1)` and `previous(y2)`.

Any `solverMethod` should generate 2 discrete states. This was the case when the solver methods `""ExplicitEuler""` and `""ImplicitTrapezoid""` had been introduced.

Does anyone know when this was introduced and can it be removed again?
"	defect	closed	high	1.13.0	Backend		fixed		Willi Braun Volker Waurich
