How to solve an integral of a matrix?

Hello,
I would like to get help to solve a control system that carries an integral of the exponential matrix.
I have tried several times and have not achieved a good solution.
The final value of the variable "psi1" should be a 2x1 matrix.
Thank you for your help.
Regards
clc, clear all
%%
% Input variables
fsw = 1*10^6; %Frecuencia de conmutación
T = 0.5*1/fsw; %Semiperiodo
Tsamp = 1/fsw; %Periodo de muestreo, una muestra cada periodo
Po = 280; %Potencia de salida. Si la bajamos, la transición resonante es más pronunciada y el modelo menos preciso
Vg = 150; %Tensión de entrada
Vo = 12; %Tensión de salida deseada.
R = (Vo*Vo)/Po;
Nr = 1;
L = 9.5*10^-6; %Inductancia Serie
C = 1*10^-6; %Capacidad de salida.
n = 1/12; %Indice de transformación
D = (-sqrt(-(4*L*Po*Vg*Vo*T*n)+Vg^2*Vo^2*T^2)+Vg*Vo*T)/(2*Vg*Vo*T);
A1=[0 -1/(n*L); 1/(n*C) -1/(R*C)];
B1=[1/L ; 0];
t1=(1-D)*T;
syms 't'
psi1= int(expm(A1*t)*B1,t,0,t1);

 Accepted Answer

Try this —
% Input variables
fsw = 1*10^6; %Frecuencia de conmutación
T = 0.5*1/fsw; %Semiperiodo
Tsamp = 1/fsw; %Periodo de muestreo, una muestra cada periodo
Po = 280; %Potencia de salida. Si la bajamos, la transición resonante es más pronunciada y el modelo menos preciso
Vg = 150; %Tensión de entrada
Vo = 12; %Tensión de salida deseada.
R = (Vo*Vo)/Po;
Nr = 1;
L = 9.5*10^-6; %Inductancia Serie
C = 1*10^-6; %Capacidad de salida.
n = 1/12; %Indice de transformación
D = (-sqrt(-(4*L*Po*Vg*Vo*T*n)+Vg^2*Vo^2*T^2)+Vg*Vo*T)/(2*Vg*Vo*T);
A1=[0 -1/(n*L); 1/(n*C) -1/(R*C)];
B1=[1/L ; 0];
t1=(1-D)*T;
psi1= integral(@(t)expm(A1*t)*B1,0,t1, 'ArrayValued',1)
psi1 = 2×1
0.0247 0.0379
Use the integral function with the 'ArrayValued', name-value pair.
.

2 Comments

Thank you very much!
It works perfectly!
As always, my pleasure!

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!