This document contains a program that takes user input for the values of Trhs, Tlhs, Tupp, and Tlow. It then uses these values to define the coefficients of a matrix equation representing an elliptic partial differential equation. The program solves the matrix equation and outputs the resulting values of T1, T2, T3, and T4.
This document contains a program that takes user input for the values of Trhs, Tlhs, Tupp, and Tlow. It then uses these values to define the coefficients of a matrix equation representing an elliptic partial differential equation. The program solves the matrix equation and outputs the resulting values of T1, T2, T3, and T4.
This document contains a program that takes user input for the values of Trhs, Tlhs, Tupp, and Tlow. It then uses these values to define the coefficients of a matrix equation representing an elliptic partial differential equation. The program solves the matrix equation and outputs the resulting values of T1, T2, T3, and T4.
Tlhs=input('\n Enter value of Tlhs='); Tupp=input('\n Enter value of Tupp='); Tlow=input('\n Enter value of Tlow='); a=[4 -1 -1 0; -1 4 0 -1; -1 0 4 -1; 0 -1 -1 4]; b(1,1)=Tlhs+Tupp; b(2,1)=Tupp+Trhs; b(3,1)=Tlhs+Tlow; b(4,1)=Tlow+Trhs; v=linsolve(a,b); fprintf('\n result=\n'); for i=1:4 fprintf('\n T%d:%0.4f',i,v(i)); end
PROGRAM OUTPUT
Enter value of Trhs=100
Enter value of Tlhs=0 Enter value of Tupp=100 Enter value of Tlow=0 result= T1:50.0000 T2:75.0000 T3:25.0000 T4:50.0000>>