## 7853 Reputation

18 years, 38 days

## Bug in simplify piecewise...

Maple 2023

This used to work in Maple 2022.  Something is broken in 2023.

 > restart;
 > kernelopts(version);

 > Physics:-Version();

 > U := Int(exp(-1/4*t - 1/4*x)*piecewise(x < -2, 1, x < -1, -x - 1, 0), x = -t .. 0);

 > Uval := simplify(value(U));

 > eval(Uval, {x=5, t=6});

 >

## Inverse Laplace transform on Maple 2023 ...

Maple 2023

Maple thinks the inverse Laplace transform of 1/(s+a) is exp(a*t).  It should be exp(−a*t).

This used to work correctly in Maple 2022.  Something got messed up in 2023.

 > restart;
 > kernelopts(version);

 > with(inttrans):
 > exp(-a*t);

 > laplace(%, t, s);

 > invlaplace(%, s, t);

## setoptions3d stopped working in Maple 20...

Maple 2023

This code fails in Maple 2023.  It used to work in earlier versions.  Did I miss something in the release notes?

 > restart;
 > kernelopts(version);

 > with(plots):
 > setoptions3d(font=[Times,roman,12]);
 > arrow(<1,1,1>);

Error, (in plottools:-rotate) invalid arguments for 3-D transformation

## How to find a symbolic solution for this...

Maple 2022

I can derive a symbolic solution by hand for the following ODE, but cannot get Maple to do it for me.  Any tricks?

 > restart;

Velocity field, ,  .

 > v := (x,t) -> piecewise(x <= -t, 0, x < t, 1 - 1/2*(1 - x/t));

Position :

 > de := diff(x(t),t) = v(x(t),t);

Initial condition, assuming

 > ic := x(0) = -a;

Symbolic solution, calculated by hand:

 > x__exact := t -> piecewise(t < a, -a, t - 2*sqrt(t)*sqrt(a));

Verify exact solution by comparing it against the numeric solution for some :

 > a := 3;  # any a>0 should do dsol := dsolve({de,ic}, numeric): plots:-odeplot(dsol, t=0..5);   # dsolve solution plot(x__exact(t), t=0..5);      # symbolic solution (calculated by hand) a := 'a';

Can Maple's dsolve find the exact solution?  This one returns empty in Maple 2022:

 > dsolve({de, ic}) assuming a > 0, t > 0;

## How to generate these combinations?...

Maple

I expect that there must exist a Maple proc that does the equivalent of the following but I couldn't find it.  Can it be in the combinat package?

And if there isn't one, can the following be improved?  It seems to be horribly inefficient to me, although efficiency is not a major concern for me right now since I need it only for small values of n.

 > restart;

Proc produces all lists of length  consisting of the

two distinct symbols  and .

 > doit := proc(a, b, n::posint)         local p := 1, L := [ [a], [b] ];         for p from 1 to n-1 do                  L := [ map( x -> [a,op(x)], L)[], map( x -> [b,op(x)], L)[] ];         end do:         return L; end proc:
 > doit(a,b,1);

 > doit(p,q,3);

 > doit(5,7,3);