Question: 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
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
