Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I would expect I could do

A := DataSeries([2, 3, 4], datatype = float)
B := DataSeries([1, 3, 19], datatype = float)
min~(A, B)

but the last command gives me 

Error, (in DataSeries:-min) invalid boolean expression: 2.

How do I find the element-wise min (i.e. DataSeries([1,3,4], datatype=float)) of two DataSeries?

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

One may easily spot that the symbols “” and “” are missing here and here

These two PDF files were printed officially, so I think they can be considered examples of best practice for the export functionality. Does this mean that this functionality is still defective in the most recent release?

I have an expression Z_val which I would like to rewrite in a compact, more readable form. Assuming that simplify() did its job, I thought of using (1) alias(), and (2) eval() with some combination of my parameters, since such combination occurs repetitively in my expression.

(1) is not particularly useful for my problem at hand. In particular, powers are not recognized and the alias I defined did not substitute the combination in all the places I was expecting to.

(2) is somehow effective but my expression becomes arguably even more complicated.

What else would you suggest?

EDIT:

restart;

local gamma;

gamma

(1)

M := -lambda*(beta^2*(sigma__v^2+sigma__e^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2;
V := simplify((1+(Cov__XY/(sigma__X*sigma__Y))^2)*(sigma__X*sigma__Y)^2);

-lambda*(beta^2*(sigma__e^2+sigma__v^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2

 

sigma__X^2*sigma__Y^2+Cov__XY^2

(2)

# Specify the terms, calculated by hand

sigma__X := beta^2*(sigma__v^2+sigma__e^2)+alpha^2*sigma__d^2;
sigma__Y := lambda^2*(beta^2*(sigma__v^2+sigma__e^2)+sigma__d^2*(alpha+1)^2)+sigma__v^2*(1-2*lambda*beta);
Cov__XY := M;

beta^2*(sigma__e^2+sigma__v^2)+alpha^2*sigma__d^2

 

lambda^2*(beta^2*(sigma__e^2+sigma__v^2)+sigma__d^2*(alpha+1)^2)+sigma__v^2*(-2*beta*lambda+1)

 

-lambda*(beta^2*(sigma__e^2+sigma__v^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2

(3)

V;

(beta^2*(sigma__e^2+sigma__v^2)+alpha^2*sigma__d^2)^2*(lambda^2*(beta^2*(sigma__e^2+sigma__v^2)+sigma__d^2*(alpha+1)^2)+sigma__v^2*(-2*beta*lambda+1))^2+(-lambda*(beta^2*(sigma__e^2+sigma__v^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2)^2

(4)

Z := M-(gamma/2)*V;

-lambda*(beta^2*(sigma__e^2+sigma__v^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2-(1/2)*gamma*((beta^2*(sigma__e^2+sigma__v^2)+alpha^2*sigma__d^2)^2*(lambda^2*(beta^2*(sigma__e^2+sigma__v^2)+sigma__d^2*(alpha+1)^2)+sigma__v^2*(-2*beta*lambda+1))^2+(-lambda*(beta^2*(sigma__e^2+sigma__v^2)+alpha*sigma__d^2*(alpha+1))+beta*sigma__v^2)^2)

(5)

# Specify lambda, beta, and alpha

l := simplify(-gamma*sigma__e^2*sigma__v^2/(2*(sigma__e^2 + sigma__v^2)) + sigma__v^2*sqrt(gamma^2*sigma__d^2*sigma__e^4 + 4*sigma__e^2 + 4*sigma__v^2)/(2*(sigma__e^2 + sigma__v^2)*sigma__d));
b := simplify(eval(sigma__v^2/((gamma*sigma__e^2 + 2*lambda)*sigma__v^2 + 2*lambda*sigma__e^2), lambda = l));
a := simplify(eval(-lambda*(sigma__e^2 + sigma__v^2)/((gamma*sigma__v^2 + 2*lambda)*sigma__e^2 + 2*lambda*sigma__v^2), lambda = l));

(1/2)*sigma__v^2*(-gamma*sigma__e^2*sigma__d+(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^(1/2))/((sigma__e^2+sigma__v^2)*sigma__d)

 

sigma__d/(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^(1/2)

 

(1/2)*(gamma*sigma__e^2*sigma__d-(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^(1/2))/(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^(1/2)

(6)

Z_val := simplify(eval(Z, [lambda = l, beta = b, alpha = a]));

-(1/4)*sigma__d*sigma__v^2*(((-2*gamma^2*sigma__d^4*sigma__e^4-16)*sigma__v^6+(-6*gamma^2*sigma__d^4*sigma__e^6-4*gamma^2*sigma__d^2*sigma__e^4-48*sigma__e^2)*sigma__v^4-sigma__e^4*(gamma^4*sigma__d^6*sigma__e^6+4*gamma^2*sigma__d^4*sigma__e^4+8*gamma^2*sigma__d^2*sigma__e^2+48)*sigma__v^2-4*gamma^2*sigma__d^2*sigma__e^8-16*sigma__e^6)*(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^(1/2)+(2*sigma__d^2*sigma__v^8+(12*sigma__d^2*sigma__e^2+8)*sigma__v^6+2*(12+gamma^2*sigma__d^4*sigma__e^4+sigma__d^2*(gamma^2+13)*sigma__e^2)*sigma__e^2*sigma__v^4+8*(3+gamma^2*sigma__d^4*sigma__e^4+(1/2)*sigma__d^2*(gamma^2+6)*sigma__e^2)*sigma__e^4*sigma__v^2+sigma__e^6*(gamma^2*sigma__d^2*sigma__e^2+4)*(gamma^2*sigma__d^4*sigma__e^4+2*sigma__d^2*sigma__e^2+2))*sigma__d*sigma__v^2*gamma)/((sigma__e^2+sigma__v^2)^2*(gamma^2*sigma__d^2*sigma__e^4+4*sigma__e^2+4*sigma__v^2)^2)

(7)

eval(Z_val, gamma = Gamma/sigma__e/sigma__d);

-(1/4)*sigma__d*sigma__v^2*(((-2*Gamma^2*sigma__d^2*sigma__e^2-16)*sigma__v^6+(-6*Gamma^2*sigma__d^2*sigma__e^4-4*Gamma^2*sigma__e^2-48*sigma__e^2)*sigma__v^4-sigma__e^4*(Gamma^4*sigma__d^2*sigma__e^2+4*Gamma^2*sigma__d^2*sigma__e^2+8*Gamma^2+48)*sigma__v^2-4*Gamma^2*sigma__e^6-16*sigma__e^6)*(Gamma^2*sigma__e^2+4*sigma__e^2+4*sigma__v^2)^(1/2)+(2*sigma__d^2*sigma__v^8+(12*sigma__d^2*sigma__e^2+8)*sigma__v^6+2*(12+Gamma^2*sigma__e^2*sigma__d^2+sigma__d^2*(Gamma^2/(sigma__e^2*sigma__d^2)+13)*sigma__e^2)*sigma__e^2*sigma__v^4+8*(3+Gamma^2*sigma__e^2*sigma__d^2+(1/2)*sigma__d^2*(Gamma^2/(sigma__e^2*sigma__d^2)+6)*sigma__e^2)*sigma__e^4*sigma__v^2+sigma__e^6*(Gamma^2+4)*(Gamma^2*sigma__d^2*sigma__e^2+2*sigma__d^2*sigma__e^2+2))*sigma__v^2*Gamma/sigma__e)/((sigma__e^2+sigma__v^2)^2*(Gamma^2*sigma__e^2+4*sigma__e^2+4*sigma__v^2)^2)

(8)

Download expression_to_simplify.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

 

A blue triangle with white text

Description automatically generated

 

Attention Maple enthusiasts! It gives me great pleasure to announce Maple 2024! Maple 2024 brings together a collection of new features and enhancements carefully designed to enrich your mathematical explorations. Maple 2024 is the result of a lot of hard work by a lot of people, and there is far more in it than I can cover here. But I’d like to share with you some of my favorite features in this release.

 

AI Formula Assistant

The AI Formula Assistant in Maple 2024 is undoubtedly the feature that excites me the most, especially considering how often I’m asked the question: 'When will Maple include AI features?' This assistant serves as your new mathematical companion and will change the way you look up and enter formulas and equations. Driven by advanced AI technology, it presents a range of relevant options based on your search query. Alongside suggestions, you'll also receive detailed explanations for each formula and its parameters so you can select the one you need, and then you can insert the formula into your document at a click of a button, as a proper Maple expression.

A screenshot of a computer

Description automatically generated

 

 

NaturalLanguage Package

The Formula Assistant is built on top of the new NaturalLanguage package, which integrates powerful language models like GPT-4 and ChatGPT from OpenAI into Maple. With this feature, you can leverage large language models to process natural language within Maple. Ask the AI to explain concepts, provide additional details, find specific Maple commands, and more. Of course, since this is a Maple package, you can also use it as a basis to build your own AI-powered applications inside Maple. We’re really looking forward to seeing what you will do with it!

 

A close-up of a document

Description automatically generated

 

 

Argument Completion
We’ve had a lot of requests from people who wanted Maple’s command completion features to do even more, and I’m happy to say that Maple 2024 delivers. The new argument completion feature in Maple 2024 is poised to significantly enhance your experience with commands. For many users, including myself, not being aware of all the options a command takes is a challenge, often leading me to refer to help pages for clarification. With argument completion, that's no longer a concern. Just enter the command with the help of the existing command completion feature, then automatic argument completion takes over to guide you through the rest. Give it a try with the 'plot' command!

A screenshot of a computer

Description automatically generated

 

Check My Work

A personal favorite feature that's gotten even better in Maple 2024 is Check My Work. As someone who has tutored students, I vividly recall their stress before exams, often receiving emails and text messages from them seeking last-minute help. At the time, I found myself wishing the students had a way to check their work themselves, so we would all be less stressed! So I was super excited when we added the first Check My Work feature a couple of years ago, and am very happy that it gets better ever year. In Maple 2024, we’ve expanded its capabilities to support problems involving factoring, simplification, and limits.

A screenshot of a computer

Description automatically generated

Scrollable Matrices:
This feature will definitely resonate with many of the engineers in the Maple Primes community. If you're someone who works with worksheets containing large matrices, you've likely wished that you could scroll the matrices inside your document instead of having to launch a separate matrix browser. With Maple 2024, your wish has come true.

 

A white sheet with numbers and lines

Description automatically generated with medium confidence

 

Color Bars

And finally, for those of you who appreciated the addition of color bars in Maple 2023 but wanted to see them extended to more 2D and 3D plots, you'll be delighted to know that this is exactly what we’ve done. We’ve also added new customization options, providing you with greater control over appearance.

 

A close-up of a graph

Description automatically generated

 

This is just a partial glimpse of what's new in Maple 2024. For a comprehensive overview, visit What’s New in Maple 2024.

Any idea why parse("a", 'statement') doesn't return the value of the variable, but only its name?

Running the same command directly works.

Download ParseStatement.mw

Hello everyone!

I wanted maple to give me the conditions when my inequality is fulfilled. But maple gives me exactly the same conditions for x (x here as placeholder) >0 and x<0. That makes no sense. The conditions themselves for x>0 (x<0) are also contradictory and illogical. 

Can someone please explain the solutions or what is wrong? I assume that conditions for the inequality to be fulfilled are missing. But I wanted Maple to give me exactly these conditions. I always use the solve command for this.

Thank you very much!

Best wishes
Hahn 

Maple_Forum_Help_Inequalities.mw

I tried inserting contents of my worksheet here but for some reason procedure test2 does not appear. Therefore, here is a screenshot.

What I would like is for the call r() above to print out 3,2 and then 5.

Basically, I'd like to know how I can call a function that has default parameter values with a value that makes the function use the default parameter value.

In the code above, the variable r is assigned to the return value of test2, which is the function called "inner". The function inner accepts an argument "b" and calls the function "test" passing in this "b" as the second argument. If I don't pass any argument to "inner" then it defaults to Null, which then gets passed to "test".

I want this Null to force "test" to use its default value for parameter "b".

PS As an extra, why does it give a "not able to parse" error when we declare a local inside of a proc as above? Note that I have it commented out. 

Download Curry.mw

Hello

Beginning with a given real fraction, for example 1/12, I would like to find out the following information about its decimal number (here: 0.0833333...):

- decimal number up to period, here 0.08

- the period if exists, here 3

How to program that in Maple?

Thanks a lot for your help!

How 

Where does one find the python module "maple" used to access open maple as in https://www.maplesoft.com/support/help/maple/view.aspx?path=OpenMaple%2fPython%2fAPI ?

Hi:

In a plot title, I want  A^(1)(x) to appear - that is, the first derivative of the function A(x) with the "1" enclosed in brackets because that is the standard notation for derivatives of the special function A.

Alternatively, I'll be happy to use A'(x) - and I know that there are calculus characters on the pallet that are supposed to do that, but they all just become Diff and that is no good for other reasons.

So, here is the closest I've come:

Test:=plots[textplot]([3,3,typeset(A^[1],"(x)")]);

and that almost works, except if I change the [1] to (1), Maple tries to evaluate it as an expression and it disappears. If I change 1 to 2 it works fine, except I want the first derivative.

I've tried quotes, uneval, backquotes and all I get is an error or the quotes showing up as text.

Does anyone know how to do this?

Thank you.

I have the set A := {12, 17, 24, 28} and the set B := {358, 568}. I would like to do the combination (at least that is the name I think I should use) of the two sets to get the following result:

{12358, 12568, 17358, 17568, 24358, 24568, 28358, 28568}

As a bonus, if it's not too complicated, I would like the procedure to see that there are two numbers that have repeating number in them. In fact, the last two elements of the result, namely 28358  and 28568 has two 8. So those last two terms should not appear in the result. We should get only the 6 elements {12358, 12568, 17358, 17568, 24358, 24568}.

There are so many possibilities with Combination and Iterator that I am lost in how to do it. Maybe someone has had to do it before me and have an idea on how to do it.

Thank you in advance for your time.

Mario

For t not equal to nT,   

dS/dt = delta- mu*S+ omega*V; 

 dV/dt = -(omega+mu)*V

For t=nT, 

 S(nT+)=(1-gamma) S(nT);

V(nT+)=V(nT)+ gamma* S(nT),

with the initial conditions  S(0+)=s0

V(0+)=v0

    how to plot the graph with this system of equations,impulsive points and initial conditions  

First 126 127 128 129 130 131 132 Last Page 128 of 2218