Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

 

The recent Maple 2023 release comes with a multitude of new features, including a new Canvas Scripting Gallery full of templates for creating interactive Maple Learn documents.

The Maple Learn Scripting Gallery can be accessed through Maple, by searching “BuildInteractiveContent Maple2023” in the search bar at the top of the application and clicking on the only result that appears. This will bring you to the help page titled “Build and Share Interactive Content”, which can also be found by searching “scripting gallery” in the search bar of a Maple help page window. The link to the Maple Learn Scripting Gallery is found under the “Canvas Scripting” section on this help page and clicking on it will open a Maple workbook full of examples and templates for you to explore.

The interactive content in the Scripting Gallery is organized into five main categories – Graphing, Visualization, Quiz, Add-ons and Options, and Applications Optimized for Maple Learn – each with its own sub-categories, templates, and examples.

One of the example scripts that I find particularly interesting is the “Normal Distribution” script, under the Visualizations category.

 

 

All of the code for each of the examples and templates in the gallery is provided, so we can see exactly how the Normal Distribution script creates a Maple Learn canvas. It displays a list of grades, a plot for the grade distribution to later appear on, math groups for the data’s mean and variance, and finally a “Calculate” button that runs a function called UpdateStats.

The initial grades loaded into the document result in the below plot, created using Maple’s DensityPlot and Histogram functions, from the Statistics package. 




 

The UpdateStats function takes the data provided in the list of grades and uses a helper function, getDist, to generate the new plot to display the data, the distribution, the mean, and the variance. Then, the function uses a Script object to update the Maple Learn canvas with the new plot and information.

The rest of the code is contained in the getDist function, which uses a variety of functions from Maple’s Statistics package. The Normal Distribution script takes advantage of Maple’s ability to easily calculate mean and variance for data sets, and to use that information to create different types of random variable distributions.

Using the “Interactive Visualization” template, provided in the gallery, many more interactive documents can be created, like this Polyhedra Visualization and this Damped Harmonic Oscillator – both from the Scripted Gallery or like my own Linear Regression: Method of Least Squares document.


 

Another new feature of Maple 2023 is the Quiz Builder, also featured in the Scripting Gallery. Quizzes created using Quiz Builder can be displayed in Maple or launched as Maple Learn quizzes, and the process for creating such a quiz is short.

The QuizBuilder template also provides access to many structured examples, available from a dropdown list:


As an example, check out this Maple Learn quiz on Expected Value: Continuous Practice. Here is what the quiz looks like when generated in Maple:


 

This quiz, in particular, is “Fill-in the blank” style, but Maple users can also choose “Multiple Choice”, “True/False”, “Multiple Select”, or “Multi-Line Feedback”. It also makes use of all of the featured code regions from the template, providing functionality for checking inputted answers, generating more questions, showing comprehensive solutions, and providing a hint at the press of a button.

Check out the Maple Learn Scripting Gallery for yourself and see what kinds of interactive content you can make for Maple and Maple Learn!

 

Hi,

I have copied codes from the example of the pendulum to use for a simple case of the motion of a particle in the gravitational field. But when it is time to find v_, I get 0 while in the examples worksheet, it works? I try it in Maple 2022 and 2023 so it is not a question of a version of Maple. It seems that I am missing something. Some help would be appreciated.

Here is my Example_1.mw.

Thank you.

Maple 2023: The colorbar option for contour plots does not work when used with the Explore command. See the example below.

No_colorbar_when_exploring_contour_plots.mw
 

Hi 

I have a question concerning the matrix. Is there any Maple command or function for counting the nonzero elements in any row of a matrix?

Thanks for your help.

Hello

I am running Maple 2023 on a mac M1. When I ask Maple to print a document with 3D figures, only the axes come out. 2D figures come out fine.  If I do the same thing on Maple 2022 on the same machine, there is no problem at all.   

 

Can any one confirm this problem?

many thanks

When we specify a set (a sequence of objects enclosed in curly braces), Maple removes duplicates, since the elements of the set must be unique, that is, they cannot be repeated. See below for 2 examples. With the first example  {a<=b  and  b>=a}, everything is in order, since they are one and the same. But Maple treats the same equality, written in two ways  {a=b, b=a} , as different objects. It seems to me that this is not very convenient:

restart;
{a<=b, b>=a}; # OK
{a=b, b=a}; # not OK
is((a=b)=(b=a)); # not OK

                                                  

 

Hi,

Would  anyone here  be interested in helping me with a genus problem and running the following code and letting me know the genus?  I do not have Maple and have tried other avenues for help without success; the on-line Magma calculator cannot compute it and Mathematica does not have a genus function.  I believe the following is the correct syntax to compute the genus however it may take a while.

 

