Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have been try to code the 

mdl:-Fit(x, y, opts)
command in Deep learning package

But i feel new to that command I am making errors 

Can I get a small toy code how to call it and its output on train and test

so that i could learn

kind help please

Hello,
 i want to increase my value monotonically  . but i don't want to do it like sequence. how can i write code.

for example my value ..starts at 0...to some values i just want to increase.
help me plz

Please help me how to plot the following Chemotaxis System in Maple. Great Thanks

PDE 1= diff(p(x,t),t)-diff(p(x,t)*q(x,t),x)=D*diff(p(x,t),x,x)

PDE 2 = diff(q(x,t),t)-diff(p(x,t),x)=0

with the initial conditions

p(x)=0.5+1/(1+exp(2*(x-30)))

and

p(x)=0.5+1/(1+exp(-2*(x-30)))

and the boundary conditions

p(0, t) = 1.5, p(1, t) = 0.5

and

q(0, t) = 0.5, q(1, t) = 1.5

Stupid question, but how do I get the code on the math apps CaesarCipher from the help page?  I see the variable cipher but it's content is a mystery.

(Sorry guys, I changed the title to better reflect the content of the question and it bumped back up the top)

This happened on Windows 10 clicking on *.mws documents while Maple 2023 was not running.

My observations with one document (I do not have others at hand at the moment):

No freeze when Maple is already running.

No freeze when the startup page (Start.mw) is disabled.

Older versions opened in Windows file explorer with “right click and open with” did not show this behavior.

Since there are ways to open such old documents, my intention is to document my observations and to find out if others can reproduce it. If not, my setup might differ from default or the file has an issue.

Here is a demonstration involving two decision problems (where evalf is applied to the output for better readability): 
 

interface(version);

restart;

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

(1)

RealDomain:-solve({x*y = 3*z^5+4, x^2*y^2-3*x^2*z^2 = 1., x^3+y^3+z^3 = 12})

{x = 2.948903259, y = -2.257458014, z = -1.288554964}, {x = -.7294615910, y = 2.402430460, z = -1.139060479}, {x = .6177631401, y = 2.331476708, z = -.9687540923}, {x = 2.113678892, y = 1.450731881, z = -.7917893433}

(2)

SMTLIB:-Satisfy({x*y = 3*z^5+4, x^2*y^2-3*x^2*z^2 = 1, x^3+y^3+z^3 = 12}, showsmtlib)

(declare-fun x () Real)
(declare-fun y () Real)
(declare-fun z () Real)
(assert (and (= (* x y) (+ (* (* z z z z z) 3) 4)) (= (+ (* (* x x) (* y y)) (* (* (* x x) (* z z)) (- 3))) 1) (= (+ (* x x x) (* y y y) (* z z z)) 12)))
(check-sat)
(exit)

 

Error, (in SMTLIB:-smtlib_execute) external linking: error loading external library mplsmtlib.dll: Ҳ���ָ����ģ�顣

 

RealDomain:-solve({(x^2-2*y*z)*(x^3-y+z) = 0, x^4-y*z^3 = 2., z^4+x^3-2*x*y+3*y*z = 0})

{x = -1.130532018, y = -.1818551573, z = 1.263080805}, {x = 1.123233144, y = .4467032548, z = -.9704268675}, {x = 1.250562423, y = 2.517328867, z = .5615663246}, {x = 2.489770959, y = 16.73009962, z = 1.296110460}, {x = -1.336432744, y = -.7736167557, z = -1.154352246}, {x = 1.209937072, y = 1.655230257, z = .4422187526}

(3)

SMTLIB:-Satisfy({(x^2-2*y*z)*(x^3-y+z) = 0, x^4-y*z^3 = 2, z^4+x^3-2*x*y+3*y*z = 0}, showsmtlib)

(declare-fun x () Real)
(declare-fun y () Real)
(declare-fun z () Real)
(assert (and (= (* (+ (* x x) (* (* y z) (- 2))) (+ (* x x x) (* y (- 1)) z)) 0) (= (- (* x x x x) (* y (* z z z))) 2) (= (+ (* z z z z) (* x x x) (* (* x y) (- 2)) (* (* y z) 3)) 0)))
(check-sat)
(exit)

 

Error, (in SMTLIB:-smtlib_execute) external linking: error loading external library mplsmtlib.dll: Ҳ���ָ����ģ�顣

 

?SMTLIB:-Satisfy


 

Download SMTLIB[Satisfy].mw

As you can see, the SMTLIB:-Satisfy command fails to work in Maple 2023, and I have to install the Visual Studio 2013 (VC++ 12.0) manually. But unfortunately, even if I have installed the vcredist_x64.exe beforehand, the computation still cannot be done in 1000 seconds! (Please note that I just require one real instance rather than all solutions.) Does anyone know why? 
By the way, since the default SMT solver (in Maple 2023) is Z3, will another SMT solver (like cvc5) be supported in future Maple releases?

Converting index expressions to atomic worked.
I then tried to uncheck atomic in the context menu which did not work.

I opened a new worksheet to try it again but now conversion to atomic disappeared from the menu

no_conv_to_atomic.mw

 

A restart of Maple did not bring convert to atomic back. Any idea why this happened and how to restore Maple?

Hi,

