I have some questions mainly related to how to implement a Moving Horizon Estimator (MHE) in the MATLAB interface:
Is the same functionality possible through the MATLAB interface as with the C++ code base?
How can the OutputFcn() in MATLAB be chosen to be something else than the full state vector? It is not clear to me from the help menu. In the C++ code base I see it is possible to write for instance: OutputFcn g;
g << xB;
g << 500.0vB + F;*
How can an estimator be included in the Controller class of the MATLAB interface? I see from the help menu that the usage of the Controller class is: Controller(controllaw[, reference] .
With the C++ code base it is possible to write: OutputFcn identity;
DynamicSystem dynamicSystem( f,identity );
Process process( dynamicSystem,INT RK45 );
RealTimeAlgorithm alg( ocp );
DynamicFeedbackLaw feedbackLaw( alg,0.05 );
Estimator trivialEstimator;
StaticReferenceTrajectory zeroReference;
Controller controller(
feedbackLaw,trivialEstimator,zeroReference );
If a MHE is to be included with the simulation environment, is there a way to easily handle the fact that measurements are not available for the full horizon in the beginning of the simulation?
Is it ok to use OCP(tStart,tEnd) with a negative start time tStart?
Can I also request that you include one or two examples/tutorial with MHEs in the future?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First of all: the only thing the MATLAB interface does is translating your problem formulation to the C++ syntax. This means that all things that are possible in the C++ interface of ACADO, should also be possible in the MATLAB interface. Or at least that is the principle, because we are just a few developers/PhD students in this project.
So currently, the MATLAB interface is sometimes more powerful than the C++ interface and the other way around.
An example: instead of working with DifferentialEquation/OutputFcn objects, you can often just use arrays of expressions in the MATLAB interface (behind the scene it will then create these objects itself).
Now, to get to your question: on which C++ example is your request for MHE implementation in the MATLAB interface based? I myself haven't implemented MHE in ACADO, so I don't know how it would look like in C++ (maybe somebody else can help here).
But you can make any OutputFcn in MATLAB too like this:
h = acado.OutputFcn;
h(:) = [ ... ]; <-- write here your vector of expressions
And why exactly would you want to define OCP(tStart,tEnd) with tStart a negative start time? How does that help you?
Rien
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your response, that clarified question 1. and 2. in the original post.
I haven't found a C++ example on MHE either, but if I am allowed to make a request I would like to see a closed-loop simulation like this one, http://acado.sourceforge.net/doc/html/example_015.html
except that some states are not measured and their estimates need to be constructed by MHE. I see that there is already a MHEalgorithm C++ class: http://acado.sourceforge.net/doc/html/classMHEalgorithm.html
Alternatively, a MHE implementation of the overhead crane example in your paper "Fast auto generated ACADO integrators and application to MHE with multi-rate measurements".
Now to my question 5. above: The reason why I asked if I can define an OCP with a negative start time, is that the the moving horizon estimation cost function is based on previous measurements. So relative to the current time in the simulation environment, these measurements are taken at negative time instants.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have some questions mainly related to how to implement a Moving Horizon Estimator (MHE) in the MATLAB interface:
OutputFcn g;
g << xB;
g << 500.0vB + F;*
With the C++ code base it is possible to write:
OutputFcn identity;
DynamicSystem dynamicSystem( f,identity );
Process process( dynamicSystem,INT RK45 );
RealTimeAlgorithm alg( ocp );
DynamicFeedbackLaw feedbackLaw( alg,0.05 );
Estimator trivialEstimator;
StaticReferenceTrajectory zeroReference;
Controller controller(
feedbackLaw,trivialEstimator,zeroReference );
Can I also request that you include one or two examples/tutorial with MHEs in the future?
Thanks!
Hello,
First of all: the only thing the MATLAB interface does is translating your problem formulation to the C++ syntax. This means that all things that are possible in the C++ interface of ACADO, should also be possible in the MATLAB interface. Or at least that is the principle, because we are just a few developers/PhD students in this project.
So currently, the MATLAB interface is sometimes more powerful than the C++ interface and the other way around.
An example: instead of working with DifferentialEquation/OutputFcn objects, you can often just use arrays of expressions in the MATLAB interface (behind the scene it will then create these objects itself).
Now, to get to your question: on which C++ example is your request for MHE implementation in the MATLAB interface based? I myself haven't implemented MHE in ACADO, so I don't know how it would look like in C++ (maybe somebody else can help here).
But you can make any OutputFcn in MATLAB too like this:
h = acado.OutputFcn;
h(:) = [ ... ]; <-- write here your vector of expressions
And why exactly would you want to define OCP(tStart,tEnd) with tStart a negative start time? How does that help you?
Rien
Hi,
thank you for your response, that clarified question 1. and 2. in the original post.
I haven't found a C++ example on MHE either, but if I am allowed to make a request I would like to see a closed-loop simulation like this one, http://acado.sourceforge.net/doc/html/example_015.html
except that some states are not measured and their estimates need to be constructed by MHE. I see that there is already a MHEalgorithm C++ class: http://acado.sourceforge.net/doc/html/classMHEalgorithm.html
Alternatively, a MHE implementation of the overhead crane example in your paper "Fast auto generated ACADO integrators and application to MHE with multi-rate measurements".
Now to my question 5. above: The reason why I asked if I can define an OCP with a negative start time, is that the the moving horizon estimation cost function is based on previous measurements. So relative to the current time in the simulation environment, these measurements are taken at negative time instants.