Answered
reinforcement learning train-progress
Hi, If you have saved the training results, you can use this function to recreate the plot.

3 years ago | 0

| accepted

Answered
How do I randomize the value in a constant block for a local reset function for RL training
The num2str([10 10 10]) evaluates to '10 10 10' without brackets which is what causes the problem. Instead, just put '[10 10 10]...

3 years ago | 0

| accepted

Answered
Example: Train DDPG Agent to Swing Up and Balance Pendulum: Where are mechanical constants initialized ?
I am assuming the question is about this example. Inside the pendulum subsystem, we are modeling the equation (I + ml^2) theta_...

3 years ago | 1

| accepted

Answered
How to send values to workspace during reinforcement agent validation for further plot and analysis. Using "RUN" button on Simulink produces some difference from Validation.
Hello, First, to answer your point about the simulation differences between using the "Play" button vs using the "sim" command ...

3 years ago | 0

| accepted

Answered
MPC Toolbox : How to set "time optimal" Control problem using Custom Constrain function?
Hello, Unfortunately you cannot solve time-optimal problems with Model Predictive Control Toolbox because time cannot be used a...

3 years ago | 0

| accepted

Answered
Is it possible to provide output anticipation with the non linear Model Predictive Toolbox?
Hello, Yes it is possible to use previewing with nonlinear MPC, here is an example that shows how to do that.

3 years ago | 0

| accepted

Answered
How to extract the trained RL agent in MATLAB to C++?
Please take a look at this doc page.

3 years ago | 0

| accepted

Answered
In Simulink unable to change the simulation time
During training, each episode/simulation will last for Tf seconds at most. It may end sooner depending on the value of MaxStepsP...

3 years ago | 0

| accepted

Answered
Does Simulink Coder support code generation of custom solver functions for Nonlinear MPC blocks?
Hi Arnold, Unfortunately, right now you can only generate code using 'fmincon'. Custom nlp solvers can currently only be used f...

3 years ago | 0

| accepted

Answered
Invalid size or type for observation specification. Simulink Environment for Reinforcement Learning
I had a look at the attached zip. The error is on line 33 in 'Tentativo1.m'. This line should be mdl = 'RL'; % make sure your ...

3 years ago | 0

Answered
Error while training a two-agent environment: Action specification of agent at index 2 incompatible with environment
The issue seems to be that the action specifications do not match what the environment model expects. Whether you are using Simu...

3 years ago | 0

Answered
Using MPC Designer App with Plant Dynamics Model containing multiple Sign blocks
It seems like you have some kind of switched system (?). If that's the case, maybe try to linearize each dynamic model/"sign" se...

3 years ago | 0

Answered
constraint on action space somehow that each action can be chosen only once
Unfortunately, this is not possible as of R2022b out of the box. You would need to create a custom agent to implement this behav...

3 years ago | 0

Answered
Extended Kalman Filter state transition parameters
Glad you figured it out. By the way, this example shows the general workflow of using NLMPC + EKF with additional parameters

3 years ago | 0

Answered
RL Stop training criteria
I believe that for event-based training, you need to adjust your stopping/saving criteria accordingly. For example the agent wil...

3 years ago | 0

Answered
How to adjust internal sample time of MPC?
There is a way to do that, but first you need to consider whether you actually need to run your MPC controller that fast. As you...

3 years ago | 0

| accepted

Answered
Transfer a variable at the end of one episode to the next episode when training an agent in RL
The way to do this would be using the reset function mechanism provided in Reinforcement Learning Toolbox. Please take a look at...

3 years ago | 0

Answered
DDPG Agent: Noise settings without any visible consequence
Your standard deviation is very high compared to the action range that you have set. As a result, when noise is added to the tan...

3 years ago | 0

Answered
Reinforcement learning agent stops training unexpectedly?
The picture also mentioned why training stopped in the last two rows. In this case, it seems you have a criterion that stops tra...

3 years ago | 0

Answered
Reinforcement learning unable to dupilcapte the best reward i had during training
Just because the reward of a single episode meets the desired performance, this does not mean that when you stop ttraining you s...

3 years ago | 0

Answered
Triggering an action of an RL agent in a Simulink environment (SimEvents) via event
As of R2022a you can train reinforcement learning agents with event-based simulations. Please take a look at the release notes h...

3 years ago | 0

Answered
Agent diverge after converge usingTD3
Please see answer here. This behavior could happen if the optimization moves to explore a different direction. I would suggest s...

3 years ago | 0

Answered
Use of RL Agent instead of PID
Here is an example that does exactly what you mentioned, i.e. replaces a PID controller with an RL Agent

3 years ago | 0

Answered
My agent finds a good solution but it does not repeat it and turns back to bad behavior again (Reinforcement Learning )
This picture shows progress for a very small number of episodes. You should wait for a few hundred episodes before you can evalu...

3 years ago | 0

Answered
Oscillating reward in DDPG using Matlab Reinforcement learning toolbox with simulink environment
I think I have mentioned this in another post as well, but you should not expect your episode reward to be monotonic. Once it "c...

3 years ago | 0

Answered
How to Use the Reinforcement Learning Toolbox to Draw Observations While Training?
You can use the information on plotting and visualization from this page to plot/visualize information during training

3 years ago | 0

Answered
Determine the reward value to stop training in RL agent
For some problems you may be able to calculate what the maximum reward that can be collected in an episode is, so you can use th...

3 years ago | 0

| accepted

Answered
How to assign values to MV Targets of MPC object from cell array
You could specify values individually mpcobj.MV(1).Target=99; mpcobj.MV(2).Target=10; or you could do it in one line as follo...

3 years ago | 0

| accepted

Answered
problem with MPC controller
It seems to me that the solution is to add a constraint on the rate of change of the manipulated variable Ic. That way you can a...

3 years ago | 0

Answered
How can I have 'measured states' in a MPC controller object in Simulink?
Model Predictive Control Toolbox includes built-in Kalman filters for the linear MPC API and blocks. So you really don't need to...

3 years ago | 0

| accepted

Load more