8 years, 24 days

## How to Save Modified Maple Procedures to...

Maple 2024

Hello,

I'm having trouble updating an old Maple package to work with the latest version of Maple. In the package, there are several commands that modify predefined procedures and then rename them (see the example below). I need to save all these new procedures to a text file so I can further modify them and better understand their functionality. How can I achieve this?

`d_remset := subs(`class`=`d_class`,`remseta`=`d_remseta`,`premas`=`d_premas`,op(`remset`)):`

remset is a procedure previously defined.

Many thanks.

Obs.: If you have a better idea on how to deal with the procdures, please let me know.

## Help to understand the use of expand, su...

Maple

Hello

I am struggling to translate an old Maple V3 package to work with the latest version of Maple. Although I have received help from members of this list and managed to resolve some problems on my own, I am at a loss as to how to fix the following Maple code.

```# differentiation
ddf := proc(f)
local j;
print(f):
sum('expand(eval(subs(diff = 0,diff(f,indets(f)[j])))*(indets(f)[j]))','j' = 1 .. nops(indets(f)))
end proc:```

Suppose that

```f:=x;

ddf(f);
x

Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation
```

Any help in figuring out what the author was going for would be really appreciated.

Obs.: An example taken from the old Maple v3 help file.  If f:=z^2+y, the output is 2*z*z'+y'.

## How to create auxiliary variables (maple...

Maple 2024

Hello

In my last question, I asked for help converting an old Maple V3 code to the latest version. With the help of  @Rouben Rostamian, I managed to get most of the procedures working again. Unfortunately, there is one procedure that I cannot figure out how to convert. Below is the procedure, along with an example that works and one that does not.

```saturbasis := proc(ps,js,ord)
local qs,gb,zz,j,aux;
print("ps = ",ps):
print("js = ",js):
print("ord = ",ord):
if js <> {} then
qs := [op(ps),'`@z`.j*js[j]-1' \$ ('j' = 1 .. nops(js))];print("qs = ",%):
zz := ['`@z`.(nops(js)-j+1)' \$ ('j' = 1 .. nops(js))];print("zz = ",%):
aux:= [op(zz),'ord[nops(ord)-j+1]' \$ ('j' = 1 .. nops(ord))]:print("aux = ",aux):
gb := grobner['gbasis'](qs,aux,'plex');
qs := [];
for j to nops(gb) do
if {op(zz)} minus indets(gb[j]) = {op(zz)} then
qs := [gb[j],op(qs)]
fi
od
else qs := ps
fi;
qs
end proc:```

First example:

```ps:=[2*x1^2 + 3*x2^2 + 4*x1 + x2, x1*x3 - 3*x2 - 1, 2*x1*x4 + 3*x2 + 1]:
js:={x1}:
ord:=[x1, x2, x3, x4]:

saturbasis(ps,js,ord);
[    2       2
"ps = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1,

]
2 x1 x4 + 3 x2 + 1]

"js = ", {x1}

"ord = ", [x1, x2, x3, x4]

[    2       2
"qs = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1,

]
2 x1 x4 + 3 x2 + 1, @z x1 - 1]

"zz = ", [@z]

"aux = ", [@z, x4, x3, x2, x1]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
[    2       2
[2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, x2 x3 + 2 x1 + 4,

]
2 x4 + x3]

```

Second example:

