Example LaTeX writeup: https://www.overleaf.com/read/mkwgqjwnzvwc
Rates of Convergence: https://www.overleaf.com/read/nzymrjqfpzjf
Team,
Welcome to MA386 – Numerical Analysis! I hope everyone had a great summer and is looking forward to getting back to work this next semester.
I want everyone to understand from the beginning that there is a significant amount of programming in python and personal development in LaTeX (type setting) in this class. I do not consider myself an expert in LaTeX, so we will be venturing there together (some of you may already know more than I do – so speak up when needed).
Please take a few minutes to read the email, visit the course website, and complete the following tasks. You will need to do the following before the first day of class:
1. Visit and bookmark the website: https://sites.google.com/view/usma-ma386/home
2. Download the course admin documents – I will publish the calendar, course guide and CD memo here next week: https://sites.google.com/view/usma-ma386/admin
3. If you do not have Anaconda Python installed, visit here https://www.anaconda.com/products/individual#download-section, download and install Python 3.9.
4. The book needed for this course is Burden, Faires, and Burden. Richard Burden, Douglas Faires, and Annette Burden, Numerical Analysis (10th edition)
5. If you do not remember anything about coding in python, bookmark this page and start going through the tutorial – we will cover some of what you need during class and tech labs: https://www.learnpython.org/
6. Get an overleaf account – it is free and our way of executing LaTeX in this course: https://www.overleaf.com
7. Sign up for a cocalc account (www.cocalc.com) if you do not have one already and email me your email address that you used - I will need to bring you into the course before paying the $14 fee.
Use this link to view the student guide to cocalc: https://doc.cocalc.com/teaching-students.html
## Natural Cubic Splines
def natural_cubic_spline(x,a):
#Initialization
x = np.array(x);a = np.array(a)
n = len(x)-1
h = np.zeros(n)
#Step1
for i in range(n):
h[i] = x[i+1]-x[i]
#Step 2
alpha = np.zeros(n+1)
for i in range(1,n):
alpha[i]=3/h[i]*(a[i+1]-a[i])-3/h[i-1]*(a[i]-a[i-1])
#Step 3
l = np.zeros(n+1)
mu = np.zeros(n+1)
z = np.zeros(n+1)
b = np.zeros(n+1)
c = np.zeros(n+1)
d = np.zeros(n+1)
l[0]=1
#Step 4
for i in range(1,n):
l[i]=2*(x[i+1]-x[i-1])-h[i-1]*mu[i-1]
mu[i]=h[i]/l[i]
z[i]=(alpha[i]-h[i-1]*z[i-1])/l[i]
#Step 5
l[n] = 1
#Step 6
for j in range(n-1,-1,-1):
c[j]=z[j]-mu[j]*c[j+1]
b[j]=(a[j+1]-a[j])/h[j]-h[j]*(c[j+1]+2*c[j])/3
d[j]=(c[j+1]-c[j])/(3*h[j])
#Step 7
return (a[:-1],b[:-1],c[:-1],d[:-1])