From: rtoy <rt...@us...> - 2025-08-21 22:21:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 02a518774841c893de33e913b5e685aa965f5b0a (commit) via 46a4194b9052bbe38ba4a9176e161f49b3c48777 (commit) via 72f5b47f38465515b857a794fcce4e32baaf3ed0 (commit) via 01d3f5f9e304284413dabbf0e9f234f99b55a56b (commit) via edc2c53b12857d4479b3d07c93a36f9cfd3ef567 (commit) via 5a59cbd22aef09742256ca0d1cbf8f2dfdf7a02f (commit) via 52630395e36edbba760afff6396da671b73132e4 (commit) via d614552b9aa0250f4a624ddc8c33673f6c12cdcd (commit) via 3865b325cee6ee87d94b98d5faf947049982b15e (commit) via f4e46eba7ff2e89e532f7ca0cc47b25eaa594f1d (commit) via 4c8187e5e6f6a5743f4f484717289852b3f9af09 (commit) via 24b2d30fe6e752a863c78cf0d669faefe40e9b74 (commit) via fdf8b514fd1f5858dc00ba1550b1a4b3856ac037 (commit) via 286103f0df8f9b5ca0d0a1f22eaf7254b6305e2d (commit) via 758016a28cb3eb32cb29c5f12d7876bd1db479dd (commit) via d75fb58de80407a2ecf4987566f531756470b310 (commit) via 240b4bbf8dfa754d71b1b9ab5aeed521bd25a712 (commit) via 2f858e1f7c5a612122f03b139d43bee5a9b673d0 (commit) via 923ea9a89d2aacb65ffc58d6bd41f2a4c9634571 (commit) via 5bd32861611a2ac451fbee6429fb539c5f97effd (commit) via e766f09c5c0ebb6ad6d0e38ecb6d2fafd2ade3fe (commit) via 59d993be7be896cbd1d3dc355aef8a91c537bcda (commit) via 8bf67729874e5e8fa85d8748a00304d106fbc414 (commit) via 523b4ca0352b80f5b1e0deabfb59f78d6e51fe60 (commit) via f05d717bff8c0254a3d66d18d85e236111534fb7 (commit) via 9519ab0ecef3aa400f3835e1423dd2d31ce07b42 (commit) via e7ab454db65fcdf43442ac429541a6bc41d49fd6 (commit) via fb9b3de5da7ef36d0db621c2ca524585e0ab054b (commit) via 4006dcfd532428fa8a9e0eff00f842216ba8e057 (commit) from 350f069f401a51846a352127a6fa316e544f2b94 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 02a518774841c893de33e913b5e685aa965f5b0a Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 13:50:52 2025 -0700 Run update_examples This caused the results from `fft` to have the real parts have the opposite sign. But this also makes the results match what `fft` currently returns and matches what `fftpack5_fft` returns, which is nice. diff --git a/doc/info/Numerical.texi b/doc/info/Numerical.texi index 747ff6812..5def4194b 100644 --- a/doc/info/Numerical.texi +++ b/doc/info/Numerical.texi @@ -140,19 +140,24 @@ Real data. @c L2 : fft (L1); @c lmax (abs (L2 - L)); @c ===end=== -@example +@example maxima (%i1) load ("fft") $ (%i2) fpprintprec : 4 $ (%i3) L : [1, 2, 3, 4, -1, -2, -3, -4] $ +@group (%i4) L1 : inverse_fft (L); -(%o4) [0.0, 14.49 %i - .8284, 0.0, 2.485 %i + 4.828, 0.0, - 4.828 - 2.485 %i, 0.0, - 14.49 %i - .8284] +(%o4) [0.0, - 14.49 %i - 0.8284, 0.0, 4.828 - 2.485 %i, 0.0, + 2.485 %i + 4.828, 0.0, 14.49 %i - 0.8284] +@end group +@group (%i5) L2 : fft (L1); -(%o5) [1.0, 2.0 - 2.168L-19 %i, 3.0 - 7.525L-20 %i, -4.0 - 4.256L-19 %i, - 1.0, 2.168L-19 %i - 2.0, -7.525L-20 %i - 3.0, 4.256L-19 %i - 4.0] +(%o5) [1.0, 2.0 - 4.441e-16 %i, 3.0, 4.441e-16 %i + 4.0, - 1.0, + 4.441e-16 %i - 2.0, - 3.0, - 4.441e-16 %i - 4.0] +@end group +@group (%i6) lmax (abs (L2 - L)); -(%o6) 3.545L-16 +(%o6) 4.441e-16 +@end group @end example Complex data. @@ -165,20 +170,24 @@ Complex data. @c L2 : fft (L1); @c lmax (abs (L2 - L)); @c ===end=== -@example +@example maxima (%i1) load ("fft") $ -(%i2) fpprintprec : 4 $ +(%i2) fpprintprec : 4 $ (%i3) L : [1, 1 + %i, 1 - %i, -1, -1, 1 - %i, 1 + %i, 1] $ +@group (%i4) L1 : inverse_fft (L); -(%o4) [4.0, 2.711L-19 %i + 4.0, 2.0 %i - 2.0, -- 2.828 %i - 2.828, 0.0, 5.421L-20 %i + 4.0, - 2.0 %i - 2.0, -2.828 %i + 2.828] +(%o4) [4.0, 2.828 %i + 2.828, - 2.0 %i - 2.0, 4.0, 0.0, + - 2.828 %i - 2.828, 2.0 %i - 2.0, 4.0] +@end group +@group (%i5) L2 : fft (L1); -(%o5) [4.066E-20 %i + 1.0, 1.0 %i + 1.0, 1.0 - 1.0 %i, -1.55L-19 %i - 1.0, - 4.066E-20 %i - 1.0, 1.0 - 1.0 %i, -1.0 %i + 1.0, 1.0 - 7.368L-20 %i] -(%i6) lmax (abs (L2 - L)); -(%o6) 6.841L-17 +(%o5) [1.0, 1.0 %i + 1.0, 1.0 - 1.0 %i, - 1.0, - 1.0, + 1.0 - 1.0 %i, 1.0 %i + 1.0, 1.0] +@end group +@group +(%i6) lmax (abs (L2 - L)); +(%o6) 0.0 +@end group @end example @opencatbox{Categories:} @@ -268,19 +277,24 @@ Real data. @c L2 : inverse_fft (L1); @c lmax (abs (L2 - L)); @c ===end=== -@example +@example maxima (%i1) load ("fft") $ (%i2) fpprintprec : 4 $ (%i3) L : [1, 2, 3, 4, -1, -2, -3, -4] $ +@group (%i4) L1 : fft (L); -(%o4) [0.0, 1.811 %i - .1036, 0.0, 0.3107 %i + .6036, 0.0, - 0.6036 - 0.3107 %i, 0.0, (- 1.811 %i) - 0.1036] +(%o4) [0.0, 1.811 %i - 0.1036, 0.0, 0.3107 %i + 0.6036, 0.0, + 0.6036 - 0.3107 %i, 0.0, - 1.811 %i - 0.1036] +@end group +@group (%i5) L2 : inverse_fft (L1); -(%o5) [1.0, 2.168L-19 %i + 2.0, 7.525L-20 %i + 3.0, -4.256L-19 %i + 4.0, - 1.0, - 2.168L-19 %i - 2.0, -- 7.525L-20 %i - 3.0, - 4.256L-19 %i - 4.0] +(%o5) [1.0, 4.441e-16 %i + 2.0, 3.0, 4.0 - 4.441e-16 %i, - 1.0, + - 4.441e-16 %i - 2.0, - 3.0, 4.441e-16 %i - 4.0] +@end group +@group (%i6) lmax (abs (L2 - L)); -(%o6) 3.545L-16 +(%o6) 4.441e-16 +@end group @end example Complex data. @@ -293,18 +307,24 @@ Complex data. @c L2 : inverse_fft (L1); @c lmax (abs (L2 - L)); @c ===end=== -@example +@example maxima (%i1) load ("fft") $ (%i2) fpprintprec : 4 $ (%i3) L : [1, 1 + %i, 1 - %i, -1, -1, 1 - %i, 1 + %i, 1] $ +@group (%i4) L1 : fft (L); -(%o4) [0.5, 0.5, 0.25 %i - 0.25, (- 0.3536 %i) - 0.3536, 0.0, 0.5, - (- 0.25 %i) - 0.25, 0.3536 %i + 0.3536] +(%o4) [0.5, 0.5, 0.25 %i - 0.25, - 0.3536 %i - 0.3536, 0.0, 0.5, + - 0.25 %i - 0.25, 0.3536 %i + 0.3536] +@end group +@group (%i5) L2 : inverse_fft (L1); -(%o5) [1.0, 1.0 %i + 1.0, 1.0 - 1.0 %i, - 1.0, - 1.0, 1.0 - 1.0 %i, - 1.0 %i + 1.0, 1.0] +(%o5) [1.0, 1.0 %i + 1.0, 1.0 - 1.0 %i, - 1.0, - 1.0, + 1.0 - 1.0 %i, 1.0 %i + 1.0, 1.0] +@end group +@group (%i6) lmax (abs (L2 - L)); -(%o6) 0.0 +(%o6) 0.0 +@end group @end example Computation of sine and cosine coefficients. @@ -331,7 +351,7 @@ Computation of sine and cosine coefficients. @c f(j) := sum (a[k] * cos (2*%pi*j*k / n) + b[k] * sin (2*%pi*j*k / n), k, 0, n/2) $ @c makelist (float (f (j)), j, 0, n - 1); @c ===end=== -@example +@example maxima (%i1) load ("fft") $ (%i2) fpprintprec : 4 $ (%i3) L : [1, 2, 3, 4, 5, 6, 7, 8] $ @@ -343,20 +363,27 @@ Computation of sine and cosine coefficients. (%i9) b : make_array (any, n/2 + 1) $ (%i10) a[0] : realpart (y[0]) $ (%i11) b[0] : 0 $ +@group (%i12) for k : 1 thru n/2 - 1 do (a[k] : realpart (y[k] + y[n - k]), b[k] : imagpart (y[n - k] - y[k])); (%o12) done +@end group (%i13) a[n/2] : y[n/2] $ (%i14) b[n/2] : 0 $ +@group (%i15) listarray (a); (%o15) [4.5, - 1.0, - 1.0, - 1.0, - 0.5] +@end group +@group (%i16) listarray (b); -(%o16) [0, - 2.414, - 1.0, - .4142, 0] -(%i17) f(j) := sum (a[k]*cos(2*%pi*j*k/n) + b[k]*sin(2*%pi*j*k/n), - k, 0, n/2) $ +(%o16) [0, 2.414, 1.0, 0.4142, 0] +@end group +(%i17) f(j) := sum (a[k] * cos (2*%pi*j*k / n) + b[k] * sin (2*%pi*j*k / n), k, 0, n/2) $ +@group (%i18) makelist (float (f (j)), j, 0, n - 1); -(%o18) [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] +(%o18) [1.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0] +@end group @end example @opencatbox{Categories:} @@ -603,21 +630,30 @@ generate programs to be run in Fortran. See also @mrefdot{stringout} @c ev (expr, x=1e155); @c ev (expr2, x=1e155); @c ===end=== -@example +@example maxima +@group (%i1) expr: 1e-155*x^2 - 5.5*x + 5.2e155; - 2 -(%o1) 1.e-155 x - 5.5 x + 5.2e+155 + 2 +(%o1) 1.0e-155 x - 5.5 x + 5.2e155 +@end group +@group (%i2) expr2: horner (%, x), keepfloat: true; -(%o2) 1.0 ((1.e-155 x - 5.5) x + 5.2e+155) +(%o2) 1.0 ((1.0e-155 x - 5.5) x + 5.2e155) +@end group +@group (%i3) ev (expr, x=1e155); Maxima encountered a Lisp error: - arithmetic error FLOATING-POINT-OVERFLOW signalled + Arithmetic error FLOATING-POINT-OVERFLOW signalled. +Operation was *, operands (1.0e155 NIL). Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. +@end group +@group (%i4) ev (expr2, x=1e155); -(%o4) 7.00000000000001e+154 +(%o4) 7.000000000000006e154 +@end group @end example @opencatbox{Categories:} @@ -719,32 +755,58 @@ Examples: @c bf_find_root (exp(x) = y, x, 0, 100), y = 10; @c log(10b0); @c ===end=== -@example +@example maxima +@group (%i1) f(x) := sin(x) - x/2; x (%o1) f(x) := sin(x) - - 2 +@end group +@group (%i2) find_root (sin(x) - x/2, x, 0.1, %pi); (%o2) 1.895494267033981 +@end group +@group (%i3) find_root (sin(x) = x/2, x, 0.1, %pi); (%o3) 1.895494267033981 +@end group +@group (%i4) find_root (f(x), x, 0.1, %pi); (%o4) 1.895494267033981 +@end group +@group (%i5) find_root (f, 0.1, %pi); (%o5) 1.895494267033981 +@end group +@group (%i6) find_root (exp(x) = y, x, 0, 100); x (%o6) find_root(%e = y, x, 0.0, 100.0) +@end group +@group (%i7) find_root (exp(x) = y, x, 0, 100), y = 10; (%o7) 2.302585092994046 +@end group +@group (%i8) log (10.0); (%o8) 2.302585092994046 +@end group +@group (%i9) fpprec:32; -(%o9) 32 -(%i10) bf_find_root (exp(x) = y, x, 0, 100), y = 10; -(%o10) 2.3025850929940456840179914546844b0 -(%i11) log(10b0); -(%o11) 2.3025850929940456840179914546844b0 +(%o9) 32 +@end group +@group +(%i10) 32; +(%o10) 32 +@end group +@group +(%i11) bf_find_root (exp(x) = y, x, 0, 100), y = 10; +(%o11) 2.3025850929940456840179914546844b0 +@end group +@group +(%i12) log(10b0); +(%o12) 2.3025850929940456840179914546844b0 +@end group @end example @opencatbox{Categories:} @@ -783,20 +845,32 @@ Examples: @c newton (x^2 - a^2, x, a/2, a^2/100); @c ev (x^2 - a^2, x = %); @c ===end=== -@example +@example maxima +@group (%i1) load ("newton1"); -(%o1) /maxima/share/numeric/newton1.mac +(%o1) /maxima/share/numeric/newton1.mac +@end group +@group (%i2) newton (cos (u), u, 1, 1/100); -(%o2) 1.570675277161251 +(%o2) 1.5706752771612507 +@end group +@group (%i3) ev (cos (u), u = %); -(%o3) 1.2104963335033529e-4 +(%o3) 1.2104963335033528e-4 +@end group +@group (%i4) assume (a > 0); (%o4) [a > 0] +@end group +@group (%i5) newton (x^2 - a^2, x, a/2, a^2/100); -(%o5) 1.00030487804878 a +(%o5) 1.0003048780487804 a +@end group +@group (%i6) ev (x^2 - a^2, x = %); 2 (%o6) 6.098490481853958e-4 a +@end group @end example @opencatbox{Categories:} @@ -1016,7 +1090,7 @@ To show the direction field of the differential equation @math{y' = exp(-x) + y} @c ===beg=== @c plotdf(exp(-x)+y,[trajectory_at,2,-0.1])$ @c ===end=== -@example +@example maxima (%i1) plotdf(exp(-x)+y,[trajectory_at,2,-0.1])$ @end example @@ -1031,7 +1105,7 @@ To obtain the direction field for the equation @math{diff(y,x) = x - y^2} and th @c [trajectory_at,-1,3], [direction,forward], @c [y,-5,5], [x,-4,16])$ @c ===end=== -@example +@example maxima @group (%i1) plotdf(x-y^2,[xfun,"sqrt(x);-sqrt(x)"], [trajectory_at,-1,3], [direction,forward], @@ -1055,7 +1129,7 @@ fixed at 2): @c plotdf([v,-k*z/m], [z,v], [parameters,"m=2,k=2"], @c [sliders,"m=1:5"], [trajectory_at,6,0])$ @c ===end=== -@example +@example maxima @group (%i1) plotdf([v,-k*z/m], [z,v], [parameters,"m=2,k=2"], [sliders,"m=1:5"], [trajectory_at,6,0])$ @@ -1073,7 +1147,7 @@ To plot the direction field of the Duffing equation, @math{m*x''+c*x'+k*x+b*x^3 @c [parameters,"k=-1,m=1.0,c=0,b=1"], @c [sliders,"k=-2:2,m=-1:1"],[tstep,0.1])$ @c ===end=== -@example +@example maxima @group (%i1) plotdf([y,-(k*x + c*y + b*x^3)/m], [parameters,"k=-1,m=1.0,c=0,b=1"], @@ -1098,7 +1172,7 @@ the two state variables as a function of time: @c [a,-10,2], [w,-14,14], [direction,forward], @c [nsteps,300], [sliders,"m=0.1:1"], [versus_t,1])$ @c ===end=== -@example +@example maxima @group (%i1) plotdf([w,-g*sin(a)/l - b*w/m/l], [a,w], [parameters,"g=9.8,l=0.5,m=0.3,b=0.05"], @@ -1145,7 +1219,7 @@ Example: @c V: 900/((x+1)^2+y^2)^(1/2)-900/((x-1)^2+y^2)^(1/2)$ @c ploteq(V,[x,-2,2],[y,-2,2],[fieldlines,"blue"])$ @c ===end=== -@example +@example maxima (%i1) V: 900/((x+1)^2+y^2)^(1/2)-900/((x-1)^2+y^2)^(1/2)$ (%i2) ploteq(V,[x,-2,2],[y,-2,2],[fieldlines,"blue"])$ @end example @@ -1227,7 +1301,7 @@ increments of 0.1 for t, use: @c results: rk(t-x^2,x,1,[t,0,8,0.1])$ @c plot2d ([discrete, results])$ @c ===end=== -@example +@example maxima (%i1) results: rk(t-x^2,x,1,[t,0,8,0.1])$ (%i2) plot2d ([discrete, results])$ @end example @@ -1253,11 +1327,15 @@ for t between 0 and 4, and with values of -1.25 and 0.75 for x and y at t=0: @c plot2d([discrete, makelist([p[1], p[3]], p, sol)], [xlabel, "t"], @c [ylabel, "y"])$ @c ===end=== -@example +@example maxima +@group (%i1) sol: rk([4-x^2-4*y^2, y^2-x^2+1], [x, y], [-1.25, 0.75], - [t, 0, 4, 0.02])$ + [t,0,4,0.02])$ +@end group +@group (%i2) plot2d([discrete, makelist([p[1], p[3]], p, sol)], [xlabel, "t"], [ylabel, "y"])$ +@end group @end example The plot will show the solution for variable @var{y} as a function of @var{t}. commit 46a4194b9052bbe38ba4a9176e161f49b3c48777 Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 07:47:13 2025 -0700 Run update_examples diff --git a/doc/info/Differential.texi b/doc/info/Differential.texi index a9a6a7bcc..46952d585 100644 --- a/doc/info/Differential.texi +++ b/doc/info/Differential.texi @@ -68,33 +68,41 @@ calling @code{desolve} by using @mref{atvalue}. @c desolve([%o1,%o2],[f(x),g(x)]); @c [%o1,%o2],%o5,diff; @c ===end=== -@example +@example maxima +@group (%i1) 'diff(f(x),x)='diff(g(x),x)+sin(x); d d (%o1) -- (f(x)) = -- (g(x)) + sin(x) dx dx -(%i2) 'diff(g(x),x,2)='diff(f(x),x)-cos(x); +@end group @group +(%i2) 'diff(g(x),x,2)='diff(f(x),x)-cos(x); 2 d d (%o2) --- (g(x)) = -- (f(x)) - cos(x) 2 dx dx @end group +@group (%i3) atvalue('diff(g(x),x),x=0,a); (%o3) a +@end group +@group (%i4) atvalue(f(x),x=0,1); (%o4) 1 +@end group +@group (%i5) desolve([%o1,%o2],[f(x),g(x)]); - x -(%o5) [f(x) = a %e - a + 1, g(x) = - - x - cos(x) + a %e - a + g(0) - 1] + x +(%o5) [f(x) = %e a - a + 1, g(x) = + x + cos(x) + %e a - a + g(0) - 1] +@end group +@group (%i6) [%o1,%o2],%o5,diff; - x x x x -(%o6) [a %e = a %e , a %e - cos(x) = a %e - cos(x)] - + x x x x +(%o6) [%e a = %e a, %e a - cos(x) = %e a - cos(x)] +@end group @end example If @code{desolve} cannot obtain a solution, it returns @code{false}. @@ -191,43 +199,56 @@ Example: @c ratsimp (ic2(soln2,x=0,y=0,'diff(y,x)=2)); @c bc2 (soln2,x=0,y=1,x=1,y=3); @c ===end=== -@example -(%i1) x^2*'diff(y,x)+3*x*y = sin(x)/x; - 2 dy sin(x) -(%o1) 3 x y + x -- = ------ - dx x -(%i2) soln1:ode2(%,y,x); - %c - cos(x) -(%o2) y = ----------- - 3 - x -(%i3) ic1(soln1,x = %pi,y = 0); - 1 + cos(x) -(%o3) y = - ---------- - 3 - x -(%i4) 'diff(y,x,2)+y*('diff(y,x))^3 = 0; - 2 - dy 3 d y -(%o4) y (--) + --- = 0 - dx 2 - dx -(%i5) soln2:ode2(%,y,x); - 3 - 6 %k1 y + y -(%o5) ------------ = %k2 + x - 6 -(%i6) ratsimp(ic2(soln2,x = 0,y = 0,'diff(y,x) = 2)); - 3 - 3 y + y -(%o6) -------- = x - 6 -(%i7) bc2(soln2,x = 0,y = 1,x = 1,y = 3); - - 3 - - 10 y + y 3 -(%o7) ----------- = - - + x - 6 2 +@example maxima +@group +(%i1) x^2*'diff(y,x) + 3*y*x = sin(x)/x; + 2 dy sin(x) +(%o1) x -- + 3 x y = ------ + dx x +@end group +@group +(%i2) soln1: ode2(%,y,x); + %c - cos(x) +(%o2) y = ----------- + 3 + x +@end group +@group +(%i3) ic1 (soln1,x=%pi,y=0); + cos(x) + 1 +(%o3) y = - ---------- + 3 + x +@end group +@group +(%i4) 'diff(y,x,2) + y*'diff(y,x)^3 = 0; + 2 + d y dy 3 +(%o4) --- + y (--) = 0 + 2 dx + dx +@end group +@group +(%i5) soln2: ode2(%,y,x); + 3 + y + 6 %k1 y +(%o5) ------------ = x + %k2 + 6 +@end group +@group +(%i6) ratsimp (ic2(soln2,x=0,y=0,'diff(y,x)=2)); + 3 + y + 3 y +(%o6) -------- = x + 6 +@end group +@group +(%i7) bc2 (soln2,x=0,y=1,x=1,y=3); + 3 + y - 10 y 3 +(%o7) --------- = x - - + 6 2 +@end group @end example @opencatbox{Categories:} commit 72f5b47f38465515b857a794fcce4e32baaf3ed0 Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 21:32:53 2025 -0700 Add code to compute example for breakup We can now use update_examples to generate the example for breakup. Also run update_examples so we get syntax highlighting when enabled. diff --git a/doc/info/Equations.texi b/doc/info/Equations.texi index a514a193f..75d599afb 100644 --- a/doc/info/Equations.texi +++ b/doc/info/Equations.texi @@ -48,7 +48,7 @@ It's recommended to use this list rather than doing @code{concat ('%r, j)}. @c sol : subst (t[i], %rnum_list[i], sol)$ @c sol; @c ===end=== -@example +@example maxima @group (%i1) solve ([x + y = 3], [x,y]); (%o1) [[x = 3 - %r1, y = %r1]] @@ -208,7 +208,7 @@ Examples: @c e2: -1 - y + 2*y^2 - x + x^2; @c algsys ([e1, e2], [x, y]); @c ===end=== -@example +@example maxima @group (%i1) e1: 2*x*(1 - a1) - 2*(x - 1)*a2; (%o1) 2 (1 - a1) x - 2 a2 (x - 1) @@ -297,7 +297,7 @@ Examples: @c polyfactor: true$ @c allroots (eqn); @c ===end=== -@example +@example maxima @group (%i1) eqn: (1 + 2*x)^3 = 13.5*(1 + x^5); 3 5 @@ -314,7 +314,7 @@ x = - 0.9659625152196369 %i - 0.4069597231924075, x = 1.0] do (e2: subst (e, eqn), disp (expand (lhs(e2) - rhs(e2)))); - 3.552713678800501e-15 - - 5.329070518200751e-15 + - 8.43769498715119e-15 2.6645352591003757e-15 %i - 6.217248937900877e-15 @@ -380,7 +380,7 @@ the generation of extremely large expressions. @c backsubst : true$ @c linsolve ([eq1, eq2, eq3], [x,y,z]); @c ===end=== -@example +@example maxima (%i1) eq1 : x + y + z = 6$ (%i2) eq2 : x - y + z = 2$ (%i3) eq3 : x + y - z = 0$ @@ -415,66 +415,79 @@ Otherwise, common subexpressions are not identified. Examples: -@example +@c ===beg=== +@c programmode: false$ +@c breakup: true$ +@c solve (x^3 + x^2 - 1); +@c breakup: false$ +@c solve (x^3 + x^2 - 1); +@c ===end=== +@example maxima (%i1) programmode: false$ (%i2) breakup: true$ +@group (%i3) solve (x^3 + x^2 - 1); - - sqrt(23) 25 1/3 -(%t3) (--------- + --) - 6 sqrt(3) 54 -Solution: - - sqrt(3) %i 1 - ---------- - - - sqrt(3) %i 1 2 2 1 -(%t4) x = (- ---------- - -) %t3 + -------------- - - - 2 2 9 %t3 3 - - sqrt(3) %i 1 - - ---------- - - - sqrt(3) %i 1 2 2 1 -(%t5) x = (---------- - -) %t3 + ---------------- - - - 2 2 9 %t3 3 - - 1 1 -(%t6) x = %t3 + ----- - - - 9 %t3 3 + sqrt(23) 25 1/3 +(%t3) (-------- + --) + 3/2 54 + 2 3 +solve: solution: + + sqrt(3) %i - 1 + ---------- + --- + - 1 sqrt(3) %i 2 2 - 1 +(%t4) x = (--- - ----------) %t3 + ---------------- + --- + 2 2 9 %t3 3 + + - 1 sqrt(3) %i + --- - ---------- + sqrt(3) %i - 1 2 2 - 1 +(%t5) x = (---------- + ---) %t3 + ---------------- + --- + 2 2 9 %t3 3 + + 1 - 1 +(%t6) x = %t3 + ----- + --- + 9 %t3 3 (%o6) [%t4, %t5, %t6] -(%i6) breakup: false$ -(%i7) solve (x^3 + x^2 - 1); -Solution: - - sqrt(3) %i 1 - ---------- - - - 2 2 sqrt(23) 25 1/3 -(%t7) x = --------------------- + (--------- + --) - sqrt(23) 25 1/3 6 sqrt(3) 54 - 9 (--------- + --) - 6 sqrt(3) 54 - - sqrt(3) %i 1 1 - (- ---------- - -) - - - 2 2 3 -@group - sqrt(23) 25 1/3 sqrt(3) %i 1 -(%t8) x = (--------- + --) (---------- - -) - 6 sqrt(3) 54 2 2 - - sqrt(3) %i 1 - - ---------- - - - 2 2 1 - + --------------------- - - - sqrt(23) 25 1/3 3 - 9 (--------- + --) - 6 sqrt(3) 54 -@end group - sqrt(23) 25 1/3 1 1 -(%t9) x = (--------- + --) + --------------------- - - - 6 sqrt(3) 54 sqrt(23) 25 1/3 3 - 9 (--------- + --) - 6 sqrt(3) 54 -(%o9) [%t7, %t8, %t9] +@end group +(%i7) breakup: false$ +@group +(%i8) solve (x^3 + x^2 - 1); +solve: solution: + + sqrt(3) %i - 1 + ---------- + --- + 2 2 sqrt(23) 25 1/3 +(%t8) x = -------------------- + (-------- + --) + sqrt(23) 25 1/3 3/2 54 + 9 (-------- + --) 2 3 + 3/2 54 + 2 3 + - 1 sqrt(3) %i - 1 + (--- - ----------) + --- + 2 2 3 + + sqrt(23) 25 1/3 sqrt(3) %i - 1 +(%t9) x = (-------- + --) (---------- + ---) + 3/2 54 2 2 + 2 3 + - 1 sqrt(3) %i + --- - ---------- + 2 2 - 1 + + -------------------- + --- + sqrt(23) 25 1/3 3 + 9 (-------- + --) + 3/2 54 + 2 3 + + sqrt(23) 25 1/3 1 - 1 +(%t10) x = (-------- + --) + -------------------- + --- + 3/2 54 sqrt(23) 25 1/3 3 + 2 3 9 (-------- + --) + 3/2 54 + 2 3 +(%o10) [%t8, %t9, %t10] +@end group @end example @opencatbox{Categories:} @@ -531,7 +544,7 @@ or not there exists a rational function @code{@var{g}(@var{t})} satisfying @c (n - 1)/(n + 2); @c funcsolve (eqn, f(n)); @c ===end=== -@example +@example maxima @group (%i1) eqn: (n + 1)*f(n) - (n + 3)*f(n + 1)/(n + 1) = (n - 1)/(n + 2); @@ -586,7 +599,7 @@ Examples: @c x; @c y; @c ===end=== -@example +@example maxima (%i1) globalsolve: true$ @group (%i2) solve ([x + 3*y = 2, 2*x - y = 5], [x, y]); @@ -811,7 +824,7 @@ Examples: @c infix ("]["); @c lhs (aa ][ bb); @c ===end=== -@example +@example maxima @group (%i1) e: aa + bb = cc; (%o1) bb + aa = cc @@ -916,7 +929,7 @@ Examples: @c linsolve ([e1, e2, e3], '[x, y, z]); @c [x, y, z]; @c ===end=== -@example +@example maxima @group (%i1) e1: x + z = y; (%o1) z + x = y @@ -1059,7 +1072,7 @@ interval may be @code{minf} or @code{inf}. @c p: x^10 - 2*x^4 + 1/2$ @c nroots (p, -6, 9.1); @c ===end=== -@example +@example maxima (%i1) p: x^10 - 2*x^4 + 1/2$ @group (%i2) nroots (p, -6, 9.1); @@ -1186,7 +1199,7 @@ Examples: @c ev (%[1], float); @c ev (-1 - x + x^5, %); @c ===end=== -@example +@example maxima @group (%i1) realroots (-1 - x + x^5, 5e-6); 612003 @@ -1207,7 +1220,7 @@ Examples: @c realroots (expand ((1 - x)^5 * (2 - x)^3 * (3 - x)), 1e-20); @c multiplicities; @c ===end=== -@example +@example maxima @group (%i1) realroots (expand ((1 - x)^5 * (2 - x)^3 * (3 - x)), 1e-20); (%o1) [x = 1, x = 2, x = 3] @@ -1258,7 +1271,7 @@ Examples: @c infix ("]["); @c rhs (aa ][ bb); @c ===end=== -@example +@example maxima @group (%i1) e: aa + bb = cc; (%o1) bb + aa = cc @@ -1385,7 +1398,7 @@ Examples: @c rootsconmode: true$ @c rootscontract (sqrt(5 + sqrt(5)) - 5^(1/4)*sqrt(1 + sqrt(5))); @c ===end=== -@example +@example maxima (%i1) rootsconmode: false$ @group (%i2) rootscontract (x^(1/2)*y^(3/2)); @@ -1537,7 +1550,7 @@ Examples: @c solve (%, x); @c ev (%th(2), %[1]); @c ===end=== -@example +@example maxima @group (%i1) solve (asin (cos (3*x))*(f(x) - 1), x); solve: using arc-trig functions to get a solution. @@ -1651,7 +1664,7 @@ The symbols @code{%r} are used to denote arbitrary constants in a solution. @c ===beg=== @c solve([x+y=1,2*x+2*y=2],[x,y]); @c ===end=== -@example +@example maxima @group (%i1) solve([x+y=1,2*x+2*y=2],[x,y]); solve: dependent equations eliminated: (2) @@ -1788,7 +1801,7 @@ and the second centered at (c,d) with radius s. @c eq2: (x-c)^2+(y-d)^2-s^2; @c algsys([eq1,eq2],[x,y]); @c ===end=== -@example +@example maxima @group (%i1) eq1: (x-a)^2+(y-b)^2-r^2; 2 2 2 @@ -1819,7 +1832,7 @@ the center of the second circle is located on the positive x-axis. @c eq2a:(x-C)^2+y^2-S^2; @c algsys([eq1a,eq2a],[x,y]); @c ===end=== -@example +@example maxima @group (%i1) eq1a:x^2+y^2-1; 2 2 @@ -1859,7 +1872,7 @@ a solution. @c eq2b:(x-C)^2+y^2-s^2; @c algsys([eq1b,eq2b],[x,y]); @c ===end=== -@example +@example maxima @group (%i1) eq1b:x^2+y^2-r^2; 2 2 2 @@ -1908,7 +1921,7 @@ Note the complexity of the solution at (%o4). @c ratsimp(subst(soln[1],[eq1,eq2])); @c ratsimp(subst(soln[2],[eq1,eq2])); @c ===end=== -@example +@example maxima @group (%i1) eq1: (x-a)^2+(y-b)^2-r^2; 2 2 2 @@ -2026,7 +2039,7 @@ are two (perhaps multiple) solutions, as we know geometrically. @c ratsimp(subst(soln[1],[eq1,eq2])); @c ratsimp(subst(soln[2],[eq1,eq2])); @c ===end=== -@example +@example maxima @group (%i1) eq1: (x-a)^2+(y-b)^2-r^2; 2 2 2 @@ -2164,7 +2177,7 @@ allows a solution to be found. @c /* numerical values of solution */ @c rectform(float(s)); @c ===end=== -@example +@example maxima @group (%i1) eq1: %pi*y + x - 1; (%o1) %pi y + x - 1 @@ -2283,7 +2296,7 @@ of the problem to restrict the range of parameters appropriately. @c (forget(h>0),assume(h<0)); @c algsys(eqs,[x,y,z]); @c ===end=== -@example +@example maxima @group (%i1) eqs:[y-x=0, g*x*y-h=0, z+(x+1)/y-x-1=0]; x + 1 @@ -2353,7 +2366,7 @@ solution, for a maximum of ten solutions overall. @c eqs:poly_reduced_grobner([p1,p2],[x,y]); @c algsys(eqs,[x,y]); @c ===end=== -@example +@example maxima @group (%i1) p1:-x*y^3+y^2+x^4-9*x/8; 3 2 4 9 x @@ -2423,7 +2436,7 @@ x = +/- sqrt(z-y^2) = +/- sqrt(sqrt(5)-2). @c ===beg=== @c algsys([x^2+y^2+z^2-1,z-x^2-y^2,y-x^2-z^2],[x,y,z]); @c ===end=== -@example +@example maxima @group (%i1) algsys([x^2+y^2+z^2-1,z-x^2-y^2,y-x^2-z^2],[x,y,z]); sqrt(5) - 1 sqrt(5) + 1 commit 01d3f5f9e304284413dabbf0e9f234f99b55a56b Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 21:18:03 2025 -0700 Fix up examples for exponential integrals For some reason the code for these examples were deleted and we got an error. I've restored the example from the 5.47.0 manual. (I hope that's right.) Ran update_examples over this example. diff --git a/doc/info/Integration.texi.m4 b/doc/info/Integration.texi.m4 index 519413f28..7cb18a034 100644 --- a/doc/info/Integration.texi.m4 +++ b/doc/info/Integration.texi.m4 @@ -1192,18 +1192,37 @@ Examples for exponential integrals: @c ===beg=== @c assume(s>0,a>0,s-a>0)$ -@c ratsimp(specint(%e^(a*t) +@c ratsimp(specint(%e^(a*t)*(log(a)+expintegral_e1(a*t))*%e^(-s*t),t)); @c logarc:true$ @c gamma_expand:true$ +@c radcan(specint((cos(t)*expintegral_si(t) -sin(t)*expintegral_ci(t))*%e^(-s*t),t)); +@c ratsimp(specint((2*t*log(a)+2/a*sin(a*t) -2*t*expintegral_ci(a*t))*%e^(-s*t),t)); @c ===end=== -incorrect syntax: logarc is not an infix operator -logarc: - ^ @example maxima (%i1) assume(s>0,a>0,s-a>0)$ -(%i2) ratsimp(specint(%e^(a*t) -(%i2) logarc:true$ -(%i3) gamma_expand:true$ +@group +(%i2) ratsimp(specint(%e^(a*t)*(log(a)+expintegral_e1(a*t))*%e^(-s*t),t)); + log(s) +(%o2) ------ + s - a +@end group +(%i3) logarc:true$ +(%i4) gamma_expand:true$ +@group +(%i5) radcan(specint((cos(t)*expintegral_si(t) -sin(t)*expintegral_ci(t))*%e^(-s*t),t)); + log(s) +(%o5) ------ + 2 + s + 1 +@end group +@group +(%i6) ratsimp(specint((2*t*log(a)+2/a*sin(a*t) -2*t*expintegral_ci(a*t))*%e^(-s*t),t)); + 2 2 + log(s + a ) +(%o6) ------------ + 2 + s +@end group @end example Results when using the expansion of @mref{gamma_incomplete} and when changing commit edc2c53b12857d4479b3d07c93a36f9cfd3ef567 Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 19:39:03 2025 -0700 Run update_example for the laplace function Just adds "maxima" for the "@example" type. diff --git a/doc/info/Integration.texi.m4 b/doc/info/Integration.texi.m4 index e6be0430f..519413f28 100644 --- a/doc/info/Integration.texi.m4 +++ b/doc/info/Integration.texi.m4 @@ -860,7 +860,7 @@ Examples: @c laplace(sum((-1)^n*unit_step(t-n*%pi)*sin(t),n,0,inf),t,s), @c simpsum; @c ===end=== -@example +@example maxima @group (%i1) laplace (exp (2*t + a) * sin(t) * t, t, s); a commit 5a59cbd22aef09742256ca0d1cbf8f2dfdf7a02f Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 19:33:55 2025 -0700 Set intanalysis:false for the intanalysis example By doing this, we can use update_examples to update this. This also enables syntax highlighting. diff --git a/doc/info/Integration.texi.m4 b/doc/info/Integration.texi.m4 index a3039efb9..e6be0430f 100644 --- a/doc/info/Integration.texi.m4 +++ b/doc/info/Integration.texi.m4 @@ -310,30 +310,35 @@ Maxima can solve the following integrals, when @mref{intanalysis} is set to @code{false}: @c ===beg=== +@c intanalysis:false; @c integrate(1/(sqrt(x+1)+1),x,0,1); @c integrate(1/(sqrt(x)+1),x,0,1),intanalysis:false; @c integrate(cos(a)/sqrt((tan(a))^2+1),a,-%pi/2,%pi/2),intanalysis:false; @c intanalysis:false$ @c integrate(cos(a)/sqrt((tan(a))^2 +1),a,-%pi/2,%pi/2); @c ===end=== -@example +@example maxima +@group +(%i1) intanalysis:false; +(%o1) false +@end group @group -(%i1) integrate(1/(sqrt(x+1)+1),x,0,1); +(%i2) integrate(1/(sqrt(x+1)+1),x,0,1); 3/2 -(%o1) - 2 log(sqrt(2) + 1) + 2 log(2) + 2 - 2 +(%o2) - 2 log(sqrt(2) + 1) + 2 log(2) + 2 - 2 @end group @group -(%i2) integrate(1/(sqrt(x)+1),x,0,1),intanalysis:false; -(%o2) 2 - 2 log(2) +(%i3) integrate(1/(sqrt(x)+1),x,0,1),intanalysis:false; +(%o3) 2 - 2 log(2) @end group @group -(%i3) integrate(cos(a)/sqrt((tan(a))^2+1),a,-%pi/2,%pi/2),intanalysis:false; -(%o3) %i log(2) - %i log(2 %i) +(%i4) integrate(cos(a)/sqrt((tan(a))^2+1),a,-%pi/2,%pi/2),intanalysis:false; +(%o4) %i log(2) - %i log(2 %i) @end group -(%i4) intanalysis:false$ +(%i5) intanalysis:false$ @group -(%i5) integrate(cos(a)/sqrt((tan(a))^2 +1),a,-%pi/2,%pi/2); -(%o5) %i log(2) - %i log(2 %i) +(%i6) integrate(cos(a)/sqrt((tan(a))^2 +1),a,-%pi/2,%pi/2); +(%o6) %i log(2) - %i log(2 %i) @end group @end example commit 52630395e36edbba760afff6396da671b73132e4 Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 19:30:38 2025 -0700 Rerun update_examples Run update_examples to get the most recent results and also make the examples maxima examples so they can get syntax highlighting. diff --git a/doc/info/Differentiation.texi b/doc/info/Differentiation.texi index b52bbae30..726de534d 100644 --- a/doc/info/Differentiation.texi +++ b/doc/info/Differentiation.texi @@ -47,34 +47,46 @@ Examples: @c antid (expr, x, y(x)); @c antidiff (expr, x, y(x)); @c ===end=== -@example +@example maxima (%i1) load ("antid")$ +@group (%i2) expr: exp (z(x)) * diff (z(x), x) * y(x); - z(x) d -(%o2) y(x) %e (-- (z(x))) + z(x) d +(%o2) %e y(x) (-- (z(x))) dx +@end group +@group (%i3) a1: antid (expr, x, z(x)); - z(x) z(x) d -(%o3) [y(x) %e , - %e (-- (y(x)))] + z(x) z(x) d +(%o3) [%e y(x), - %e (-- (y(x)))] dx +@end group +@group (%i4) a2: antidiff (expr, x, z(x)); / - z(x) [ z(x) d -(%o4) y(x) %e - I %e (-- (y(x))) dx - ] dx + z(x) | z(x) d +(%o4) %e y(x) - | %e (-- (y(x))) dx + | dx / +@end group +@group (%i5) a2 - (first (a1) + 'integrate (second (a1), x)); (%o5) 0 +@end group +@group (%i6) antid (expr, x, y(x)); - z(x) d -(%o6) [0, y(x) %e (-- (z(x)))] + z(x) d +(%o6) [0, %e y(x) (-- (z(x)))] dx +@end group +@group (%i7) antidiff (expr, x, y(x)); / - [ z(x) d -(%o7) I y(x) %e (-- (z(x))) dx - ] dx + | z(x) d +(%o7) | %e y(x) (-- (z(x))) dx + | dx / +@end group @end example @opencatbox{Categories:} @@ -121,34 +133,46 @@ Examples: @c antid (expr, x, y(x)); @c antidiff (expr, x, y(x)); @c ===end=== -@example +@example maxima (%i1) load ("antid")$ +@group (%i2) expr: exp (z(x)) * diff (z(x), x) * y(x); - z(x) d -(%o2) y(x) %e (-- (z(x))) + z(x) d +(%o2) %e y(x) (-- (z(x))) dx +@end group +@group (%i3) a1: antid (expr, x, z(x)); - z(x) z(x) d -(%o3) [y(x) %e , - %e (-- (y(x)))] + z(x) z(x) d +(%o3) [%e y(x), - %e (-- (y(x)))] dx +@end group +@group (%i4) a2: antidiff (expr, x, z(x)); / - z(x) [ z(x) d -(%o4) y(x) %e - I %e (-- (y(x))) dx - ] dx + z(x) | z(x) d +(%o4) %e y(x) - | %e (-- (y(x))) dx + | dx / +@end group +@group (%i5) a2 - (first (a1) + 'integrate (second (a1), x)); (%o5) 0 +@end group +@group (%i6) antid (expr, x, y(x)); - z(x) d -(%o6) [0, y(x) %e (-- (z(x)))] + z(x) d +(%o6) [0, %e y(x) (-- (z(x)))] dx +@end group +@group (%i7) antidiff (expr, x, y(x)); / - [ z(x) d -(%o7) I y(x) %e (-- (z(x))) dx - ] dx + | z(x) d +(%o7) | %e y(x) (-- (z(x))) dx + | dx / +@end group @end example @opencatbox{Categories:} @@ -185,7 +209,7 @@ Examples: @c diff (4*f(x, y)^2 - u(x, y)^2, x); @c at (%, [x = 0, y = 1]); @c ===end=== -@example +@example maxima @group (%i1) atvalue (f(x,y), [x = 0, y = 1], a^2); 2 @@ -195,17 +219,19 @@ Examples: (%i2) atvalue ('diff (f(x,y), x), x = 0, 1 + y); (%o2) @@2 + 1 @end group +@group (%i3) printprops (all, atvalue); - ! - d ! - --- (f(@@1, @@2))! = @@2 + 1 - d@@1 ! - !@@1 = 0 + | + d | + --- (f(@@1, @@2))| = @@2 + 1 + d@@1 | + |@@1 = 0 2 f(0, 1) = a (%o3) done +@end group @group (%i4) diff (4*f(x, y)^2 - u(x, y)^2, x); d d @@ -214,11 +240,11 @@ Examples: @end group @group (%i5) at (%, [x = 0, y = 1]); - ! - 2 d ! -(%o5) 16 a - 2 u(0, 1) (-- (u(x, 1))! ) - dx ! - !x = 0 + | + 2 d | +(%o5) 16 a - 2 u(0, 1) (-- (u(x, 1))| ) + dx | + |x = 0 @end group @end example @@ -235,16 +261,16 @@ seen in the following example: @c subst(e2,e1); @c ev(e1,e2,diff); @c ===end=== -@example +@example maxima (%i1) e1:I(t)=C*diff(U(t),t)$ (%i2) e2:U(t)=L*diff(I(t),t)$ @group (%i3) at(e1,e2); - ! - d ! -(%o3) I(t) = C (-- (U(t))! ) - dt ! d - !U(t) = L (-- (I(t))) + | + d | +(%o3) I(t) = C (-- (U(t))| ) + dt | d + |U(t) = L (-- (I(t))) dt @end group @group @@ -332,7 +358,7 @@ Examples: @c diff (4*f(x,y)^2 - u(x,y)^2, x); @c at (%, [x = 0, y = 1]); @c ===end=== -@example +@example maxima @group (%i1) atvalue (f(x,y), [x = 0, y = 1], a^2); 2 @@ -342,17 +368,19 @@ Examples: (%i2) atvalue ('diff (f(x,y), x), x = 0, 1 + y); (%o2) @@2 + 1 @end group +@group (%i3) printprops (all, atvalue); - ! - d ! - --- (f(@@1, @@2))! = @@2 + 1 - d@@1 ! - !@@1 = 0 + | + d | + --- (f(@@1, @@2))| = @@2 + 1 + d@@1 | + |@@1 = 0 2 f(0, 1) = a (%o3) done +@end group @group (%i4) diff (4*f(x,y)^2 - u(x,y)^2, x); d d @@ -361,11 +389,11 @@ Examples: @end group @group (%i5) at (%, [x = 0, y = 1]); - ! - 2 d ! -(%o5) 16 a - 2 u(0, 1) (-- (u(x, 1))! ) - dx ! - !x = 0 + | + 2 d | +(%o5) 16 a - 2 u(0, 1) (-- (u(x, 1))| ) + dx | + |x = 0 @end group @end example @@ -395,16 +423,22 @@ Examples: @c diff (exp (x*y)); @c diff (x*y*z); @c ===end=== -@example +@example maxima +@group (%i1) diff (log (x)); del(x) (%o1) ------ x +@end group +@group (%i2) diff (exp (x*y)); - x y x y -(%o2) x %e del(y) + y %e del(x) + x y x y +(%o2) %e x del(y) + %e y del(x) +@end group +@group (%i3) diff (x*y*z); (%o3) x y del(z) + x z del(y) + y z del(x) +@end group @end example @opencatbox{Categories:} @@ -423,16 +457,18 @@ Currently only @mref{laplace} knows about the @code{delta} function. Example: @c ===beg=== +@c assume(a > 0)$ @c laplace (delta (t - a) * sin(b*t), t, s); -@c input:p; @c ===end=== -@example -(%i1) laplace (delta (t - a) * sin(b*t), t, s); -Is a positive, negative, or zero? - -p; - - a s -(%o1) sin(a b) %e +@example maxima +(%i1) assume(a > 0)$ +@group +(%i2) laplace (delta (t - a) * sin(b*t), t, s); + 2 %i a b - a s - %i a b + (%e - 1) %e %i +(%o2) - ------------------------------------ + 2 +@end group @end example @opencatbox{Categories:} @@ -471,7 +507,7 @@ See also @mref{depends} and @mrefdot{gradef} @c remove (quux, dependency); @c dependencies; @c ===end=== -@example +@example maxima @group (%i1) dependencies; (%o1) [] @@ -558,42 +594,54 @@ See also @mrefcomma{diff} @mrefcomma{del} @mref{derivdegree} and @c dependencies; @c diff (r.s, u); @c ===end=== -@example +@example maxima +@group (%i1) depends ([f, g], x); (%o1) [f(x), g(x)] +@end group +@group (%i2) depends ([r, s], [u, v, w]); (%o2) [r(u, v, w), s(u, v, w)] +@end group +@group (%i3) depends (u, t); (%o3) [u(t)] +@end group +@group (%i4) dependencies; (%o4) [f(x), g(x), r(u, v, w), s(u, v, w), u(t)] +@end group +@group (%i5) diff (r.s, u); - dr ds -(%o5) -- . s + r . -- - du du + dr ds +(%o5) (--) . s + r . -- + du du +@end group @end example @c ===beg=== @c diff (r.s, t); @c ===end=== -@example -(%i6) diff (r.s, t); - dr du ds du -(%o6) -- -- . s + r . -- -- - du dt du dt +@example maxima +@group +(%i1) diff (r.s, t); +(%o1) 0 +@end group @end example @c ===beg=== @c remove (r, dependency); @c diff (r.s, t); @c ===end=== -@example -(%i7) remove (r, dependency); -(%o7) done -(%i8) diff (r.s, t); - ds du -(%o8) r . -- -- - du dt +@example maxima +@group +(%i1) remove (r, dependency); +(%o1) done +@end group +@group +(%i2) diff (r.s, t); +(%o2) 0 +@end group @end example @opencatbox{Categories:} @@ -634,15 +682,19 @@ Example: @c 'diff (y, x, 2) + 'diff (y, z, 3) + 'diff (y, x) * x^2; @c derivdegree (%, y, x); @c ===end=== -@example +@example maxima +@group (%i1) 'diff (y, x, 2) + 'diff (y, z, 3) + 'diff (y, x) * x^2; 3 2 d y d y 2 dy (%o1) --- + --- + x -- 3 2 dx dz dx +@end group +@group (%i2) derivdegree (%, y, x); (%o2) 2 +@end group @end example @opencatbox{Categories:} @@ -727,30 +779,38 @@ Examples: @c 'integrate (f(x, y), y, g(x), h(x)); @c diff (%, x); @c ===end=== -@example +@example maxima +@group (%i1) diff (exp (f(x)), x, 2); 2 f(x) d f(x) d 2 (%o1) %e (--- (f(x))) + %e (-- (f(x))) 2 dx dx +@end group (%i2) derivabbrev: true$ +@group (%i3) 'integrate (f(x, y), y, g(x), h(x)); h(x) / - [ -(%o3) I f(x, y) dy - ] + | +(%o3) | f(x, y) dy + | / g(x) +@end group +@group (%i4) diff (%, x); h(x) / - [ -(%o4) I f(x, y) dy + f(x, h(x)) h(x) - f(x, g(x)) g(x) - ] x x x + | +(%o4) | (f(x, y)) dy + f(x, h(x)) (h(x)) + | x x / g(x) + - f(x, g(x)) (g(x)) + x +@end group @end example For the tensor package, the following modifications have been @@ -834,51 +894,79 @@ Examples: @c [a, b, c] ~ [x, y, z]; @c express (%); @c ===end=== -@example +@example maxima (%i1) load ("vect")$ +@group (%i2) grad (x^2 + y^2 + z^2); 2 2 2 (%o2) grad (z + y + x ) +@end group +@group (%i3) express (%); d 2 2 2 d 2 2 2 d 2 2 2 (%o3) [-- (z + y + x ), -- (z + y + x ), -- (z + y + x )] dx dy dz +@end group +@group (%i4) ev (%, diff); (%o4) [2 x, 2 y, 2 z] +@end group +@group (%i5) div ([x^2, y^2, z^2]); 2 2 2 (%o5) div [x , y , z ] +@end group +@group (%i6) express (%); d 2 d 2 d 2 (%o6) -- (z ) + -- (y ) + -- (x ) dz dy dx +@end group +@group (%i7) ev (%, diff); (%o7) 2 z + 2 y + 2 x +@end group +@group (%i8) curl ([x^2, y^2, z^2]); 2 2 2 (%o8) curl [x , y , z ] +@end group +@group (%i9) express (%); d 2 d 2 d 2 d 2 d 2 d 2 (%o9) [-- (z ) - -- (y ), -- (x ) - -- (z ), -- (y ) - -- (x )] dy dz dz dx dx dy +@end group +@group (%i10) ev (%, diff); (%o10) [0, 0, 0] +@end group +@group (%i11) laplacian (x^2 * y^2 * z^2); 2 2 2 (%o11) laplacian (x y z ) +@end group +@group (%i12) express (%); 2 2 2 d 2 2 2 d 2 2 2 d 2 2 2 (%o12) --- (x y z ) + --- (x y z ) + --- (x y z ) 2 2 2 dz dy dx +@end group +@group (%i13) ev (%, diff); 2 2 2 2 2 2 (%o13) 2 y z + 2 x z + 2 x y +@end group +@group (%i14) [a, b, c] ~ [x, y, z]; (%o14) [a, b, c] ~ [x, y, z] +@end group +@group (%i15) express (%); (%o15) [b z - c y, c x - a z, a y - b x] +@end group @end example @opencatbox{Categories:} commit d614552b9aa0250f4a624ddc8c33673f6c12cdcd Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 18:44:59 2025 -0700 Support dark mode too for pygments The color scheme isn't so great, but at least the background for the pygments highlighting matches the example background. diff --git a/doc/info/manual.css b/doc/info/manual.css index f49b4bb4f..fc95c9aea 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -2,6 +2,11 @@ :root { --example-background-color: rgb(238,238,255); } +@media (prefers-color-scheme: dark) { + :root { + --example-background-color: #aab; + } +} /* Overrides to the default Makeinfo CSS */ div.display {margin-left: 0} @@ -138,7 +143,10 @@ dd { margin-left: 0.5em } pre.example, pre.example-preformatted { border: 1px solid black; color: black; - background-color: #aab; + background-color: var(--example-background-color); + } + div.highlight { + background-color: var(--example-background-color) !important; } div.categorybox { background-color: #544 } div.textbox, div.titlebox, div.synopsisbox { color: black;} commit 3865b325cee6ee87d94b98d5faf947049982b15e Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 18:36:14 2025 -0700 Make the background for pygments to match examples We want to background color for pygments highlighting to match the background used for examples. Otherwise it looks weird. To do this, define a CSS variable `--example-background-color` that is set to the example background color. Use this variable to set the example background and the div highlight class for pygments. diff --git a/doc/info/manual.css b/doc/info/manual.css index 1daa5b327..f49b4bb4f 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -1,3 +1,8 @@ +/* Define variable for background color for examples */ +:root { + --example-background-color: rgb(238,238,255); +} + /* Overrides to the default Makeinfo CSS */ div.display {margin-left: 0} div.example { @@ -43,11 +48,20 @@ div.synopsisbox { pre.example, pre.example-preformatted { border: 1px solid rgb(180,180,180); padding: 5px; - background-color: rgb(238,238,255); + background-color: var(--example-background-color); /* Add scrollbar for examples for narrow windows */ overflow: auto; } +/* + * For pygments, make the background color of the highlighted code the + * same as the example background color. Without this, it looks funny. + */ + +div.highlight { + background-color: var(--example-background-color) !important; +} + div.spacerbox { border: none; padding: 2em 0 } div.image { margin: 0; padding: 1em; text-align: center } div.categorybox { commit f4e46eba7ff2e89e532f7ca0cc47b25eaa594f1d Author: Raymond Toy <toy...@gm...> Date: Wed Aug 20 18:35:46 2025 -0700 Fix typo in error message about pygments Change "to" to "too". diff --git a/configure.ac b/configure.ac index cbbb37cc9..eba6ab9d0 100644 --- a/configure.ac +++ b/configure.ac @@ -754,7 +754,7 @@ if test x"${enable_build_docs}" = xtrue ; then if test ${makeinfo_version} -ge 702; then USE_PYGMENTS=true else - AC_MSG_ERROR([Makeinfo version (${makeinfo_version_string}) to old to use pygments for syntax highlighting. Disable or use highlightjs]) + AC_MSG_ERROR([Makeinfo version (${makeinfo_version_string}) too old to use pygments for syntax highlighting. Disable or use highlightjs]) fi fi AC_SUBST(TEXI_EXTRA_HEAD) commit 4c8187e5e6f6a5743f4f484717289852b3f9af09 Author: Raymond Toy <toy...@gm...> Date: Fri Jul 25 11:41:07 2025 -0700 Change default pygments line-height Pygments sets the line-height of examples to 125%. That seems a bit too narrow. Use normal instead. diff --git a/doc/info/manual.css b/doc/info/manual.css index c6e4df97a..1daa5b327 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -73,6 +73,14 @@ div.header, div.nav-panel { padding: 3px 10px; } +/* + * Pygments uses a line height of 125%, which seems too small compared + * to what we used to do. + */ +div.highlight pre { + line-height: normal !important; +} + /* * Forcefully override the pygments background color for examples, if * pygments is used for highlighting. commit 24b2d30fe6e752a863c78cf0d669faefe40e9b74 Author: Raymond Toy <toy...@gm...> Date: Fri Jul 25 08:10:15 2025 -0700 Override pygments background color Pygments uses a very light blue (?) for the background which doesn't match what Maxima currently uses for the background. Update CSS to override the color that pygments uses. diff --git a/doc/info/manual.css b/doc/info/manual.css index a4f2cbe96..c6e4df97a 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -72,6 +72,15 @@ div.header, div.nav-panel { background-color: #CDCCDD; padding: 3px 10px; } + +/* + * Forcefully override the pygments background color for examples, if + * pygments is used for highlighting. + */ +div.highlight { + background: rgb(238,238,255) !important; +} + /* Reduce the indentation of lists and descriptions */ ul,ol { padding-left: 1em } dd { margin-left: 0.5em } commit fdf8b514fd1f5858dc00ba1550b1a4b3856ac037 Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 15:18:32 2025 -0700 Put closing double quote at end of TEXIOPTS I think it got accidentally moved when merging with HEAD. diff --git a/doc/info/build_html.sh.in b/doc/info/build_html.sh.in index 1f0c98549..ee8940688 100755 --- a/doc/info/build_html.sh.in +++ b/doc/info/build_html.sh.in @@ -211,7 +211,7 @@ fi # There should be no errors in the texi files so don't use "--force -e # 10000" to force building the docs. We want to fail building if # there are errors now. -TEXIOPT="$FORCE --html -c OUTPUT_ENCODING_NAME=UTF-8 -e 10000 --document-lang=$language -I . -I $languagedir --css-ref=manual.css -I ../.. -I @abs_srcdir@/figures --init-file $texiinitfile ${SET_HTML_MATH}" +TEXIOPT="$FORCE --html -c OUTPUT_ENCODING_NAME=UTF-8 -e 10000 --document-lang=$language -I . -I $languagedir --css-ref=manual.css -I ../.. -I @abs_srcdir@/figures --init-file $texiinitfile ${SET_HTML_MATH} ${SET_HIGHLIGHT}" # Show the commands. set -x @MAKEINFO@ $FORCE --split=chapter --no-node-files --output="$languagedestdir" $TEXIOPT maxima.texi commit 286103f0df8f9b5ca0d0a1f22eaf7254b6305e2d Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 15:17:41 2025 -0700 Fix typo: nav-bar -> nav-panel Also add a comment that nav-panel is used by texinfo 7.1 and later. 6.8 uses header. diff --git a/doc/info/manual.css b/doc/info/manual.css index 17ea9d260..a4f2cbe96 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -64,7 +64,10 @@ img { } tt, code { font-family: "Courier New", "DejaVu Sans Mono", monospace } -/* Put background color on the navigation bar */ +/* + * Put background color on the navigation bar + * Texinfo 7.1 and later uses div.nav-panel. 6.8 uses div.header. + */ div.header, div.nav-panel { background-color: #CDCCDD; padding: 3px 10px; commit 758016a28cb3eb32cb29c5f12d7876bd1db479dd Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 15:16:21 2025 -0700 Use correct CSS comment style; change line-height CSS comments use C-style comments. Try to change the line-height for highlighted pre blocks for pygments. The line-height is rather small. diff --git a/doc/info/manual.css b/doc/info/manual.css index 637f15764..17ea9d260 100644 --- a/doc/info/manual.css +++ b/doc/info/manual.css @@ -45,7 +45,7 @@ pre.example, pre.example-preformatted { padding: 5px; background-color: rgb(238,238,255); /* Add scrollbar for examples for narrow windows */ - overflow: auto + overflow: auto; } div.spacerbox { border: none; padding: 2em 0 } @@ -119,5 +119,5 @@ dd { margin-left: 0.5em } /* Lines for highlighted examples are too close by default with * pygments. Make it larger. */ - line-height: 150% !important; + line-height: normal !important; } commit d75fb58de80407a2ecf4987566f531756470b310 Author: Raymond Toy <toy...@gm...> Date: Thu Aug 21 15:15:09 2025 -0700 Fix bugs in testing value of syntax highlighting Fix issues with checking for pygments when syntax highlighting was set to pygments. We were produci... [truncated message content] |