How do I integrate a matrix?

I want to integrate this equation above with the matrix [T] already previuosly defined. Can anyone help here...?

5 comentarios

madhan ravi
madhan ravi el 10 de Mayo de 2020
Editada: madhan ravi el 10 de Mayo de 2020
What’s rj? A vector? Can you upload your T matrix? How are the variables defined? Upload your code.
clear; clc; close all;
% Heat Transfer Coefficient, Material Properties, Ambient/Base Temperature
h = 150; cp = 510; rho = 7810; k = 11; Tinf = 24;
alpha = k/(rho*cp); R=0.1; T0=350;
N = 101; % Number of nodes
dt = 25e-03; % Time step, [s]
min = 1; % Number of minutes for solution end
t = 0:dt:60*min; % Skylar, I can adjust either the min = value to a fraction of a min or I can adjust the t = 60 portion to either 1s or 10 s...
M = length(t);
r = linspace(0,R,N);
dr = r(2) - r(1);
a = zeros(1,N);
b = zeros(1,N);
c = zeros(1,N);
a(1) = 0;
a(N) = 2*alpha/dr^2;
b(1) = -6*alpha/dr^2;
b(N) = (-2*alpha/dr^2) * (1+(h*dr/k) + (h*dr^2/(R*k)));
c(1) = 6*alpha/dr^2;
c(N) = 0;
for i = 2:N-1
a(i) = (alpha/dr^2) - alpha/(dr*r(i));
b(i) = -2*alpha/dr^2;
c(i) = (alpha/dr^2) + alpha/(dr*r(i));
end
Lrr = diag(a(2:N),-1) + diag(b) + diag(c(1:N-1),1);
d = zeros(N,1);
d(N) = ((2*alpha*h/(R*k)) + (2*alpha*h/(dr*k)))*Tinf;
I = eye(N);
A = I - (dt/2)*Lrr;
B = I + (dt/2)*Lrr;
invA = inv(A);
T = zeros(N,M);
Taylor Carrington
Taylor Carrington el 10 de Mayo de 2020
rj is just one of the selected 101 nodes.
Ameer Hamza
Ameer Hamza el 10 de Mayo de 2020
Can you show the equation of matrix T in mathematical form?
Taylor Carrington
Taylor Carrington el 10 de Mayo de 2020

Iniciar sesión para comentar.

Respuestas (1)

darova
darova el 11 de Mayo de 2020

0 votos

What about this?
R = 5;
r = linspace(0,R,100);
T = rand(50,100);
rr = repmat(r,50,1); % 2d matrix r
F1 = 3/R^3*trapz(r,T.*rr.^2,2); % integrate
Is it understandable?

Etiquetas

Preguntada:

el 10 de Mayo de 2020

Respondida:

el 11 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by