How to solve this 4x4 equation system for a cubic spline?

151 Views Asked by At

I am attempting to create a simple cubic spline between these lines: Cubic

I have worked out the four equations as:

  • (1) $1 = An^3 + Bn^2 + Cn + D$
  • (2) $g^{m-t} = At^3 + Bt^2 + Ct + D$
  • (3) $0 = 3An^2 + 2Bn + C$
  • (4) $ln(g) * (-g)^{m-t} = 3At^2 + 2Bt + C$

I need to solve for $A$, $B$, $C$, and $D$ in order to graph my spline.

But I am mostly stuck. I tried subtracting $3$ and $4$ to eliminate $C$, and tried rearranging and dividing $2$ by $1$ to eliminate $C$, but I can't figure out how to work through all of it.

I tried a variety of online 4x4 solvers but they won't take these equations since they have other variables in them ($n$, $m$, $t$, $g$).

How could one solve this? Are there any automatic programs that could handle this type of thing to make it easier?

1

There are 1 best solutions below

0
On

Well I found wxMaxima which can solve these things, but what a mess the answer is:

WxMaxima solution

Either way, this looks like a quick easy free way to solve this type of problem.