Numerical PDE HW 4

Finally some Finite Element (FE) stuff

For the Dirichlet problem (D) on p14 with with f[x]=Sin[x] set up the piecewise linear FE problem ffor the mesh 0.0, 0.1, 0.5, 0.7, 1.0.   I want to see an explicit 3 by 3 stiffness matrix A and an explicit 3 vector b.  Solve for the nodal u values and plot them with dots on and straight lines joining the data points including the zero boundary values.

Write code for (D) that generates A and b from a list of nodal values (including end points) and a function f.

Use this code to produce and plot a decent looking solution to (D) with  f=Sin[(x^3)] on 0.0<x<2.0

Repeat problem(3) with f=(Piecewise[{{0, 0.0<x<0.1}, {100, 0.1<x<0.4}, {2, 0.4<x<2.0}}])