# -*- coding: utf-8 -*- """ Created on Wed Apr 28 12:53:20 2021 @author: neil """ # xi's are the nodal locations # this code fills in the A matrix, and the C forcing vector, leaves top and bottom # rows empty for k in range(1,len(xi)-1): le0 = xi[k] - xi[k-1] # element lengths le1 = xi[k+1] - xi[k] A[k,k-1] = le0/6 A[k,k] = le0/3 + le1/3 A[k,k+1] = le1/6 C[k] = (np.sin(xi[k])-np.sin(xi[k-1]))/le0 - (np.sin(xi[k+1])-np.sin(xi[k]))/le1