Tip: 1. Related functions that may use matlab include:
Whole function quad (); A constrained nonlinear optimization function fmincon (); Solving ordinary differential equation function ode45 ()
2. Global quantity needs to be defined globally;
3. Pay attention to the definition of integrand f in quad ()
These tips are already very useful. Understand the usage of each function carefully, and then ensure that the output of these key functions is correct, basically.