```ps:=[2*x1*x4^2 + 3*x1 + x4 + 6, x3*x4^3 + 2*x4^4 - 9*x3 - 18*x4, 2*x2*x4^2 + 3*x2 - 4*x4 + 1]:
js:={2*x4^2 + 3, x4^3 - 9}:
ord:={2*x4^2 + 3, x4^3 - 9}:

saturbasis(ps,js,ord);
[       2
"ps = ", [2 x1 x4  + 3 x1 + x4 + 6,

3       4                        2                  ]
x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1]

/    2        3    \
"js = ", { 2 x4  + 3, x4  - 9 }
\                  /

/    2        3    \
"ord = ", { 2 x4  + 3, x4  - 9 }
\                  /

[       2
"qs = ", [2 x1 x4  + 3 x1 + x4 + 6,

3       4                        2
x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1,

/    2    \           /  3    \    ]
@z \2 x4  + 3/ - 1, 2 @z \x4  - 9/ - 1]

"zz = ", [2 @z, @z]

[            3          2    ]
"aux = ", [2 @z, @z, x4  - 9, 2 x4  + 3]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
Error, (in grobner:-gbasis) invalid input: Groebner:-Basis expects its 2nd argument, tord1, to be of type Or(ShortMonomialOrder,name,MonomialOrder), but received plex(2*`@z`,`@z`,x4^3-9,2*x4^2+3)

```

I suppose that the "." is no longer used as it was back in Maple V3, and it seems that the author of the procedure was creating extra auxiliary variables to solve the problem.

What did the author use @ for creating the variables?  And how to fix the error?

Many thanks

## Help to convert a Maple V3 package to M...

Maple 2024

Hello

I need to use the Ritt algorithm to find the characteristic sets of a set of differential equations. In the past, it seems there was a Maple package by D. Wang available through Maple Applications, but this no longer appears to be the case. I managed to download an old set of files from the author’s site, dated February 1996, which is a Maple V3 package. The instructions in the Readme file mention that using the provided Makefile, an m-file containing all the functions will be created, which can then be loaded into Maple. Unfortunately, running `make -f Makefile` did not create anything, so I am wondering if I could get some assistance on how to convert this package to something compatible with the latest Maple releases.

The source (txt) files are structured as follows:

Example:

2) Definition of the User functions - something like

```dcharsets[dcharset] := proc() `charsets/d_charset`(args) end:

dcharsets[dmcharset] := proc() `charsets/d_mcharset`(args) end:

dcharsets[dcs] := proc() `charsets/d_charser`(args) end:

dcharsets[dmcs] := proc() `charsets/d_mcs`(args) end:

dcharsets[dics] := proc() `charsets/d_ics`(args) end:```

and

```read `charsets.m`:

# set of non-zero remainders of d-polys in ps wrt d-ascending set as
#       user level function
`charsets/d_remset` :=

subs(`charsets/class`=`charsets/d_class`,
`charsets/remseta`=`charsets/d_remseta`,
`charsets/premas`=`charsets/d_premas`,op(`charsets/remset`)):```

and lots of Maple procedures - Example below

````charsets/d_charset` := proc(ps,lst,medset)

....

end:```

the source file ends with the following lines.

```read dhelp;
save `dcharsets.m`:
quit```

Many thanks

Note: Before posting this question here, I tried to contact the author but received no response.

## How to use animate (or explore) function...

Maple 2024

Hello

Here is the ODE

`sys := {diff(w(t), t) = y(t)*z(t), diff(x(t), t) = a*w(t), diff(y(t), t) = x(t)*z(t) + w(t), diff(z(t), t) = -x(t)*y(t), w(0) = w0, x(0) = x0, y(0) = y0, z(0) = z0}`

with initial parameters a=2, w0 = -0.727367040, x0 = -0.728244724, y0 = -0.237753623 and z0 = 0.014225402.

With these parameters I have no problem to plot the solution.

```nsys := subs({a=2,w0 = -0.727367040, x0 = -0.728244724, y0 = -0.237753623, z0 = 0.014225402},sys);

numsol := dsolve(nsys, numeric, method = rkf45);

vars:=[x,y,z,w];

with(plots):

col := [red, magenta, cyan, blue]:
display(
seq(
plots:-odeplot(numsol, [t, vars[i](t)], t=0..3, color=col[i], legend=vars[i](t))
, i=1..numelems(vars)
)
)
```

How to use animate (or explore?)  with a slider for each parameter (a,x0,y0,z0,w0)? And if I want to add a tfinal as well for the simulation (in place of 3)? ( I am newbie as far as using plot and related functions in Maple).

Many thanks.

 1 2 3 4 5 6 7 Last Page 1 of 15
﻿