nm

10436 Reputation

19 Badges

12 years, 191 days

MaplePrimes Activity


These are questions asked by nm

Maple 2024.2 gives wrong inverse Laplace transform on expressions with exp(s) multiplied by Ei (the exponentional integral) with complex argument.

Below are two examples found so far. 

Inverse laplace of  exp(s)/2*Ei(1, s + I) gives exp(-I*(t + 1))/(2*(t + 2))  but the correct inverse should be exp(-I*(t + 1))/(2*(t + 1))

Inverse laplace of  exp(s)/2*Ei(1, s - I) gives exp(I*(t + 1))/(2*(t + 2))  but the correct inverse should be exp(I*(t + 1))/(2*(t + 1))

i.e. in both cases it gives 2*(t + 2) in denominator when denominator should be 2*(t + 1)

Below is worksheet

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1836 and is the same as the version installed in this computer, created 2024, December 2, 10:11 hours Pacific Time.`

 

Example 1

 

restart;

Y:=exp(s)/2*Ei(1, s + I);
y_wrong:=inttrans:-invlaplace(Y,s,t)

(1/2)*exp(s)*Ei(1, s+I)

(1/2)*exp(-I*(t+1))/(t+2)

#to show it is wrong, lets ask for the laplace transform of it. We see it is not the same as Y

Y_back:=inttrans:-laplace(y_wrong,t,s): simplify(%);

(1/2)*exp(I+2*s)*Ei(1, 2*s+2*I)

simplify(Y-Y_back);

(1/2)*exp(s)*Ei(1, s+I)-(1/2)*exp(I+2*s)*Ei(1, 2*s+2*I)

#correct invlaplace should be exp(-I*(t + 1))/(2*(t + 1)). Proof:
y_correct:=exp(-I*(t + 1))/(2*(t + 1));

exp(-I*(t+1))/(2*t+2)

Y_back:=inttrans:-laplace(y_correct,t,s);

(1/2)*exp(s)*Ei(1, s+I)

simplify(Y-Y_back);

0

Example 2

 

restart;

Y:=exp(s)/2*Ei(1, s - I);
y_wrong:=inttrans:-invlaplace(Y,s,t)

(1/2)*exp(s)*Ei(1, s-I)

(1/2)*exp(I*(t+1))/(t+2)

#to show it is wrong, let ask for the laplace transform of it. We see it is not the same as Y

Y_back:=inttrans:-laplace(y_wrong,t,s): simplify(%);

(1/2)*exp(-I+2*s)*Ei(1, 2*s-2*I)

simplify(Y-Y_back);

(1/2)*exp(s)*Ei(1, s-I)-(1/2)*exp(-I+2*s)*Ei(1, 2*s-2*I)

#correct invlaplace should be exp(I*(t + 1))/(2*(t + 1)). Proof:
y_correct:=exp(I*(t + 1))/(2*(t + 1));

exp(I*(t+1))/(2*t+2)

Y_back:=inttrans:-laplace(y_correct,t,s);

(1/2)*exp(s)*Ei(1, s-I)

simplify(Y-Y_back);

0

 

 

 

 

 

Download bug_in_inverse_laplace_transform.mw

 

Also Reported to Maple support.

Any idea why Maple returns empty string when asked for the latex of the Laplace of x(t)?  Am I doing anything wrong here? I do not see it

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1828 and is the same as the version installed in this computer, created 2024, November 18, 7:25 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

e:=inttrans:-laplace(x(t),t,s)

laplace(x(t), t, s)

latex(e,'output'='string')

""

 

 

Download latex_of_laplace_nov_21_2024.mw

I was expecting something like this using another software

Did Maple always behave this way for Laplace? I do not have earlier version now to check.  Any workaround?

Is this a known error when using PDEtools:-Solve? I get no error using solve on same input, so thought to ask, just in case it should not happen.

For now, I will change my code to use solve for this.

I am basically solving two equations in Laplace domain for Y1(s) and Y2(s). But since there are initial conditions x(0) and y(0) in the equations, and Laplace has L(x(t),t,s)  then PDEtools:-Solve is not happy, as it sees x(t) and x(0) in same input.

But solve has no problem with this. Who is correct? solve or Solve?

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1828 and is the same as the version installed in this computer, created 2024, November 18, 7:25 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

sys:=[s*laplace(x(t),t,s)-x(0) = -3*laplace(x(t),t,s)+4*laplace(y(t),t,s)+1/(s^2+1), s*laplace(y(t),t,s)-y(0) = -2*laplace(x(t),t,s)+3*laplace(y(t),t,s)+1/s^2];
Ys:=[laplace(x(t),t,s), laplace(y(t),t,s)];

[s*laplace(x(t), t, s)-x(0) = -3*laplace(x(t), t, s)+4*laplace(y(t), t, s)+1/(s^2+1), s*laplace(y(t), t, s)-y(0) = -2*laplace(x(t), t, s)+3*laplace(y(t), t, s)+1/s^2]

[laplace(x(t), t, s), laplace(y(t), t, s)]

solve(sys,Ys);

[[laplace(x(t), t, s) = (x(0)*s^5+4*y(0)*s^4-3*x(0)*s^4+x(0)*s^3+4*y(0)*s^2-3*x(0)*s^2+s^3+s^2+4)/((s^4-1)*s^2), laplace(y(t), t, s) = (y(0)*s^5+3*y(0)*s^4-2*x(0)*s^4+y(0)*s^3+3*y(0)*s^2-2*x(0)*s^2+s^3+s^2+s+3)/((s^4-1)*s^2)]]

PDEtools:-Solve(sys,Ys)

Error, (in PDEtools:-Solve) found functions with same name but depending on different arguments in the given DE system: x(0), x(t). Specification of the dependent variables is required

 

 

Download differenece_between_solve_and_Solve_nov_20_2024.mw

I was not expecting odesteps to show steps for this ode, but crash the server each and everytime?

Anyone could find why? I am using Maple 2024.2 on windows 10 with latest Physics. This might indicate serious problem somewhere. Software should not really crash this easily.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1827 and is the same as the version installed in this computer, created 2024, November 13, 9:16 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

ode:=5*(1+t^2)*diff(y(t),t)=4*t*y(t)*(y(t)^3-1);

5*(t^2+1)*(diff(y(t), t)) = 4*t*y(t)*(y(t)^3-1)

dsolve(ode);

y(t) = 1/((t^2+1)^(6/5)*c__1+1)^(1/3), y(t) = -(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)-((1/2)*I)*3^(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3), y(t) = -(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)+((1/2)*I)*3^(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)

Student:-ODEs:-ODESteps(ode);


 

Download crash_server_nov_18_2024.mw

here is small movie

 

 

I am learning patten matching in Maple. 

Any one could explain why patmatch(1, (x::anything)^(n::'nonunit'(anything)))   gives true but patmatch(2, (x::anything)^n::'nonunit'(anything)); gives false?

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

restart;

patmatch(1, (x::anything)^(n::'nonunit'(anything)))

true

patmatch(2, (x::anything)^n::'nonunit'(anything));

false

Download patmatch_question_nov_16_2024.mw

I was expecting result similar to using this other software

I do not understand Maple's result. How could I change the patmatch so it does not match 1 to the pattern x::anything^n::anything where n is not 1 ?

Update

To give context, I was trying to write this example from the other software  in Maple:

But when I wrote this

expr:=1 + x^2 + x^4;

F:=proc(X::anything,x::symbol)
    local la,y,n;
    if patmatch(X, (y::anything)^(n::'nonunit'(anything)) ,'la') then  
       f(eval(n,la));
     else
        X;
     fi;
end proc;

map(X->F(X,x), expr);

Maple gave 

So I modified the code now to check for explicit 1,  to avoid this bad match, like this

expr:=1 + x^2 + x^4;

F:=proc(X::anything,x::symbol)
    local la,y,n;
    if patmatch(X, (y::anything)^(n::'nonunit'(anything)) ,'la') then  
        if eval(y,la)=1 then #bug in maple?
           X;
        else
           f(eval(n,la));
        fi;
     else
        X;
     fi;
end proc;

map(X->F(X,x), expr);

And now it gives expected result

3 4 5 6 7 8 9 Last Page 5 of 189