nm

8552 Reputation

19 Badges

12 years, 347 days

MaplePrimes Activity


These are questions asked by nm

I have been trying Maple 2024 and found this strange result. 

Calling solve(identity...  on same input in Maple 2024 gives very large and complex output compare with Maple 2023.2.1.

This was causing problem, until I found that simplifying the solution now gives same output as Maple 2023.2.1

But why is this now needed in Maple 2024? i.e. why is calling simplify needed when in Maple 2023 the simpler solution was returned automatically?

I changed my code to call simplify now on result of solve(identity...  but I am just curious what happened to cause this?

Below are two worksheets, one from Maple 2024 and one from Maple 2023.2 and you see the huge difference in result.


 

56056

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1693. The version installed in this computer is 1672 created 2024, February 7, 18:34 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

restart;

238012

trial_solution_constants:=[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8]];
eq:=-2*A[1]*sin(x)+2*A[2]*cos(x)-4*A[2]*x*sin(x)+2*A[3]*sin(x)+4*A[3]*x*cos(x)+2*A[4]*cos(x)-6*A[5]*sin(3*x)-8*A[5]*x*cos(3*x)+6*A[6]*cos(3*x)-8*A[6]*x*sin(3*x)-8*A[7]*cos(3*x)-8*A[8]*sin(3*x) = x*cos(x)^3;
solve(identity(eq,x),trial_solution_constants)

[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8]]

-2*A[1]*sin(x)+2*A[2]*cos(x)-4*A[2]*x*sin(x)+2*A[3]*sin(x)+4*A[3]*x*cos(x)+2*A[4]*cos(x)-6*A[5]*sin(3*x)-8*A[5]*x*cos(3*x)+6*A[6]*cos(3*x)-8*A[6]*x*sin(3*x)-8*A[7]*cos(3*x)-8*A[8]*sin(3*x) = x*cos(x)^3

[[A[1] = 3/16, A[2] = 0, A[3] = 3/16, A[4] = 0, A[5] = -1/32, A[6] = 0, A[7] = 0, A[8] = 3/128]]

 


 

Download solve_identity_march_11_2024_maple_2023.mw

 


 

