Skip to content

Commit

Permalink
fixed bug where old IVP Solver Toolbox syntax was used for matrix-vec…
Browse files Browse the repository at this point in the history
…tor IVP conversions
  • Loading branch information
tamaskis committed Dec 8, 2022
1 parent 015bf38 commit 73cdce0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified EXAMPLES.mlx
Binary file not shown.
Binary file modified Riccati_Differential_Equation.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions solve_riccati_ode.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% [t,P] = solve_riccati_ode(A,B,Q,R,S,PT,tspan)
%
% Copyright © 2021 Tamas Kis
% Last Update: 2022-08-28
% Last Update: 2022-12-08
% Website: https://tamaskis.github.io
% Contact: tamas.a.kis@outlook.com
%
Expand Down Expand Up @@ -92,7 +92,7 @@
dPdt = @(t,P) -(A.'*P+P*A-(P*B+S)/R*(B.'*P+S.')+Q);

% converts matrix-valued ODE to vector-valued ODE
dydt = mat2vec_ode(dPdt);
dydt = mat2vec_ODE(dPdt,n);

% converts matrix initial condition to vector initial condition
yT = mat2vec_IC(PT);
Expand All @@ -102,7 +102,7 @@

% transforms solution matrix for vector-valued ODE into solution array
% for matrix-valued ODE
P = vec2mat_sol(y);
P = vec2mat_sol(y,n);

% reorders t so that time is increasing
t = flipud(t);
Expand Down

0 comments on commit 73cdce0

Please sign in to comment.