Answered step by step
Verified Expert Solution
Question
1 Approved Answer
clear % clear all variables n = 20; % grid dimension N = n^2; % number of nodes ne = 2*n*(n-1); % number of edges
clear % clear all variables
n = 20; % grid dimension
N = n^2; % number of nodes
ne = 2*n*(n-1); % number of edges
% nodes that will have temperature fixed at 0
fixed_0 = [1:n:N, n:n:N];
% nodes that will have temperature fixed at 1
first = round(n/4)*n + round(n/4);
last = round((N+n)/2);
fixed_1 = first:(n+1):last;
% all nodes with fixed temperature
fixed = [fixed_0, fixed_1];
%%%% YOUR CODE STARTS HERE %%%%%%%%%%%%%%%%%
% build incidence matrix for grid
A = gen_incidence(n);
% build R^(-1), all thermal resistivities are 1
Rinv = speye(ne, ne);
% build stiffness matrix K
% build sparse NxN identity matrix
% build E
% build F
% build the vector d
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started