﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2736	Final Constraints for Optimization missing	Vitalij Ruge	Mahder Alemseged Gebremedhin	"Currently it's not possible to formulation final constraints in the optimization.
In the moment we support path constraints with Otimica Extension.

{{{
 Real a,b,c,d,e;
.....
constraint
 a*b + c/d < e
}}}

In Optimica it's possible to write for final constraints.
{{{
 Real a,b,c,d,e;
.....
constraint
 a(finaTime)*b(finalTime) + c(1.0)*d(finalTime) < b(1.0)
}}}
where finalTime is a real parameter 1.0, which is unknown sometimes. 
Note: stopTime not equal finalTime!

There some issues with different time point and the case if finalTime is unknown.

It seem like the currently way in Modelica is to set marker via (Custom) annotations
see e.g. http://www.ep.liu.se/ecp/096/018/ecp14096018.pdf

It's would be nice to have something like 
{{{
 Real a,b,c,d,e;
.....
constraint
 a*b + c/d < e annotation(finalConstraint = true)
}}}
The issue is that a*b + c/d < e is an equation and the annotation going missing in the BackEnd.
Alternative it should be possible to write
{{{
 Real a,b,c,d,e;
 Boolean f (finalConstraint = true);
.....
  equation
 f = a*b + c/d < e;
}}}

However custom annotations not really finished yet!
Therefore, I prefer for the first prototype similar implementation like constraint with 

{{{
 Real a,b,c,d,e;
.....
equation
....
final constraint
 a*b + c/d < e;
constraint
...
}}}



"	discussion	accepted	normal	Future	Frontend	trunk			Mahder Alemseged Gebremedhin
