|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
/*
* This file:
* http://anggtwu.net/MAXIMA/2025-1-exact.mac.html
* http://anggtwu.net/MAXIMA/2025-1-exact.mac
* (find-angg "MAXIMA/2025-1-exact.mac")
* Author: Eduardo Ochs <eduardoochs@gmail.com>
*
* (defun e () (interactive) (find-angg "MAXIMA/2025-1-exact.mac"))
* (find-angg "MAXIMA/lazynouns.lisp")
* (find-angg "MAXIMA/2025-methods.mac")
* (find-angg "MAXIMA/2024-2-C2-E5.mac")
*
* See:
* (find-angg "MAXIMA/2025-1-s.mac" "E5-tests")
*
* «.Exact» (to "Exact")
* «.Exact-tests» (to "Exact-tests")
* «.caixinhas» (to "caixinhas")
* «.caixinhas-tests» (to "caixinhas-tests")
* «.boyce» (to "boyce")
*/
load("~/MAXIMA/2025-methods.mac");
load("~/MAXIMA/lazynouns.lisp");
texput(z_x, "z_x ");
texput(z_y, "z_y ");
/* «Exact» (to ".Exact")
* (c2m251edosexatasp 3 "metodo-e-exemplo")
* (c2m251edosexatasa "metodo-e-exemplo")
*/
E5_3(z,z_x,z_y) := matrix(
[d *. z, "=", z_x *. dx +. z_y *. dy , "=", 0],
[diff_(z,x,1), "=", z_x +. z_y *. diff_(y,x,1), "=", 0],
[z, "=", C , "", ""]);
E5_0() := E5_3(z, z_x, z_y);
E5_1(z) := E5_3(z, diff(z,x), diff(z,y));
E5_2(z_x,z_y) := E5_3(z, z_x, z_y);
defstruct(Exact(z_, z_x_, z_y_));
Exact_from3(z,z_x,z_y) := Exact(z, z_x, z_y);
Exact_from2 (z_x,z_y) := Exact(z, z_x, z_y);
Exact_from1(z) := Exact(z, diff(z,x), diff(z,y));
Exact_from0() := Exact(z, z_x, z_y);
Exact__E5 (e) := E5_3(e@z_, e@z_x_, e@z_y_);
Exact__ode (e) := (e@z_x_ + e@z_y_ * 'diff(y,x) = 0);
Exact__odesolve(e) := ode2(e@@ode(),y,x);
Exact__odesols (e) := solve(e@@odesolve(), y);
Exact__odesubst(e,eq) := subst(eq,e@@ode());
Exact__z_xy (e) := diff(e@z_x_,y);
Exact__z_yx (e) := diff(e@z_y_,x);
Exact__exact (e) := e@@z_xy() = e@@z_yx();
Exact__zfromzx (e) := integrate(e@z_x_,x) + expand("?"*(1+y+y^2+y^3));
Exact__zfromzy (e) := integrate(e@z_y_,y) + expand("?"*(1+x+x^2+x^3));
/* «Exact-tests» (to ".Exact-tests")
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac");
E5_0();
E5_1(x^2+y^2);
E5_2(2*x,2*y);
ee : Exact_from0();
ee : Exact_from1(x^2+y^2);
ee : Exact_from2(2*x, 2*y);
ee@@E5();
ee@@ode();
ee@@odesolve();
sols : ee@@odesols();
sol : sols[1];
test1 : ee@@odesubst(sol);
test2 : ev(test1, diff);
*/
/* «caixinhas» (to ".caixinhas")
*/
mkmatrix5(x,xs,y,ys,expr) ::=
buildq([x,xs,y,ys,expr],
apply('matrix,
makelist(makelist(ev(expr),x,xs),y,ys)));
[maxxp,maxyp] : [3,3];
polycoef(poly,xp,yp) := ratcoef(ratcoef(poly, 'x,xp), 'y,yp);
caixinhas0(expr) :=
mkmatrix5(xp,seq(0,maxxp), yp,seqby(maxyp,0,-1), expr);
caixinhas (poly) :=
mkmatrix5(xp,seq(0,maxxp), yp,seqby(maxyp,0,-1), polycoef(poly,xp,yp));
ca (poly) := caixinhas(poly);
caixinhas_3(z__, z__x, z__y) := [caixinhas(z__), caixinhas(z__x), caixinhas(z__y)];
caixinhas_2 (z__x, z__y) := [caixinhas(z__x), caixinhas(z__y)];
caixinhas_1(z__) := caixinhas_3(z__, diff(z__,x), diff(z__,y));
Exact__caixinhas_z (e) := caixinhas (e@z_);
Exact__caixinhas_z_x(e) := caixinhas (e@z_x_);
Exact__caixinhas_z_y(e) := caixinhas (e@z_y_);
Exact__caixinhas_2 (e) := caixinhas_2( e@z_x_, e@z_y_);
Exact__caixinhas_3 (e) := caixinhas_3(e@z_, e@z_x_, e@z_y_);
Exact__effs (e) := [e@@exact(),
caixinhas(ee@@zfromzx()),
caixinhas(ee@@zfromzy())];
Exact__effsc (e) := [map('caixinhas, e@@exact()),
caixinhas(ee@@zfromzx()),
caixinhas(ee@@zfromzy())];
/* «caixinhas-tests» (to ".caixinhas-tests")
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac");
polycoef (x^2*y^3*4, 2,3);
caixinhas0([xp,yp]);
caixinhas (x^2*y^3*4);
caixinhas_1(x^2*y^3*4);
[maxxp,maxyp] : [2,3];
caixinhas_1(x^2*y^3*4);
ee : Exact_from1(x^2+y^2);
ee@@caixinhas_2();
ee@@caixinhas_3();
[maxxp,maxyp] : [3,3];
ee : Exact_from1(x^2*y^3);
ee@@caixinhas_2();
ee@@caixinhas_3();
ee@@effs();
ee@@effsc();
*/
/*
** (c2m251edosexatasp 5 "maxima-exact")
** (c2m251edosexatasa "maxima-exact")
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac")$
ee : Exact_from0()$
ee@@E5();
ee : Exact_from1(x^2+y^2)$
ee@@E5();
ee : Exact_from2(2*x, 2*y)$
ee@@E5();
ee@@ode();
ee@@odesolve();
sols : ee@@odesols();
sol : sols[1];
test1 : ee@@odesubst(sol);
test2 : ev(test1, diff);
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac");
ee : Exact_from1(x^2*y^3);
ee@@caixinhas_3();
ee@@caixinhas_2();
ee : Exact_from1(x^2+y^2);
ee@@caixinhas_3();
ee@@caixinhas_2();
p : A*x^0*y^2 + B*x^1*y^2 + C*x^2*y^2
+ D*x^0*y^1 + E*x^1*y^1 + F*x^2*y^1
+ G*x^0*y^0 + H*x^1*y^0 + I*x^2*y^0;
caixinhas(p);
ee : Exact_from1(p);
ee@@caixinhas_3();
** (find-books "__analysis/__analysis.el" "boyce-diprima-pt" "72" "2.6. Equações Exatas")
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac");
[maxxp,maxyp] : [3,3];
[maxxp,maxyp] : [2,2];
ee : Exact_from1(x*y^2 + x^2*y^2);
ee : Exact_from1(x*y^2 + x^2*y^2 + x^2);
ee : Exact_from1(x^2 + x*y^2); "Boyce, exemplo 1"$
ee@@caixinhas_2();
ee@@caixinhas_3();
o : 10*x^4*y^5;
diff(o, x);
diff(o, y);
ee : Exact_from2(2*x+3, 2*y-2);
ee : Exact_from3(2*x*y, 2*x+3, 2*y-2);
ee@@caixinhas_3();
*/
/* «boyce» (to ".boyce")
** (c2m251edosexatasp 7 "maxima-caixinhas-2")
** (c2m251edosexatasa "maxima-caixinhas-2")
** (find-books "__analysis/__analysis.el" "boyce-diprima-pt" "72" "2.6. Equações Exatas")
** (find-books "__analysis/__analysis.el" "boyce-diprima-pt" "76" "Problemas")
* (eepitch-maxima)
* (eepitch-kill)
* (eepitch-maxima)
load("2025-1-exact.mac");
linel : 110;
[maxxp,maxyp] : [2,2];
"1"$ ee : Exact_from3("?", 2*x+3, 2*y-2);
ee@@caixinhas_2();
ee@@effsc();
"2"$ ee : Exact_from3("?", 2*x+4*y, 2*x-2*y);
ee@@caixinhas_2();
ee@@effsc();
[maxxp,maxyp] : [3,3];
"3"$ ee : Exact_from3("?", 3*x^2 - 2*x*y + 2, 6*y^2 - x^2 + 3);
ee@@caixinhas_2();
ee@@effsc();
*/