Calculate function with given t

1 view (last 30 days)
Guan-Lin Chen
Guan-Lin Chen on 6 Nov 2020
Answered: KSSV on 6 Nov 2020
clc
clear all
close all
syms t
A = [-1, 1, 0;
1,-2, 1;
0, 1, -1];
[P,D] = eig(A)
Phi = P*expm(D*t)*inv(P)
thetanot=[0.1;0.3;0.2]
t_t=Phi*thetanot
dt = 1/1000;
t = 0:dt:1000*dt;
S1=sum(t_t(1,1))
Where S1 =
How do I plot the S1 with t ?

Accepted Answer

KSSV
KSSV on 6 Nov 2020
Read about fplot/ ezplot.
clc
clear all
close all
syms t
A = [-1, 1, 0;
1,-2, 1;
0, 1, -1];
[P,D] = eig(A)
P = 3×3
-0.4082 -0.7071 0.5774 0.8165 0.0000 0.5774 -0.4082 0.7071 0.5774
D = 3×3
-3.0000 0 0 0 -1.0000 0 0 0 -0.0000
Phi = P*expm(D*t)*inv(P)
Phi = 
σ3σ41538314690327739G2et40564819207303340847894502572032σ1σ2σ44117251858840527G2et81129638414606681695789005144064σ1σ4+6333629018233573058406165478453et822752278660603021077484591278675252491367932816789931674304512+2e3t3σ4+4117251858840527G2et81129638414606681695789005144064σ1σ2σ4+1538314690327739G2et40564819207303340847894502572032σ1σ3where  σ1=G2G3G6e3t18  σ2=σ4et2+e3t6  σ3=σ4+et2+e3t6  σ4=e7734480885t773712524553362671811952643
thetanot=[0.1;0.3;0.2]
thetanot = 3×1
0.1000 0.3000 0.2000
t_t=Phi*thetanot
t_t = 
σ2et20+e3t20σ3σ1σ2+19000887054700719175218496435359et8227522786606030210774845912786752524913679328167899316743045120+e3t5+1538314690327739G2et405648192073033408478945025720320σ1σ2+et20+e3t20+σ3σ1where  σ1=G2G3G6e3t60  σ2=e7734480885t773712524553362671811952645  σ3=12351755576521581G2et811296384146066816957890051440640
dt = 1/1000;
t = 0:dt:1000*dt;
S1=sum(t_t(1,1)) ;
fplot(S1)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!