Rouben Rostamian

MaplePrimes Activity


These are questions asked by Rouben Rostamian

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

 

restart;

kernelopts(version);

`Maple 2023.1, X86 64 LINUX, Jul 07 2023, Build ID 1723669`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1561 and is the same as the version installed in this computer, created 2023, October 20, 22:58 hours Pacific Time.`

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

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

Uval := simplify(value(U));

Uval := `simplify/piecewise/unfactor`(4*piecewise(t < 1, 0, t < 2, t-5+4*exp(`&ndash;`((1/4)*t)+1/4), 2 <= t, 1+4*exp(`&ndash;`((1/4)*t)+1/4)-4*exp(`&ndash;`((1/4)*t)+1/2)))

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

`simplify/piecewise/unfactor`(4+16*exp(-5/4)-16*exp(-1))

 
 

Download simplify-piecewise-bug.mw

 

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);

`Maple 2023.1, X86 64 LINUX, Jul 07 2023, Build ID 1723669`

with(inttrans):

exp(-a*t);

exp(-a*t)

laplace(%, t, s);

1/(s+a)

invlaplace(%, s, t);

exp(a*t)

 

Download laplace-transform-bug.mw

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

restart;

kernelopts(version);

`Maple 2023.0, X86 64 LINUX, Mar 06 2023, Build ID 1689885`

with(plots):

setoptions3d(font=[Times,roman,12]);

arrow(<1,1,1>);

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

 

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, -infinity < x and x < infinity,  t > 0.

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

v := proc (x, t) options operator, arrow; piecewise(x <= -t, 0, x < t, 1/2+(1/2)*x/t) end proc

Position x(t):

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

de := diff(x(t), t) = piecewise(x(t) <= -t, 0, x(t) < t, 1/2+x(t)/(2*t))

Initial condition, assuming a > 0

ic := x(0) = -a;

x(0) = -a

Symbolic solution, calculated by hand:

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

x__exact := proc (t) options operator, arrow; piecewise(t < a, -a, t-2*sqrt(t)*sqrt(a)) end proc

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

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';

3

a

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

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

Download ode-piecewise.mw

 

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 n consisting of the

two distinct symbols a and b.

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);

[[a], [b]]

doit(p,q,3);

[[p, p, p], [p, p, q], [p, q, p], [p, q, q], [q, p, p], [q, p, q], [q, q, p], [q, q, q]]

doit(5,7,3);

[[5, 5, 5], [5, 5, 7], [5, 7, 5], [5, 7, 7], [7, 5, 5], [7, 5, 7], [7, 7, 5], [7, 7, 7]]
 

Download mw.mw

1 2 3 4 5 6 7 Last Page 2 of 16