Commit 14c1702e authored by Jorn Baayen's avatar Jorn Baayen

Use delay() operator in ModelicaMixin unit tests.

parent 2a3ffbf7
......@@ -12,7 +12,7 @@ model TestModelWithInitial
output Real z;
input Real x_delayed(fixed=false);
Real x_delayed;
output Real switched;
......@@ -26,6 +26,8 @@ equation
der(x) = k * x + u;
der(w) = x;
x_delayed = delay(x, 0.1);
alias = x;
y + x = 3.0;
......
......@@ -36,10 +36,6 @@ class TestProblem(ControlTreeMixin, ModelicaMixin, CollocatedIntegratedOptimizat
# Do nothing
pass
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
@property
def ensemble_size(self):
return 3
......@@ -145,10 +141,6 @@ class TestProblemDijkverruiming(ControlTreeMixin, ModelicaMixin, CollocatedInteg
# Do nothing
pass
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
@property
def ensemble_size(self):
return 12
......
......@@ -32,10 +32,6 @@ class TestProblem(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegratedOptim
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
def constant_inputs(self, ensemble_member):
# Constant inputs
return {'constant_input': Timeseries(np.hstack(([self.initial_time, self.times()])), np.hstack(([1.0], np.linspace(1.0, 0.0, 21))))}
......@@ -258,10 +254,6 @@ class TestProblemPathGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedIntegr
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
def constant_inputs(self, ensemble_member):
# Constant inputs
return {'constant_input': Timeseries(np.hstack(([self.initial_time, self.times()])), np.hstack(([1.0], np.linspace(1.0, 0.0, 21))))}
......@@ -433,10 +425,6 @@ class TestProblemPathGoalsSmoothing(GoalProgrammingMixin, ModelicaMixin, Colloca
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
def constant_inputs(self, ensemble_member):
# Constant inputs
return {'constant_input': Timeseries(np.hstack(([self.initial_time, self.times()])), np.hstack(([1.0], np.linspace(1.0, 0.0, 21))))}
......@@ -501,10 +489,6 @@ class TestProblemStateGoals(GoalProgrammingMixin, ModelicaMixin, CollocatedInteg
parameters['u_max'] = 2.0
return parameters
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
def constant_inputs(self, ensemble_member):
# Constant inputs
return {'constant_input': Timeseries(np.hstack(([self.initial_time, self.times()])), np.hstack(([1.0], np.linspace(1.0, 0.0, 21))))}
......
......@@ -13,6 +13,8 @@ import sys
import os
logger = logging.getLogger("rtctools")
logger.setLevel(logging.DEBUG)
class TestProblem(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
......@@ -34,10 +36,6 @@ class TestProblem(ModelicaMixin, CollocatedIntegratedOptimizationProblem):
# Do nothing
pass
def delayed_feedback(self):
# Delayed feedback
return [('x', 'x_delayed', 0.1)]
def constant_inputs(self, ensemble_member):
# Constant inputs
return {'constant_input': Timeseries(self.times(), 1 - self.times())}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment