我正在尝试x_Trag, y_Trag, x_Zug, y_Zug
用四个方程式解决四个未知变量eqx, eqy, Py_Trag, Py_Zug
。可悲的是,只有简单的测试用例在起作用。
这是 Wxmaxima 粘贴:
(%i1) kill(all); load(ezunits);
Warning: Can set maxima's working directory but cannot change it during the maxima session :
(%o0) done
(%o1) "C:/maxima-5.44.0/share/maxima/5.44.0/share/ezunits/ezunits.mac"
1 easy values work
1.1 vars
(%i2) x_GG: 1`mm;
(x_GG) 1 ` mm
(%i3) y_GG: 18`mm;
(y_GG) 18 ` mm
(%i4) L_HR: 5`mm;
(L_HR) 5 ` mm
(%i5) L_Trag: 5`mm;
(L_Trag) 5 ` mm
(%i6) L_Zug: 15`mm;
(L_Zug) 15 ` mm
(%i7) x_HR: 4`mm;
(x_HR) 4 ` mm
(%i8) y_HR: 3`mm;
(y_HR) 3 ` mm
1.2 equations
(%i9) eqx: x_Zug=x_GG+x_HR+x_Trag;
(eqx) x_Zug=x_Trag+5 ` mm
(%i10) eqy: y_GG=y_HR+y_Zug+y_Trag;
(eqy) 18 ` mm=y_Zug+y_Trag+3 ` mm
(%i11) Py_Trag: L_Trag^2=x_Trag^2+y_Trag^2;
(Py_Trag) 25 ` mm^2=y_Trag^2+x_Trag^2
(%i12) Py_Zug: L_Zug^2=x_Zug^2+y_Zug^2;
(Py_Zug) 225 ` mm^2=y_Zug^2+x_Zug^2
1.3 solving works
(%i13) res: dimensionally(solve([eqx, eqy, Py_Trag, Py_Zug], [x_Trag, y_Trag, x_Zug, y_Zug]))[1];
(res) [x_Trag=4 ` mm,y_Trag=3 ` mm,x_Zug=9 ` mm,y_Zug=12 ` mm]
2 but not the ones I need
2.1 vars
(%i14) x_GG: 2`mm;
(x_GG) 2 ` mm
(%i15) y_GG: 193`mm;
(y_GG) 193 ` mm
(%i16) L_HR: 46`mm;
(L_HR) 46 ` mm
(%i17) L_Trag: 50`mm;
(L_Trag) 50 ` mm
(%i18) L_Zug: 190`mm;
(L_Zug) 190 ` mm
(%i19) x_HR: 46*cos((149*%pi-360*acos(1/3))/360) ` mm;
(x_HR) 46*cos((149*%pi-360*acos(1/3))/360) ` mm
(%i20) y_HR: 46*sin((149*%pi-360*acos(1/3))/360) ` mm;
(y_HR) 46*sin((149*%pi-360*acos(1/3))/360) ` mm
2.2 equations
(%i21) eqx: x_Zug=x_GG+x_HR+x_Trag;
(eqx) x_Zug=x_Trag+(46*cos((149*%pi-360*acos(1/3))/360)+2) ` mm
(%i22) eqy: y_GG=y_HR+y_Zug+y_Trag;
(eqy) 193 ` mm=y_Zug+y_Trag+46*sin((149*%pi-360*acos(1/3))/360) ` mm
(%i23) Py_Trag: L_Trag^2=x_Trag^2+y_Trag^2;
(Py_Trag) 2500 ` mm^2=y_Trag^2+x_Trag^2
(%i24) Py_Zug: L_Zug^2=x_Zug^2+y_Zug^2;
(Py_Zug) 36100 ` mm^2=y_Zug^2+x_Zug^2
2.3 solving takes very long, but dosen't find a solution
(%i26) res: dimensionally(solve([eqx, eqy, Py_Trag, Py_Zug], [x_Trag, y_Trag, x_Zug, y_Zug])); float(%);
(res) []
(%o26) []
wxm-file,应该更适合粘贴:
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 21.02.0 ] */
/* [wxMaxima: input start ] */
kill(all); load(ezunits);
/* [wxMaxima: input end ] */
/* [wxMaxima: section start ]
easy values work
[wxMaxima: section end ] */
/* [wxMaxima: subsect start ]
vars
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
x_GG: 1`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
y_GG: 18`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_HR: 5`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_Trag: 5`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_Zug: 15`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
x_HR: 4`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
y_HR: 3`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: subsect start ]
equations
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
eqx: x_Zug=x_GG+x_HR+x_Trag;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
eqy: y_GG=y_HR+y_Zug+y_Trag;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Py_Trag: L_Trag^2=x_Trag^2+y_Trag^2;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Py_Zug: L_Zug^2=x_Zug^2+y_Zug^2;
/* [wxMaxima: input end ] */
/* [wxMaxima: subsect start ]
solving works
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
res: dimensionally(solve([eqx, eqy, Py_Trag, Py_Zug], [x_Trag, y_Trag, x_Zug, y_Zug]))[1];
/* [wxMaxima: input end ] */
/* [wxMaxima: section start ]
but not the ones I need
[wxMaxima: section end ] */
/* [wxMaxima: subsect start ]
vars
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
x_GG: 2`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
y_GG: 193`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_HR: 46`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_Trag: 50`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
L_Zug: 190`mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
x_HR: 46*cos((149*%pi-360*acos(1/3))/360) ` mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
y_HR: 46*sin((149*%pi-360*acos(1/3))/360) ` mm;
/* [wxMaxima: input end ] */
/* [wxMaxima: subsect start ]
equations
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
eqx: x_Zug=x_GG+x_HR+x_Trag;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
eqy: y_GG=y_HR+y_Zug+y_Trag;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Py_Trag: L_Trag^2=x_Trag^2+y_Trag^2;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Py_Zug: L_Zug^2=x_Zug^2+y_Zug^2;
/* [wxMaxima: input end ] */
/* [wxMaxima: subsect start ]
solving takes very long, but dosen't find a solution
[wxMaxima: subsect end ] */
/* [wxMaxima: input start ] */
res: dimensionally(solve([eqx, eqy, Py_Trag, Py_Zug], [x_Trag, y_Trag, x_Zug, y_Zug])); float(%);
/* [wxMaxima: input end ] */
/* Old versions of Maxima abort on loading files that end in a comment. */
"Created with wxMaxima 21.02.0"$