Skip to content

Commit f325c27

Browse files
committed
Added EPFC.pdf file.
1 parent ee843d7 commit f325c27

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

MPC Explanations/EPFC.pdf

815 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This repo includes the MATLAB codes for a DMC and an EPFC controller.
33

44
## DMC
5-
<!-- Add content here -->
5+
66

77
## EPFC
88
An extended PFC controller is implemented to control a nonlinear system. The exemplar system considered is a cart with a nonlinear spring attached to it, as shown in the image:
@@ -26,15 +26,17 @@ This change of variables allows the new system to have a one-to-one relationship
2626
```matlab
2727
u = v;
2828
```
29-
A very simple explanation of EPFC is included in to-be-completed.
29+
A very simple explanation of EPFC is included in [this file](docs/EPFC.pdf)
30+
.
3031

3132
The functions and scripts are as follows:
3233
### functions
3334
`run_simulation` runs the simulation given
3435
- linearization method: set to 'perturbation' or 'jacobian'. Jacobian uses the provided Jacobian of the system (which should be provided in `linearize_dynamics`). The perturbation method uses the predictive model and applies two inputs. One where the input is kept unchanged as it is at this sample time, and one with a small change in the control input value. By dividing the change of the output in the two cases by the change of the input, a linearized model is achieved.
3536
- `linearize_dynamics` provides the jacobian for the 'jacobian' lineariztion method. You should set this function according to your system's dynamics.
3637
- `get_step_response_nonlinear` provides the outputs for a given constant input. It is used in 'perturbation' linearization technique.
37-
- `update_nonlinear_state` moves the nonlinear system's dynamics forward one step. A considerably smaller step size (compared to control sample time) should be considered when simulating the nonlinear system itself. The `substeps` parameter can be tuned for that (keep it at least at 10 for a realistic simulation).
38+
- `update_nonlinear_state` moves the nonlinear system's dynamics forward one step. You can insert your system dynamics here.
39+
A considerably smaller step size (compared to control sample time) should be considered when simulating the nonlinear system itself. The `substeps` parameter can be tuned for that (keep it at least at 10 for a realistic simulation).
3840
- `update_nonlinear_state_actual` is used when model mismatch is considered. You can skip setting up this function if your model is exact. If not, use the model at hand in `update_nonlinear_state` and in `update_nonlinear_state_actual` write the actual system model (unknown).
3941
- `plot_simulation_results` and `plot_comparison_results` are used for plotting and saving the outputs. The outputs are saved in a folder called `simulation_results` in `downloads`. If no such folder exists, one will be created.
4042

0 commit comments

Comments
 (0)