56056

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1693 and is the same as the version installed in this computer, created 2024, March 7, 17:27 hours Pacific Time.`

restart;

56944

trial_solution_constants:=[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8]];
eq:=-2*A[1]*sin(x)+2*A[2]*cos(x)-4*A[2]*x*sin(x)+2*A[3]*sin(x)+4*A[3]*x*cos(x)+2*A[4]*cos(x)-6*A[5]*sin(3*x)-8*A[5]*x*cos(3*x)+6*A[6]*cos(3*x)-8*A[6]*x*sin(3*x)-8*A[7]*cos(3*x)-8*A[8]*sin(3*x) = x*cos(x)^3;
solve(identity(eq,x),trial_solution_constants)

[A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8]]

-2*A[1]*sin(x)+2*A[2]*cos(x)-4*A[2]*x*sin(x)+2*A[3]*sin(x)+4*A[3]*x*cos(x)+2*A[4]*cos(x)-6*A[5]*sin(3*x)-8*A[5]*x*cos(3*x)+6*A[6]*cos(3*x)-8*A[6]*x*sin(3*x)-8*A[7]*cos(3*x)-8*A[8]*sin(3*x) = x*cos(x)^3

[[A[1] = -(3/16)*(648*cos(3)*sin(1)^3+972*cos(3)*sin(1)^2*cos(1)+432*sin(3)*sin(1)^3+648*sin(3)*sin(1)^2*cos(1)+2268*sin(1)^4+1296*sin(1)^3*cos(1)+324*sin(3)*cos(3)-108*sin(1)*cos(3)-585*cos(3)*cos(1)-133*sin(3)^2-153*sin(3)*sin(1)-48*sin(3)*cos(1)-2025*sin(1)^2+225)/(108*sin(1)*cos(3)+99*cos(3)*cos(1)-2*sin(3)^2+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+261), A[2] = (9/32)*(-48*cos(3)*sin(1)^3-72*cos(3)*sin(1)^2*cos(1)+88*sin(3)*sin(1)^3+132*sin(3)*sin(1)^2*cos(1)+864*sin(1)^4-108*sin(1)^3*cos(1)+21*sin(3)*cos(3)+117*sin(1)*cos(3)-144*cos(3)*cos(1)+40*sin(3)^2-12*sin(3)*sin(1)-141*sin(3)*cos(1)-972*sin(1)^2+243*cos(1)*sin(1)+144)/(108*sin(1)*cos(3)+99*cos(3)*cos(1)-2*sin(3)^2+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+261), A[3] = -(3/32)*(648*cos(3)*sin(1)^3+972*cos(3)*sin(1)^2*cos(1)+432*sin(3)*sin(1)^3+648*sin(3)*sin(1)^2*cos(1)+2268*sin(1)^4+1296*sin(1)^3*cos(1)+324*sin(3)*cos(3)-216*sin(1)*cos(3)-684*cos(3)*cos(1)-131*sin(3)^2-306*sin(3)*sin(1)+228*sin(3)*cos(1)-1863*sin(1)^2-36)/(108*sin(1)*cos(3)+99*cos(3)*cos(1)-2*sin(3)^2+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+261), A[4] = 0, A[5] = (1/64)*(216*cos(3)*sin(1)^3+324*cos(3)*sin(1)^2*cos(1)+144*sin(3)*sin(1)^3+216*sin(3)*sin(1)^2*cos(1)+756*sin(1)^4+432*sin(1)^3*cos(1)+41*cos(3)^2+108*sin(3)*cos(3)-216*sin(1)*cos(3)-360*cos(3)*cos(1)-306*sin(3)*sin(1)+444*sin(3)*cos(1)-405*sin(1)^2-401)/(2*cos(3)^2+108*sin(1)*cos(3)+99*cos(3)*cos(1)+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+259), A[6] = -(3/64)*(48*cos(3)*sin(1)^3+72*cos(3)*sin(1)^2*cos(1)-88*sin(3)*sin(1)^3-132*sin(3)*sin(1)^2*cos(1)-864*sin(1)^4+108*sin(1)^3*cos(1)+40*cos(3)^2-21*sin(3)*cos(3)-117*sin(1)*cos(3)+144*cos(3)*cos(1)+12*sin(3)*sin(1)+141*sin(3)*cos(1)+972*sin(1)^2-243*cos(1)*sin(1)-184)/(2*cos(3)^2+108*sin(1)*cos(3)+99*cos(3)*cos(1)+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+259), A[7] = (27/256)*(-48*cos(3)*sin(1)^3-72*cos(3)*sin(1)^2*cos(1)+88*sin(3)*sin(1)^3+132*sin(3)*sin(1)^2*cos(1)+864*sin(1)^4-108*sin(1)^3*cos(1)+21*sin(3)*cos(3)+117*sin(1)*cos(3)-144*cos(3)*cos(1)+40*sin(3)^2-12*sin(3)*sin(1)-141*sin(3)*cos(1)-972*sin(1)^2+243*cos(1)*sin(1)+144)/(108*sin(1)*cos(3)+99*cos(3)*cos(1)-2*sin(3)^2+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+261), A[8] = -(3/256)*(744*cos(3)*sin(1)^3+1116*cos(3)*sin(1)^2*cos(1)+496*sin(3)*sin(1)^3+744*sin(3)*sin(1)^2*cos(1)+2604*sin(1)^4+1488*sin(1)^3*cos(1)+372*sin(3)*cos(3)-216*sin(1)*cos(3)-756*cos(3)*cos(1)-151*sin(3)^2-306*sin(3)*sin(1)+180*sin(3)*cos(1)-2187*sin(1)^2+36)/(108*sin(1)*cos(3)+99*cos(3)*cos(1)-2*sin(3)^2+153*sin(3)*sin(1)-276*sin(3)*cos(1)-162*sin(1)^2+261)]]

simplify(%);

[[A[1] = 3/16, A[2] = 0, A[3] = 3/16, A[4] = 0, A[5] = -1/32, A[6] = 0, A[7] = 0, A[8] = 3/128]]

 


 

Download solve_identity_march_11_2024.mw

 

This code used to work OK in Maple 2023.2.1 on windows 10. Now it gives this new internal Maple error 

Error, (in property/ConvertRelation) numeric exception: division by zero

I think this is new problem in Maple 2024 as I have not seen it before. Will report it to Maplesoft. Mean while if someone has any workaround other than not using the `is` command will try it.

The following are two worksheets. One using 2023 shows it works OK (no error) and one in Maple 2024 with the new error

203072

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

restart;

203072

r:=1/4*a*(a*x^2+6);
tmp:=-1/x^2+1/2*a+(1/x+1/2*a*x)^2;
is(tmp = r)

(1/4)*a*(a*x^2+6)

-1/x^2+(1/2)*a+(1/x+(1/2)*a*x)^2

true

 

 

Download no_numeric_exception_march_7_2024_version_2023.mw
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

restart;

r:=1/4*a*(a*x^2+6);
tmp:=-1/x^2+1/2*a+(1/x+1/2*a*x)^2;
is(tmp = r)
 

(1/4)*a*(a*x^2+6)

-1/x^2+(1/2)*a+(1/x+(1/2)*a*x)^2

Error, (in property/ConvertRelation) numeric exception: division by zero

 

 

Download numeric_exception_march_7_2024_version_2024.mw

I was wondering if this is by design or not. Here is one example., This ode is solved by Maple 2023.2.1 on windows 10. The solution is in terms of DESol though. It takes less than one minute.

In Maple 2024 on same PC, dsolve hangs on it.

If this by design? Since DESol solution is not very useful actually. I was thinking that may be Maple is now trying to return a solution without DESol in it, and that is why it hangs or take long time. I stopped it after 5 minutes. 

Or should I report it to Maplesoft as possible bug?  

Below are 2 worksheets. One using Maple 2023 and one using 2024.

42444

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1684. The version installed in this computer is 1672 created 2024, February 7, 18:34 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

ode:=(x + 1)*diff(u(x), x, x)/((x - 1)*cosh(1/(x - 1))) - (1/((x - 1)*cosh(1/(x - 1))) - (x + 1)/((x - 1)^2*cosh(1/(x - 1))) + (x + 1)*sinh(1/(x - 1))/((x - 1)^3*cosh(1/(x - 1))^2) + (-2*x^3 - 2*x^2)*(x + 1)/((x - 1)^2*cosh(1/(x - 1))^2))*diff(u(x), x) + (x + 1)^2*(x^5 + x^4 + 2*x^2*cosh(1/(x - 1)) - 2*x*cosh(1/(x - 1)) - x - 1)*u(x)/((x - 1)^3*cosh(1/(x - 1))^3);

(x+1)*(diff(diff(u(x), x), x))/((x-1)*cosh(1/(x-1)))-(1/((x-1)*cosh(1/(x-1)))-(x+1)/((x-1)^2*cosh(1/(x-1)))+(x+1)*sinh(1/(x-1))/((x-1)^3*cosh(1/(x-1))^2)+(-2*x^3-2*x^2)*(x+1)/((x-1)^2*cosh(1/(x-1))^2))*(diff(u(x), x))+(x+1)^2*(x^5+x^4+2*x^2*cosh(1/(x-1))-2*x*cosh(1/(x-1))-x-1)*u(x)/((x-1)^3*cosh(1/(x-1))^3)

DEtools:-odeadvisor(ode);

[[_2nd_order, _with_linear_symmetries]]

dsolve(ode); #after about 1 minute...

u(x) = DESol({diff(diff(_Y(x), x), x)-(1/((x-1)*cosh(1/(x-1)))-(x+1)/((x-1)^2*cosh(1/(x-1)))+(x+1)*sinh(1/(x-1))/((x-1)^3*cosh(1/(x-1))^2)+(-2*x^3-2*x^2)*(x+1)/((x-1)^2*cosh(1/(x-1))^2))*(x-1)*cosh(1/(x-1))*(diff(_Y(x), x))/(x+1)+(x+1)*(x^5+x^4+2*x^2*cosh(1/(x-1))-2*x*cosh(1/(x-1))-x-1)*_Y(x)/((x-1)^2*cosh(1/(x-1))^2)}, {_Y(x)})

 

 

Download dsolve_march_7_2024_maple_2023.mw


restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

ode:=(x + 1)*diff(u(x), x, x)/((x - 1)*cosh(1/(x - 1))) - (1/((x - 1)*cosh(1/(x - 1))) - (x + 1)/((x - 1)^2*cosh(1/(x - 1))) + (x + 1)*sinh(1/(x - 1))/((x - 1)^3*cosh(1/(x - 1))^2) + (-2*x^3 - 2*x^2)*(x + 1)/((x - 1)^2*cosh(1/(x - 1))^2))*diff(u(x), x) + (x + 1)^2*(x^5 + x^4 + 2*x^2*cosh(1/(x - 1)) - 2*x*cosh(1/(x - 1)) - x - 1)*u(x)/((x - 1)^3*cosh(1/(x - 1))^3);

(x+1)*(diff(diff(u(x), x), x))/((x-1)*cosh(1/(x-1)))-(1/((x-1)*cosh(1/(x-1)))-(x+1)/((x-1)^2*cosh(1/(x-1)))+(x+1)*sinh(1/(x-1))/((x-1)^3*cosh(1/(x-1))^2)+(-2*x^3-2*x^2)*(x+1)/((x-1)^2*cosh(1/(x-1))^2))*(diff(u(x), x))+(x+1)^2*(x^5+x^4+2*x^2*cosh(1/(x-1))-2*x*cosh(1/(x-1))-x-1)*u(x)/((x-1)^3*cosh(1/(x-1))^3)

DEtools:-odeadvisor(ode);

[[_2nd_order, _with_linear_symmetries]]

dsolve(ode); #hangs

 

 

Download dsolve_march_7_2024_maple_2024.mw

chatGPT version used by the new NaturalLanguage package seems to be using chatGPT 3?. I asked it and this what it said

NL:=NaturalLanguage;
NL:-Query("what is your name?");
"As an Artificial Intelligence, I don't have a personal name. However, If 
you're asking how to represent the question \"What is your name?\" in MathML, 
it's actually irrelevant as MathML is used for marking up mathematical notations, 
not regular text or questions. \n\nBut in English, it's as simple 
as just asking \"What is your name?

Then I asked it 

NL:-Query("what version of chatGPT are you?");
"As an AI developed by OpenAI, I don't have a specific version like software 
programs or applications. I get continuous updates and improvements over time. 
However, as of my current operation, I'm based on GPT-3 model.

some questions: It is possible to make it use chatGPT 3.5 or 4.0 with NL?

How is this free to use and without getting a key from openAI? After agreeing to terms fromn the options menu, can one continue to use it for free? I thought chatGPT requires some fee to use. But I could be wrong.  but this is nice to be able to use it this easily from Maple!

Btw, It is still not very good in math. Asked it to first this simple first order ode and got wrong answer

NL:-Query("what is the solution to the differential equation y'(x)+y(x)=sin(x)");
"Sorry, this query was too complicated. Please rephrase and/or try again."

So I tried

NL:-Query("solve the differential equation y'(x)+y(x)=sin(x)");
"The differential equation given is a first order linear 

   ordinary differential equation. 

  

  The general solution can be obtained through the following 

   steps:

  

  1. Identify the homogeneous part of the equation, which is 

   y'(x) + y(x) = 0. The solution of such a homogeneous 

   equation known as the "complementary function" is y_c = 

   e^(-x) * A. where A is an arbitrary constant which will be 

   determined by a specific condition or boundary value.

  

  2. Find a Particular Integral (solution specific to the 

   nonhomogeneous part of the differential equation) which in 

   this case is y_p = -cos(x)

  

  3. Combine the Complementary function and Particular Integral 

   to get a general solution, y(x) = e^(-x) * A - cos(x).

  

  Now let's express the solution in MathML:"


                            (-x)          
                     y x = e     A - cos x

 "Note: Here A is a to-be-determined constant. If the problem 

    was a boundary value or initial value problem, you would 

    substitute the given values into this general solution and 

    solve it for A."


The solution should be

dsolve(diff(y(x),x)+y(x)=sin(x))

                y(x) = -cos(x)/2 + sin(x)/2 + exp(-x)*c__1

 

many times I have an expression with constant of integrations in it and need to integrate., So need to make sure to add a new constant of integration which is not already used.

Currently I do this

restart;
sol:=x-_C1*x+_C3*x^2;
myconstants:=indets(sol,And(symbol, suffixed(_C, nonnegint)));
map(X->String(X),myconstants);
map(X->X[3..],%);
map(X->:-parse(X),%);
n:=max(%);
new_constant:=_C||(n+1);

This make _C4 as the new constant. 

This assumes all constants have form _Cn which is what I use. It finds all _Cn's then converts each to string, then remove _C part from the string leaving the number, then find the maximum one and adds 1 to it to generate new constant to use,

Is there a better way to do this? Even though the above works, I have feeling there might be better way.

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