How do I create matrix A using initial and boundary conditions?

3 vues (au cours des 30 derniers jours)
SPerera
SPerera le 29 Août 2024
Commenté : SPerera le 30 Août 2024
Using below data, how do I create matrix A?
x = 0:0.2:2;
t = 0:30;
Initial condition:
Boundary conditions: and
  5 commentaires
Torsten
Torsten le 30 Août 2024
Modifié(e) : Torsten le 30 Août 2024
The easiest way is to make A of size (NxN) and B of size (Nx1) where you define
u_1^(i+1) = u_1^(i) (since u(0,t) remains constant at 0 for all t)
(u_j^(i+1) - u_j^(i))/dt = alpha * (u_(j-1)^(i+1)-2*u_j^(i+1)+u_(j+1)^(i+1)) (2 <= j <= N-1)
u_N^(i+1) = u_N^(i) (since u(1,t) remains constant at 0 for all t)
as N linear equations in the unknowns u_1^(i+1),u_2^(i+1),...,u_N^(i+1).
SPerera
SPerera le 30 Août 2024
@Torsten and @Rahul Thank you all

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by