I am trying to solve an electrodynamics problem numerically by using B-splines a basis function. Please don't ask me why, but if you really wanna know, here is the assignment.
Using the following code, I have successfully plotted the B-spline basis functions in two dimensions, given the specific knot sequence and the respective x and y intervals.
knots = {0, 0, 0, 0, 0.2, 1, 1, 1, 1}
Plot3D[Evaluate[Table[BSplineBasis[{4, knots}, i, x], {i, 0, 3}]] Evaluate[
Table[BSplineBasis[{4, knots}, i, y], {i, 0, 3}]], {x, 0, 1}, {y, 0, 1}]
The corresponding plot looks like this:
Now I am trying to do the same for the second derivatives of the B-splines, using the following code:
knots = {0, 0, 0, 0, 0.2, 1, 1, 1, 1}
Plot3D[Evaluate[Table[D[BSplineBasis[{4, knots}, i, x], {x, 2}], {i, 0, 3}]]
Evaluate[Table[D[BSplineBasis[{4, knots}, i, y], {y, 2}], {i, 0, 3}]],
{x, 0, 1}, {y, 0, 1}]
However, it does not work and produces an empty graph and lots of red error messages. I have tried several combinations of the D, Table and Evaluate operators, but nothing seems to work. What am I doing wrong?
Table
? $\endgroup$Plot3D[Evaluate[Table[D[BSplineBasis[{4, knots}, i, \[FormalX]], {\[FormalX], 2}] D[BSplineBasis[{4, knots}, i, \[FormalY]], {\[FormalY], 2}] /. {\[FormalX] -> x, \[FormalY] -> y}, {i, 0, 3}]], {x, 0, 1}, {y, 0, 1}]
$\endgroup$