Step response of a non-linear differential equation system
Step response of a non-linear differential equation system:
Responses to step inputs are frequently evaluated in process control either to model disturbances or to tune controllers. While Matlab has options to generate step response for linear systems, there seems to be no function to generate the step responses for non-linear ODE systems coded in Matlab (although this can be done in Simulink). The following function Step_ODE implements the response of the non-linear system states to the step changes in parameters of the model. The stepped parameters must be made as input arguments to the function describing the differential equations.
[t,y] = Step_ODE(fhan, Solver, t_s, t_t, Val_ini, Val_fin, ini)
------------------------------
Description of input arguments:
------------------------------
fhan - Function handle for the differential equation function
Solver - String name of the ODE solver
t_s - Step time
t_t - Total simulation time
Val_ini - Vector of initial values (before step) for the inputs or parameters
Val_fin - Vector of final values (after step) for the inputs or parameters
ini - Intial value vector for the differential equations
------------------------------
Example usage for a 2 state, 2 parameter system:
Val_ini = [0.3 0.4];
Val_fin = [0.5 0.1];
t_s = 150;
t_t = 300;
ini = [0 0];
Solver = 'ode23t';
fhan = @myfun;
[t,y] = Step_ODE(fhan, Solver, t_s, t_t, Val_ini, Val_fin, ini);
plot(t,y(:,1))
figure;
plot(t,y(:,2))
function dydt = myfun(~,y, Lam)
dydt = zeros(2,1);
dydt(1) = -Lam(1) * y(1) + 5 ;
dydt(2) = -Lam(2) * y(2) + 10 * y(1);
end
Periasamy Vijay
27/11/2017
Cita come
Vijay Periasamy (2025). Step response of a non-linear differential equation system (https://it.mathworks.com/matlabcentral/fileexchange/65201-step-response-of-a-non-linear-differential-equation-system), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0.0 | Corrected help content in description
|
