Skip to main content
added 835 characters in body
Source Link
bobbym
  • 2.6k
  • 2
  • 16
  • 20

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]//Expand

(4 - w^2 - 3 w z + w^2 z - z^2 + w z^2)

Maybe you did not have enough points before to uniquely determine all the coefficients.

The above answer is not the best way to handle this. When you know you are right and Mma is not then you should roll your own:

fun[l_] := Module[{w, z},
  w = First[l[[1]]];
  z = Last[l[[1]]];
  h + g*w^2 + f*w^3 + e*w* z + d*w^2* z + c*z^2 + b*w* z^2 + a*z^3 == 
   l[[2]]]

pts = {{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 212}, {{6, 4}, 
    120}, {{6, 6}, 256}, {{8, 4}, 212}, {{8, 6}, 432}, {{8, 8}, 708}};

rul = Solve[fun[#] & /@ pts, {a, b, c, d, e, f, g, h}]

(* {{a -> 0, b -> 1, c -> -1, d -> 1, e -> -3, f -> 0, g -> -1, h -> 4}} *)

(h + g*w^2 + f*w^3 + e*w* z + d*w^2* z + c*z^2 + b*w* z^2 + 
   a*z^3) /. rul

{4 - w^2 - 3 w z + w^2 z - z^2 + w z^2}

Which is what you want. This does not require any changes to the data so disregard my earlier solution.

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]//Expand

(4 - w^2 - 3 w z + w^2 z - z^2 + w z^2)

Maybe you did not have enough points before to uniquely determine all the coefficients.

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]//Expand

(4 - w^2 - 3 w z + w^2 z - z^2 + w z^2)

Maybe you did not have enough points before to uniquely determine all the coefficients.

The above answer is not the best way to handle this. When you know you are right and Mma is not then you should roll your own:

fun[l_] := Module[{w, z},
  w = First[l[[1]]];
  z = Last[l[[1]]];
  h + g*w^2 + f*w^3 + e*w* z + d*w^2* z + c*z^2 + b*w* z^2 + a*z^3 == 
   l[[2]]]

pts = {{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 212}, {{6, 4}, 
    120}, {{6, 6}, 256}, {{8, 4}, 212}, {{8, 6}, 432}, {{8, 8}, 708}};

rul = Solve[fun[#] & /@ pts, {a, b, c, d, e, f, g, h}]

(* {{a -> 0, b -> 1, c -> -1, d -> 1, e -> -3, f -> 0, g -> -1, h -> 4}} *)

(h + g*w^2 + f*w^3 + e*w* z + d*w^2* z + c*z^2 + b*w* z^2 + 
   a*z^3) /. rul

{4 - w^2 - 3 w z + w^2 z - z^2 + w z^2}

Which is what you want. This does not require any changes to the data so disregard my earlier solution.

added 53 characters in body
Source Link
bobbym
  • 2.6k
  • 2
  • 16
  • 20

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]//Expand

(4 - w^2 - 3 w z + w^2 z - z^2 + w z^2)

Maybe you did not have enough points before to uniquely determine all the coefficients.

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]

Maybe you did not have enough points before to uniquely determine all the coefficients.

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]//Expand

(4 - w^2 - 3 w z + w^2 z - z^2 + w z^2)

Maybe you did not have enough points before to uniquely determine all the coefficients.

Source Link
bobbym
  • 2.6k
  • 2
  • 16
  • 20

To start you off this works:

InterpolatingPolynomial[{{{4, 4}, 52}, {{4, 6}, 120}, {{4, 8}, 
   212}, {{6, 4}, 120}, {{6, 6}, 256}, {{6, 8}, 432}, {{8, 4}, 
   212}, {{8, 6}, 432}, {{8, 8}, 708}, {{10, 6}, 648}, {{10, 8}, 
   1040}}, {w, z}]

Maybe you did not have enough points before to uniquely determine all the coefficients.