i use an OpenMaple environment for my academic activity. Especially for plotting of results outside of Maple GUI. Until version 2023 everything was nice and working. But in 2023 calling of Maplets kills Maple 2023 and of course my jobs. Example to try:

#include <stdio.h>
#include <stdlib.h>

#include "maplec.h"

 /* callback used for directing result output */
static void M_DECL textCallBack(void *data, int tag, const char *output)
{
   printf("%s\n", output);
}

int main(int argc, char *argv[])
{
   char err[2048];  /* command input and error string buffers */
   MKernelVector kv;  /* Maple kernel handle */
   MCallBackVectorDesc cb ={textCallBack,
      0,   /* errorCallBack not used */
      0,   /* statusCallBack not used */
      0,   /* readLineCallBack not used */
      0,   /* redirectCallBack not used */
      0,   /* streamCallBack not used */
      0,   /* queryInterrupt not used */
      0    /* callBackCallBack not used */
   };
   ALGEB r, l;  /* Maple data-structures */

   /* initialize Maple */
   if((kv=StartMaple(argc, argv, &cb, NULL, NULL, err))==NULL) {
      printf("Fatal error, %s\n", err);
      return(1);
   }
   r=EvalMapleStatement(kv, "with(Maplets[Elements]): SimpleMaplet:=Maplet([Button('Close', Shutdown())]): Maplets[Display](SimpleMaplet):");
   StopMaple(kv);

   return(0);
}

Working in Maple 2020-2022, crashes in 2023

After a long investigation i found that the problem focuses in maple.dll.

It is only for me, or it is a general bug?

Update:

The newest Maple Update 2023.1 still have this problem ...

The newest Maple Update 2023.2 still have this problem ...

Will be this error sometime fixed?

The QuantifierElimination package has been added in Maple 2023.
However, in the following example, the old (yet not obsolete) RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination command can solve the problem, but strangely, the new QuantifierElimination:-QuantifierEliminate command simply returns an error. 
 

restart;

RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(:-`&A`([x, y, t]), :-`&implies`(:-`&and`(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho), output = rootof)

rho <= 1/3

(1)

QuantifierElimination:-QuantifierEliminate(:-forall([x, y, t], :-Implies(:-And(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho)))

Error, (in CADCell:-CCHILD) intervals the same at this precision

 

Digits += 5:

RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(:-`&A`([x, y, t]), :-`&implies`(:-`&and`(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho), output = rootof)

rho <= 1/3

(2)

QuantifierElimination:-QuantifierEliminate(:-forall([x, y, t], :-Implies(:-And(x^3+y^2-x = t, t^2 = 4/27, t < 0), x^2+y^2 >= rho)))

Error, (in convert/RootOf) there is no root of 3*_Z^2-1 in -348986823692397556565591/604462909807314587353088 .. -174493411846198778282755/302231454903657293676544

 

NULL


 

Download QEbug.mw

Code: 

QuantifierElimination[QuantifierEliminate](forall([x, y, t], Implies(And(x^3 + y^2 - x = t, And(t^2 = 4/27, t < 0)), x^2 + y^2 >= rho)));

So, is there any bug in Maple's QuantifierElimination package?

Here is a notional example of a user defined  Probability Distribution:

  • One of the "attribute" or "property" (sorry but I don't know the correct word to use) in any known distribution (that is already implemented in Maple) is Parameters: an example is  provided for a Gaussian RV.
     
  • In a first stage I define a simple Distribution named MyDist and declare X as a random variable of distribution MyDist.
     
  • Then I decide to complete the definition of MyDist by adding the "property" Parameters.
    I get an error I don't know how to get rid of.

Does anyone has any idea to fix that ?

PS: I browse the Statistics library to try and understand how this "property" is defined for a known distribution but I couldn't find any clue.

Thanks in advance.

restart

with(Statistics):

G := RandomVariable(Normal(a, b)):

attributes(G)[3]:
exports(%);
(attributes(G)[3]):-Parameters;

Conditions, ParentName, Parameters, CharacteristicFunction, CDF, CGF, HodgesLehmann, Mean, Median, MGF, Mode, PDF, RousseeuwCrouxSn, StandardDeviation, Support, Variance, CDFNumeric, QuantileNumeric, RandomSample, RandomSampleSetup, RandomVariate, MaximumLikelihoodEstimate

 

[a, b]

(1)

MyDist := (mu, Sigma) -> Distribution(Mean=mu, Variance=Sigma):

X := RandomVariable(MyDist(m, V));
(Mean, Variance)(X);

_R1

 

m, V

(2)

MyDist := (mu, Sigma) -> Distribution(Mean=mu, Variance=Sigma, Parameters=[mu, Sigma]):

Y := RandomVariable(MyDist(m, V));

Error, (in Statistics:-Distribution) invalid input: too many and/or wrong type of arguments passed to NewDistribution; first unused argument is Parameters = [m, V]

 

m, V

(3)

 

Download RandomVariable_Parameters.mw

I need help to solve this ODE,

I didn't get series values F(k+3),Theta(k+2),phi(k+2),error comes in summation values.and

How to find the unknown parameters A,B,C.

 TLF.mw

Maple code for solving system of ODE using forward-backward sweep method.

While working a test workbook in Maple 2023 - added a file went away for a while and came back and started adding code to the workbook when I suppose it did an autosave and this error came up 4x in a row. 

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?

First 18 19 20 21 22 23 24 Last Page 20 of 2097