with(algcurves);

f:=2*z^6 + z^7/2 - (5*z^11)/4 + 4*z^22 + (29*z^34)/10 - z^40 - (13*z^43)/2 + w^38*(z^2 - z^7/4) + 
 w^49*(-z^9 + z^13/4 + 2*z^14) + w^34*((7*z^14)/3 - (3*z^18)/2) + w^47*(z^10/3 + (7*z^11)/4 + (8*z^21)/5) + 
 w^24*(4*z^8 + (4*z^25)/5 - (3*z^27)/2) + w^9*((-6*z^2)/5 - z^6/2 + (7*z^31)/3) + 
 w^16*((7*z^21)/3 + (4*z^27)/5 + (4*z^32)/3) + w^18*(-6*z^14 - 2*z^31 - z^33) + w^3*(2*z^17 + (7*z^34)/2) + 
 w^16*((-3*z^5)/4 - 2*z^36 + z^39/3) + w^50*(-1/3*z^23 - (7*z^40)/2 + z^42) + w^4*((-3*z^30)/2 + (4*z^38)/3 + (8*z^42)/5) + 
 w^33*(-3*z^4 + (8*z^22)/3 - (8*z^43)/5) + w^16*(-1/4*z^26 - (3*z^41)/4 - z^43) + w^48*((2*z^2)/3 + 6*z^26 + (3*z^43)/5) + 
 w^49*(2*z^18 + z^36 - 2*z^44) + w^10*((-2*z^11)/5 - (3*z^26)/2 + z^45) + w^40*(-1/2*z^20 - z^29 + z^46) + 
 w^36*(-4 + 8*z^13 - (7*z^47)/4) + w^14*((7*z^24)/5 - 6*z^32 - 6*z^49) + w^22*(-2*z^27 - (8*z^50)/3) + 
 w^2*((3*z^10)/5 + (7*z^24)/4 - z^50/4);

genus(f,z,w)

perturb_mag_current_density_2.mw

I am trying to calculate the electric field E induced in a vibrating cantilever of conductive material, oscillating in the field of a permanent magnet.  However, I am having some difficulty getting pdsolve to work the way I want it to.  I'm also not sure if the partial differential eqations I derived from Maxwell's equations are correct, or if the boundary conditions for the electric field in the cantilever are correct.  Currently pdsolve gives me no solutions, which makes me think that either my PDEs or my BCs are not correct.  It may be that I need to try some sort of numerical method as well.  I am assuming that the z component of the electric field is just 0.  My third PDE comes from setting the divergence of the electric field to 0.  My first two PDEs come from the vector laplacian and its relation to the divergence and curl:

Laplacian * E = Div(E) -Curl(Curl(E))

The x and y components of this should be my first and second PDE, respectively.  Note that in this equation the divergence of E is 0, and the curl of E is -dB/dt, where B is the magnetic field.

My boundary conditions are simply that the components of the electric field at the surface of the cantilever is always tangent to the surface.

I have tried various simplifications, such as setting the right hand side of the PDEs to 0, and still I don't get any solution.

My question:  Are my PDEs and BCs sensible?  And if so, what do I need to do with pdsolve to get a proper solution?

Hi everyone,

I am trying to find the roots of a system of 3 multivariate polynomials with 3 variables. I have used

G := Basis(P, tdeg(x6, x7, x8))

from the Groebner package and got a Groebner Basis with 29 elements (the length of output exceeds the limit). I want to find roots in the interval [0,1] with x<y<z. Is there a way to find solutions? Some of the polynomials in the Basis are of order 11 and I can't find a single variable polynomial in the basis. Is there an efficiet way to find such roots? Or should I do someting completely different?

Best

fabs

Let us consider the following assumptions:

Any set of binomials $B \in R=K[x_1, \cdots, x_n]$ induces an equivalence relation on the set of monomials in $R$ under which $m_1∼m_2$ if and only if $m_1−tm_2\in \langle B \rangle$ for some non-zero $t\in K$. As a k-vector space, the quotient ring $R/B$ s spanned by the equivalence classes of monomials. Now let $f =x^2−y^2$ be a binomial in $K[x, y]$. Among monomials of total degree three, $x^3$ and $xy^2$, as well as $x^2y$ and $y^3$ become equal in $K[x, y] / \langle f\rangle$.

Why the degree three part in the quotient is two-dimensional with one basis vector per equivalence class?

