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: xa matrix with height and with and inside matrix its all TOLThe question reads: what is your estimated solution three digits after the commafor the temperatures TTTTTTTTand THow many iterations were necessary?
The linear equation i built.
IP Inner Point
IP::
IP :
IP :
IP:
IP:
IP:
IP:T
IP :
IP:
The python code i made and that i will use:
import numpy as np
def conjgradAbx:
x x
r b npdotAx
p r
rsold npdotnptransposerr
while npsqrtrsolde:
Ap npdotAp
alpha rsold npdotnptransposepAp
x x alpha p
s r alpha Ap
rsnew npdotnptransposess
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
# Tolerance
TOL
# Solve using conjugate gradient method
x conjgradAbx
# Print the solution rounded to three digits after the comma
printEstimated Temperatures:"
for itemp in enumeratexstart:
printfTi: temp:f
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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
