I want to have a parameter lets say n = 1 that is not displayed in the UI, but another parameter n_add = n + 1 is displayed at the icon of the model.
parameter Integer n = 1 "not to be displayed";
parameter Integer n_add = n + 1 "Displayed on the model";
On the icon level I write as text " %n_add " the result is not the calculation of n + 1 = "2", but rather the calculation to be done (literally "n+1"). The parameter n_add should be visible prior to simulation/initialization during the parametrization of the model.
Is this even possible?
Seems to be very similar to this: Displaying parameter in annotation in DYMOLA but this question is actually more compact to read, therefore the code that should solve your problem:
model showN1
parameter Integer n = 1 "not to be displayed";
final parameter Integer n_add = n + 1 "Displayed on the model";
annotation (Icon(graphics={Text(
extent={{-100,-20},{100,20}},
lineColor={0,0,0},
textString="n_add = " + DynamicSelect("?", String(n_add)))}));
end showN1;
Prior to simulation is possible for values which are known prior to the simulation (e.g. parameters). DynamicSelect
can also show values that change during simulation which have to be computed first. These are then read from the result file which is only available after the simulation has started.