Also, why does the polynomial $f=x^3+xy^2+y^3$ map to a binomial with a coefficient matrix [2, 1]? I think this matrix arises from the matrix [1, 1, 1, 0] by summing the columns corresponding to $x^3$ and $xy^2$ and those for $x^2y$ and $y^3$. 

How can I implement a simple code to obtain these results in {\tt Maple}?

I am looking forward to hearing any help and guidance.

Thank you in advance

Just installed Maple 2023 on Macbook Air M1.

Maple Tasks dosn't work :-(

/


This post is closely related to this one Centered Divided Difference approximations whose purpose is to build Finite-Difference (FD) approxmation schemes.
In this latter post I also talked, without explicitely naming it, about Truncation Error, see for instance https://en.wikiversity.org/wiki/Numerical_Analysis/Truncation_Errors.

I am foccusing here on a less known concept named "Equivalent Equation" (sometimes named "Modified Equation").
The seminal paper (no free acccess, which is surprising since it was first published 50 years ago) is this one by Warming and Hyett https://www.sciencedirect.com/science/article/pii/0021999174900114.
For a scholar example you can see here https://guillod.org/teaching/m2-b004/TD2-solution.pdf.
An alternative method to that of Warming and Hyett to derive the Equivalent Equation is given here (in French)
http://www.numdam.org/item/M2AN_1997__31_4_459_0.pdf (Carpentier et al.)

I never heard of the concept of Modified Equation applied to elliptic PDEs ; it's main domain of application is advection PDEs (parabolic PDEs in simpler cases).

Basically, any numerical scheme for solving an ODE or a PDE has a Truncation Error: this means there is some discrepancy between the exact solution of this PDE and the solution the scheme provides.
This discrepancy depends on the truncation error, in space alone for ODEs or elliptic PDEs, or in space and time for hyperbolic or advection PDEs.

One main problem with the Truncation Error is that it doesn't enable to understand the impact it will have on the solution it returns. For instance, will this sheme introduce diffusion, antidiffusion, scattering, ...
The aim of the Modified Equation is to answer these questions by constructing the continuous equation a given numerical scheme solves with a zero truncation error.
This is the original point of view Warming and Hyett developped in their 1974 paper.

This is a subject I work on 30 years ago (Maple V), and later in 2010. 
It is very easy with Maple to do the painstaking development that Warming and Hyett did by hand half a century ago. And it is even so easy that the trick used by Carpentier et al. to make the calculations easier has lost some of its interest.

Two examples are given in the attched file
EquivalentEquation.mw

If a moderator thinks that this post should be merged with Centered Divided Difference approximations, he can do it freely, I won't be offended.
 

How to find G(0)??

M2.mw

I simplified my setup as much as possible. Please check lambdas.mw.

While I think I managed to obtain some analytical solutions, they look a bit strange for two reasons:

1) They do not depend on the exogenous parameters as I expected. In fact, mu_jk and mu_ki should only depend on q_0jk and q_0ki, while lambda_jk and lambda_ki should only depend on BigSigma_0jk, BigSigma_0ki, smallsigma_ujk and smallsigma_uki.

2) Strong dependence on q_0jk and q_0ki: if I were to setup these two parameters to zero or to the same value I can't obtain solutions anymore (especially for the lambdas). Does it mean that they are not really "free" parameters?

I noticed that if I combine the two equations from the FOCs of mu_jk and mu_ki into one system (is this even legit?), I get q_0jk = - q_0ki * (lambda_jk / lambda_ki). This is also easy to see if I apply the calibration at the beginning of the script (remove hashtags on all the params with the exception of q_0jk and q_0ki) and then divide lambda_jk by lambda_ki. Why?

I am quite sure that the computations are correct (I checked multiple times), but I am now questioning my setup. In which ways does my setup differ from the one below?

Essentially, I am trying to extend the following problem. As you see below, mu depends only on p_0 (the one-dimensional equivalent of my q_0jk and q_0ki) and lambda depends only on BigSigma_0 and smallsigma_u (the one-dimensional equivalents of my BigSigma_0jk, BigSigma_0ki, smallsigma_ujk and smallsigma_uki).

Thank you.

Given a large number n

When I say n my elements will be {1,2,3,4..n}

take n, k where k will be 2 or 3

Picking up k  element subsets 

In such a way it will return one subset at a time without storing in list to avoid memory usage more 

A for loop like 

Some place within the code where 

 I will be able to perform my task using  each 2 or 3 element subset

and later forget about it

If we go for function may be we need to go for recursive function in such a way that at each call of function it will produce one 2 element subset I do my work with that and then do my next call of the same function again

Kind help please 

First 97 98 99 100 101 102 103 Last Page 99 of 2097