Skip to content

Commit 170818d

Browse files
authored
Update README.md
1 parent b81d62d commit 170818d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Notes were produced on the subject in book form written in portuguese language,
5858

5959
[[Download the book here]](https://github.com/lucasmoschen/Optimal_Control_Biological/blob/master/notes/book.pdf)
6060

61-
It was also developed in notebooks all the laboratories studied in these notes. For these simulation, *Python Programming Language* associated with *Jupyter Notebook* was used, because of its easy usage and aimple interpretation. A class in `optimal_control_class.py` file was designed to deal with all laboratories, no need to worry with the code, initially. This code contains the famous method in the area called forward-backward sweep.
61+
It was also developed in notebooks all the laboratories studied in these notes. For these simulation, *Python Programming Language* associated with *Jupyter Notebook* was used, because of its easy usage and simple interpretation. A class in `optimal_control_class.py` file was designed to deal with all laboratories, no need to worry with the code, initially. This code contains the famous method in the area called forward-backward sweep.
6262

6363
### Built With
6464

@@ -100,8 +100,8 @@ After opening each notebook, it's easy to follow the guide.
100100

101101
If one have a optimal control problem, it can be used the Python class developed for your case. This function can handle problems with:
102102

103-
- Initial condition of the states (obliged);
104-
- A characterization of the control in order to update it each iteration, that is, write $u = f(t, x, \lambda)$ (obliged);
103+
- Initial conditions of the states (obliged);
104+
- A characterization of the control in order to update it each iteration, that is, write $$u = f(t, x, \lambda)$$ (obliged);
105105
- Linear payoff terms (optional);
106106
- Bounds in the control (optional);
107107
- One or several states.
@@ -117,17 +117,21 @@ For example, in the Laboratory 8, we first define these variables
117117

118118
![example1](images/example-1.png)
119119

120-
Because we have more than one state, we specify `n_states = 3`. We also specify the bounds. It must be specified as a list of tuples indicating for each control, its bounds. `numpy.inf` is a possibility. However, the control characterization must be written inserting the bounds as specified in the example. If one have a linear payoff term, it can be specified as a function: `diff_phi = lambda x, params: np.array([C, D, E])`. Observe that the parameters must be passed as a dictionary, including in the functions.
120+
Because we have more than one state, we specify `n_states = 3`. We also specify the bounds. The bounds must be specified as a list of tuples for each control and `numpy.inf` is a possibility. However, the control's characterization must be written including the bounds as specified in the example. If one have a linear payoff term, it can be specified as a function:
121121

122-
![example2](images/example-2.png)
122+
`diff_phi = lambda x, params: np.array([C, D, E])`.
123+
124+
Observe that the parameters must be passed as a dictionary, including in the functions. At last, we define the final time and initial condition and use it in the `solve` method.
123125

124-
At last, we define the final time and initial condition and use it in the `solve` method.
126+
![example2](images/example-2.png)
125127

126128
If one has a Bang-Bang problem, the characterization of u is given by
127129

128130
`u = lambda t, x, lambda, params: a if psi(t) < 0 else b`
129131

130-
Suppose we have a nonlinear payoff term or we define a final value for some state, in these cases, we do not have the final value for the adjoint corresponding to the state with that additional condition. In this case, the adapted forward-backward sweep must be used. It's not developed for so, but can be used in the following manner: one define the list `free_adj_final` with the adjoints with that characteristic. Associated with that, one make a guess passing it in `theta_list` parameter. For more details, consult the notebook `Chapter21-examples.ipynb`.
132+
Suppose we have a nonlinear payoff term or we define a final value for some state, in these cases, we do not have the final value for the adjoint corresponding to the state with that additional condition. In this case, the adapted forward-backward sweep must be used. It's not developed for so, but can be used in the following manner: one define the list `free_adj_final` with the adjoints with that characteristic. Associated with that, one make a guess passing it in `theta_list` parameter. For more details, consult the notebook
133+
134+
`Chapter21-examples.ipynb`.
131135

132136
## Contributing
133137

0 commit comments

Comments
 (0)