-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDefault_Values.py
executable file
·131 lines (96 loc) · 3.79 KB
/
Default_Values.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 13 11:33:23 2016
@author: marcovaccari
"""
from casadi import *
from casadi.tools import *
from matplotlib import pylab as plt
import math
import scipy.linalg as scla
import numpy as np
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
estimating = False # Set to True if you want to do only the estimation problem
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
ssjacid = False # Set to True if you want a linearization of the process in ss point
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
StateFeedback = False # Set to True if you have all the states measured
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Fp_nominal = False # Define the nominal case: fp = fx_model e hp = fy_model
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
offree = 'no' # Set to 'lin'/'nl' to have a linear/non linear disturbance model
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## BOUND CONSTRAINT
# Input bounds
umin = None
umax = None
# State bounds
xmin = None
xmax = None
# Output bounds
ymin = None
ymax = None
# Input bounds on the target problem
umin_ss = None
umax_ss = None
# State bounds on the target problem
xmin_ss = None
xmax_ss = None
# Output bounds on the target problem
ymin_ss = None
ymax_ss = None
# Input bounds on the dynamic problem
umin_dyn = None
umax_dyn = None
# State bounds on the dynamic problem
xmin_dyn = None
xmax_dyn = None
# Output bounds on the dynamic problem
ymin_dyn = None
ymax_dyn = None
# Disturbance bounds
dmin = None
dmax = None
# DeltaInput bounds
Dumin = None
Dumax = None
# State noise bounds
wmin = None
wmax = None
# Ouput noise bounds
vmin = None
vmax = None
## OBJECTIVE FUNCTION
## Steady-state optimization
QForm_ss = False # Set true if you have setpoint and you want y-y_sp and u-u_sp as optimization variables
DUssForm = False # Set true if you want DUss = u_s[k]-u_s[k-1] as optimization variables rather than u_s[k]
Adaptation = False # Set true to have the modifiers-adaption method
## Dynamic optimization
ContForm = False # Set true if you want to integrate the objective function in continuous form
TermCons = False # Set true if you want the terminal constraint
QForm = False # Set true if you want x[k]-xs and u[k]-us as optimization variables
DUForm = False # Set true if you want DU = u[k]-u[k-1] as optimization variables rather than u[k]
DUFormEcon = False # Set true if you want DU = u[k]-u[k-1] as optimization variables added to u[k] in economic MPC
## Solver
Sol_itmax = 100
Sol_Hess_constss = 'no' # Set True if you want to calculate Hessian matrices every iteration
Sol_Hess_constdyn = 'no' # Set True if you want to calculate Hessian matrices every iteration
Sol_Hess_constmhe = 'no'
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
## Estimator
#### Steady-state Kalman filter tuning params #################################
kalss = False # Set True if you want the Steady-state Kalman filter
#### Luemberger observer tuning params ######################################
lue = False # Set True if you want the Luemberger observer
#### Kalman filter tuning params #############################################
kal = False # Set True if you want the Kalman filter
#############################################################################
#### Extended Kalman filter tuning params ###################################
ekf = False # Set True if you want the Kalman filter
#### Moving Horizon Estimation params ###################################
mhe = False # Set True if you want the MHE
Collocation = False # Set True if want the Collocation Method
LinPar = True
slacks = False
slacksG = True
slacksH = True