Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to solve for P(t) relating two sets of state variables?

조회 수: 1 (최근 30일)
Andrew Poissant
Andrew Poissant 2017년 10월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
I have two sets of state variables, A and Ap, and I need to solve for P(t), which relates the two. The equation to do so is Ap = inv(P)*(A*P-d/dt(P)). Does anyone know how I can solve for P(t)? I am stumped because I am unsure as to how to handle the inverted matrix of P and the derivative of the P matrix.
A = [t 1; 1 t];
Ap = [0 1; 2-t^2 2*t];

답변 (1개)

KSSV
KSSV 2017년 10월 16일
YOu do hand calculation and get p(t)..on solving the equation becomes:
p(t+1) = p(t)+Ap*(I-A)*dt ; % I have used derivative formula for dp/dt
Using loop and initial conditions for p(1)
A = @(t) [t 1 ; 1 t] ;
Ap = @(t) [0 1 ; 2-t.^2 2*t] ;
t0 = 0. ; dt = 0.01; t1 = 10. ; % times
t = t0:dt:t1 ; % time step
% intial conditions
p = cell(1,length(t)) ;
p{1} = rand(2) ;
% time intergaration
for i = 2:length(t)
p{i} = p{i-1}+Ap(t(i))*(eye(2)-A(t(i)))*dt ;
end
  댓글 수: 1
Andrew Poissant
Andrew Poissant 2017년 10월 16일
편집: Andrew Poissant 2017년 10월 16일
Hello, thank you for the reply. Is there any way to get the answer in analytical form? Maybe ode45 would be used here? I need the P(t) matrix in terms of t in the end. Thanks!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by