Mathemticaで非線形連立方程式を解こうとしています。SolveとNSolveを試しました。また、方程式を簡略化するためにa_{ij}とb_{ij}とm33= 1の数値を定義しようとしましたが、Mathematicaが長すぎるか、何か間違ったことをしているようです。Mathematicaでは解決策を見つけようとしています。 、しかし、コードでこれを行うには、c / c++libも必要です。
「演算子」の主な方程式:
M[A[(x,y)]]=B[M[(x,y)]]
ここで、「演算子」は遠近法変換です。
u= (m13 + m11*x + m12*y)/(m33 + m31*x + m32*y);
v= (m23 + m21*x +m22*y)/(m33 + m31*x + m32*y);
Mathematicaでの私の入力:
Solve[(b13 + (b11 (m13 + m11 x1 + m12 y1))/(m33 + m31 x1 +
m32 y1) + (b12 (m23 + m21 x1 + m22 y1))/(m33 + m31 x1 +
m32 y1))/(b33 + (b31 (m13 + m11 x1 + m12 y1))/(m33 + m31 x1 +
m32 y1) + (b32 (m23 + m21 x1 + m22 y1))/(m33 + m31 x1 +
m32 y1)) == (m13 + (m11 (a13 + a11 x1 + a12 y1))/(a33 +
a31 x1 + a32 y1) + (m12 (a23 + a21 x1 + a22 y1))/(a33 +
a31 x1 + a32 y1))/(m33 + (m31 (a13 + a11 x1 + a12 y1))/(a33 +
a31 x1 + a32 y1) + (m32 (a23 + a21 x1 + a22 y1))/(a33 +
a31 x1 +
a32 y1)) && (b23 + (b21 (m13 + m11 x1 + m12 y1))/(m33 +
m31 x1 + m32 y1) + (b22 (m23 + m21 x1 + m22 y1))/(m33 +
m31 x1 + m32 y1))/(b33 + (b31 (m13 + m11 x1 + m12 y1))/(m33 +
m31 x1 + m32 y1) + (b32 (m23 + m21 x1 + m22 y1))/(m33 +
m31 x1 +
m32 y1)) == (m23 + (m21 (a13 + a11 x1 + a12 y1))/(a33 +
a31 x1 + a32 y1) + (m22 (a23 + a21 x1 + a22 y1))/(a33 +
a31 x1 + a32 y1))/(m33 + (m31 (a13 + a11 x1 + a12 y1))/(a33 +
a31 x1 + a32 y1) + (m32 (a23 + a21 x1 + a22 y1))/(a33 +
a31 x1 +
a32 y1)) && (b13 + (b11 (m13 + m11 x2 + m12 y2))/(m33 +
m31 x2 + m32 y2) + (b12 (m23 + m21 x2 + m22 y2))/(m33 +
m31 x2 + m32 y2))/(b33 + (b31 (m13 + m11 x2 + m12 y2))/(m33 +
m31 x2 + m32 y2) + (b32 (m23 + m21 x2 + m22 y2))/(m33 +
m31 x2 +
m32 y2)) == (m13 + (m11 (a13 + a11 x2 + a12 y2))/(a33 +
a31 x2 + a32 y2) + (m12 (a23 + a21 x2 + a22 y2))/(a33 +
a31 x2 + a32 y2))/(m33 + (m31 (a13 + a11 x2 + a12 y2))/(a33 +
a31 x2 + a32 y2) + (m32 (a23 + a21 x2 + a22 y2))/(a33 +
a31 x2 +
a32 y2)) && (b23 + (b21 (m13 + m11 x2 + m12 y2))/(m33 +
m31 x2 + m32 y2) + (b22 (m23 + m21 x2 + m22 y2))/(m33 +
m31 x2 + m32 y2))/(b33 + (b31 (m13 + m11 x2 + m12 y2))/(m33 +
m31 x2 + m32 y2) + (b32 (m23 + m21 x2 + m22 y2))/(m33 +
m31 x2 +
m32 y2)) == (m23 + (m21 (a13 + a11 x2 + a12 y2))/(a33 +
a31 x2 + a32 y2) + (m22 (a23 + a21 x2 + a22 y2))/(a33 +
a31 x2 + a32 y2))/(m33 + (m31 (a13 + a11 x2 + a12 y2))/(a33 +
a31 x2 + a32 y2) + (m32 (a23 + a21 x2 + a22 y2))/(a33 +
a31 x2 +
a32 y2)) && (b13 + (b11 (m13 + m11 x3 + m12 y3))/(m33 +
m31 x3 + m32 y3) + (b12 (m23 + m21 x3 + m22 y3))/(m33 +
m31 x3 + m32 y3))/(b33 + (b31 (m13 + m11 x3 + m12 y3))/(m33 +
m31 x3 + m32 y3) + (b32 (m23 + m21 x3 + m22 y3))/(m33 +
m31 x3 +
m32 y3)) == (m13 + (m11 (a13 + a11 x3 + a12 y3))/(a33 +
a31 x3 + a32 y3) + (m12 (a23 + a21 x3 + a22 y3))/(a33 +
a31 x3 + a32 y3))/(m33 + (m31 (a13 + a11 x3 + a12 y3))/(a33 +
a31 x3 + a32 y3) + (m32 (a23 + a21 x3 + a22 y3))/(a33 +
a31 x3 +
a32 y3)) && (b23 + (b21 (m13 + m11 x3 + m12 y3))/(m33 +
m31 x3 + m32 y3) + (b22 (m23 + m21 x3 + m22 y3))/(m33 +
m31 x3 + m32 y3))/(b33 + (b31 (m13 + m11 x3 + m12 y3))/(m33 +
m31 x3 + m32 y3) + (b32 (m23 + m21 x3 + m22 y3))/(m33 +
m31 x3 +
m32 y3)) == (m23 + (m21 (a13 + a11 x3 + a12 y3))/(a33 +
a31 x3 + a32 y3) + (m22 (a23 + a21 x3 + a22 y3))/(a33 +
a31 x3 + a32 y3))/(m33 + (m31 (a13 + a11 x3 + a12 y3))/(a33 +
a31 x3 + a32 y3) + (m32 (a23 + a21 x3 + a22 y3))/(a33 +
a31 x3 +
a32 y3)) && (b13 + (b11 (m13 + m11 x4 + m12 y4))/(m33 +
m31 x4 + m32 y4) + (b12 (m23 + m21 x4 + m22 y4))/(m33 +
m31 x4 + m32 y4))/(b33 + (b31 (m13 + m11 x4 + m12 y4))/(m33 +
m31 x4 + m32 y4) + (b32 (m23 + m21 x4 + m22 y4))/(m33 +
m31 x4 +
m32 y4)) == (m13 + (m11 (a13 + a11 x4 + a12 y4))/(a33 +
a31 x4 + a32 y4) + (m12 (a23 + a21 x4 + a22 y4))/(a33 +
a31 x4 + a32 y4))/(m33 + (m31 (a13 + a11 x4 + a12 y4))/(a33 +
a31 x4 + a32 y4) + (m32 (a23 + a21 x4 + a22 y4))/(a33 +
a31 x4 +
a32 y4)) && (b23 + (b21 (m13 + m11 x4 + m12 y4))/(m33 +
m31 x4 + m32 y4) + (b22 (m23 + m21 x4 + m22 y4))/(m33 +
m31 x4 + m32 y4))/(b33 + (b31 (m13 + m11 x4 + m12 y4))/(m33 +
m31 x4 + m32 y4) + (b32 (m23 + m21 x4 + m22 y4))/(m33 +
m31 x4 +
m32 y4)) == (m23 + (m21 (a13 + a11 x4 + a12 y4))/(a33 +
a31 x4 + a32 y4) + (m22 (a23 + a21 x4 + a22 y4))/(a33 +
a31 x4 + a32 y4))/(m33 + (m31 (a13 + a11 x4 + a12 y4))/(a33 +
a31 x4 + a32 y4) + (m32 (a23 + a21 x4 + a22 y4))/(a33 +
a31 x4 + a32 y4)) && m33 == 1, {m11, m12, m13, m21, m22, m23,
m31, m32}]