Question: Using the system of linear equations I have built, figure out the temperatures of the nodes and how many iterations using my python code of

Using the system of linear equations I have built, figure out the temperatures of the nodes and how many iterations using my python code of the conjugate gradient method. The linear equation I built was based of a thin plate. I have linked the linear equation question to get a better understanding on what the teperatures are and to solve it based of my code. Ihave pasted my linear equation and I need to use the computer program i have built based of the conjugate gradient method to solve the built linear equation.I also need to be using these variables to solve it: x0=a matrix with height 9and with 1,and inside matrix its all 10.TOL=0.5.The question reads: what is your estimated solution (three digits after the comma)for the temperatures T1,T2,T3,T4,T5,T6,T7,T8and T9?How many iterations were necessary?
The linear equation i built.
IP= Inner Point
IP:1: 32+17+T2+T4-4T1=0=>4T1-T2-T4=49
IP 2:32+T1+T5+T3-4T2=0=>-T1+4T2-T3-T5=32
IP 3: 9+32+T2+T6-4T3=0=>-T2+4T3-T6=41
IP4: 17+T1+T5+T7-4T4=0=>-T1+4T4-T5-T7=17
IP5: T2+T4+T8+T6-4T5=0=>-T2-T4+4T5-T6-T8=0
IP6: 9+T3+T5+T9-4T6=0=>-T3-T5+4T6-T9=9
IP7:17+13+T T8+T4-4T7=0=>-T4+4T7-T8=30
IP 8: 13+T7+T5+T9-4T8=0=>-T5-T7+4T8-T9=13
IP9: 9+13+T8+T6-4T9=0=>-T6-T8+4T9=22
[A][T]=[c]
[A]=[4-10-100000-14-10-100000-14-10-1000-10-14-10-1000-10-14-10-1000-10-14-10-1000-10-14-100000-10-14-100000-10-14],[C]=[4932411709301322]
The python code i made and that i will use:
import numpy as np
def conjgrad(A,b,x0):
x =x0
r =b -np.dot(A,x)
p =r
rsold =np.dot(np.transpose(r),r)
while np.sqrt(rsold)>1e-8:
Ap =np.dot(A,p)
alpha =rsold /np.dot(np.transpose(p),Ap)
x =x +alpha *p
s =r -alpha *Ap
rsnew =np.dot(np.transpose(s),s)
beta =rsnew /rsold
p =s +beta *p
r =s
rsold =rsnew
return x
# Define the matrix A and vector b
A =
# Initial guess for x
x_0=
# Tolerance
TOL =0.5
# Solve using conjugate gradient method
x =conjgrad(A,b,x_0)
# Print the solution rounded to three digits after the comma
print("Estimated Temperatures:")
for i,temp in enumerate(x,start=1):
print(f"T{i}: {temp:.3f}")
I have trouble understanding how to figure out what b is and how to put everything in to the code and what the answer to the question is.
Thank you
 Using the system of linear equations I have built, figure out

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!