## Question about product/ mul functions [mul(functio...

Hi!

I am trying to determine the weights of a Gauß quadrature rule, the code I currently have is this:

for i from 1 to n do
RekursivesZwischenergebnis:=1;
for j from 1 to n do
if i <> j then
RekursivesZwischenergebnis:= RekursivesZwischenergebnis*((x-GaußKnoten[j])/(GaußKnoten[i]-GaußKnoten[j]))
end if;
end do;
GaußGewichteAlt[i]:=int(RekursivesZwischenergebnis,x=-1..1);
end do;

The code works, is inefficient however. I want to use the product or mul function, however I dont know how to tell Maple not to multiply

((x-GaußKnoten[j])/(GaußKnoten[i]-GaußKnoten[j]))

if j=i.  mul(function(j), j=1..n,j<>i) doesnt work. Any efficient suggestions?

## C compiler optimization flag -01 -- -03...

Hello,

I'm compiling a maple procedure to a C code with the Compiler command. I was wondering if it is possible to change the optimization flag, for example -03  for gcc? Is there a way to maybe change a file in the Maple directory that specifies the compiler options?

## animate images/create movi...

with(IterativeMaps): with(ImageTools):

BP := proc(f, S, I, m, M, xm, xM)
local L;
L := Bifurcation([x], f, S, m, M, xmin=xm, xmax=xM, height=800, width=1300, iterations=I+500):
ArrayTools:-Dimensions(L):
ColouringProcedures:-HueToRGB(L):
Embed(L);
L:
end proc:

F := []:
f := [sign(r)*ln(abs(r))*cot(x)*(log[2+abs(r)](abs(x)) - x*sin(x))]:

F := [op(F), BP(f, [0.1], 10000, -10, 10, -15, 15)]:
F := [op(F), BP(f, [0.2], 10000, -10, 10, -15, 15)]:

F := [op(F), BP(f, [0.3], 10000, -10, 10, -15, 15)]:

F := [op(F), BP(f, [0.4], 10000, -10, 10, -15, 15)]:

I was trying to create some images of some bifurcations. I can't seem to create an animation from the images.

Also, Embed works great but each call to BP overwrites the previous image(rather than creating a new image)... Preview works but doesn't scale the images up properly.

## How can type limit as mathtype?...

How can type limit proc() and use print to export expression as mathtype?

 (1)

## StringTools Questions (Maple 2020)...

I was reviewing the StringTools features and I'm curious about some parts of it.

(1)     Here is a section from the StringTools[Length] help topic:

Notice that, like length, the Length command counts the number of bytes in the string, not the number of characters.
Length("d303251cembre");
9

When I execute the command in Maple 2020, it actually returns 13 instead of 9.  The length command also returns 13.  I do not understand the information from StringTools[Length] help.  I looked back to Maple 18 and it did not include these lines in the help topic.

(2)   I am confused about the rng argument in StringTools commands of LowerCase, UpperCase and OtherCase.  It seems that these commands consider -2 as the last character in the string.  The help topic shows this:

UpperCase("abcdefghij", 3 .. -2);
"abCDEFGHIJ"

I'm expected to use -1 as the last character such as:

S:="This is a test";
S[-4..-1];
"test"

(3)  Next, I looked at StingTools[SubString].  The help topic gives the following example:

SubString("abcdef", -5 .. -3);
"bcd"
That works like I expected.  So, -1 is the last character for SubString.

Thanks,
Lee

## Maple 2020 What's New example gives incorrect resu...

Hello,

I have installed Maple 2020 and I tried some examples of the new capabilities of command is:

restart;
is(0 <= (a - b)^2 + (c - d)^2) assuming real;

It gives FAIL instead of true,

Similarly the simpler example

is(x = 0) assuming (0 < abs(x));

also gives FAIL incorrectly.

Perhaps, does this problem relate to a problem with calling SMTLIB package?

Best Regards,

## How can I display the graph this 3 dimension curve...

Here is the deal, I made a programm so as to display the curve of a ping pong ball. But Maple isn't able to solve the 3 ODE system analytically. I then decided to make Maple solve them numerically and it actually works, great. However, there's still a big problem : how can I display the graph of the solutions ? I'd like you to give your opinion on a way to solve the problem. Thanks ;)

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)
 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)
 >
 (15)
 >
 (16)
 >
 (17)
 >
 (18)
 >
 >
 >

## Reducing Run-time for solving a nonlinear ODE...

Hi

I want to employ FDM to solve nonlinear ODE. Since large expressions in terms of s[1] are generated, the program lose its efficiency for N>6 (It requires long run-time). Please amend the program, if it is possible to reach more precision for N>10. Moreover, is there a Maple command to dsolve this ode?

Thanks alot

restart;

sy := 2400.:

Hp := 0.1e9:

P := -900.:

a := 20.:

c := 21.:

N := 6:

s[0] := P:

h := (c-a)/N:

Et := (r*(diff(sr(r), r))-sy)/Hp:

Er := (sy-r*(diff(sr(r), r)))/Hp:

ode := simplify(Er-Et-r*(diff(Et, r))*(1+(diff(Et, r))*r/(2+4*Et))):

ode:=subs(diff(sr(r), r, r) = (s[k+1]-2*s[k]+s[k-1])/h^2, diff(sr(r), r) = (s[k+1]-s[k-1])/(2*h), r = h*k+a, ode):

for k to N-1 do

s[k+1] := solve(ode, s[k+1])[1]

end do:

s[1] := fsolve(s[N] = -200., s[1] = -900 .. -100);

plots[pointplot]([seq([h*k+a, s[k]], k = 0 .. N)]);

## how to plot fft?...

Hi, i have accelerometer readings saved as a CVS file., these file contains time data, then the accelerometer data in g's. (recorded at 700hz)

I need to analyse the data for hand-arm vibration and be able to plot the frequency/time.

i have managed to fft the data but im struggling to plot this.

thanks for the help!!!

## Divergence Tensor...

I am trying to calculate the divergence of a tensor field (in this specific case of a cauchy stress tensor (tensor of second order)). I am trying to use the DifferentialGeometry as well as the tensor package. I tried doing it somewhat similar to calculating the divergence of a tensor of first order, which worked fine with this code:

```>with(DifferentialGeometry): with(Tensor): with(Tools): >DGsetup([x,y,z],T); >v := DGzip([v__x(x,y,z,t),v__y(x,y,z,t),v__z(x,y,z,t)],[D_x,D_y,D_z],"plus"); >Divergence(v);```

However when I tried something similar with a tensor of second order it returened an error:

```>sigma := evalDG(sigma__11 * D_x &t D_x + sigma__12 * D_x &t D_y + sigma__13 * D_x &t D_z                  + sigma__21 * D_y &t D_x + sigma__22 * D_y &t D_y + sigma__23 * D_y &t D_z                   + sigma__31 * D_z &t D_x + sigma__32 * D_z &t D_y + sigma__33 * D_z &t D_z); >Divergence(sigma); Error, (in DifferentialGeometry:-Tools:-Divergence) expected argument to be a vector field. Received _DG([["tensor", T, [["con_bas", "con_bas"], []]], [`...`]])```

Is there a different command in order to compute the divergence of a tensor of second order compared to the command for a tensor of first order or am I making an enitrely different mistake?
Would really appreciate some help

## Images on Maple Primes....

Images posted on Maple Primes, if too large, are scaled down to match the post size. Is there a way to attach a scroll bar to allow full scale viewing instead?

## what dose the results mean for a derivative of a f...

Hello!

I have a question about a calculation of a differential of a functional.

I think dW(Y(t), t)/dt equals W  +W'Y .

There is some problem when I try to calculate it in Maple as below:

diff(w(y(t), t), t);
/ d      \
D[1](w)(y(t), t) |--- y(t)| + D[2](w)(y(t), t)
\ dt     /
I don't know it right or wrong; and  what does the D[1],D[1] mean?

I hope i can get your help!

Thanks!

 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 (1)
 >

 >
 (2)
 >

 >
 (3)
 >
 (4)
 >
 >

## How to do a nested collect...

Second Try:

f:= c/(c - 1) - c*(Pi^2 - 12*ln(c))*(1 + c)/(12*(c - 1)^3*n) + (((144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24))*c)/(288*(c - 1)^5*n^2)

This expression is already arranged with respect to n. However, the nominator of each term is not collected with respect to c. So naturally I thought

collect(f,[n,c]) or collect(f,[n,c],simplify)

would work. But now he messes up the nominator i.e. he can not factor and simplify. Note that the single variable case collect(f,n,simplify) works in not messing up, but this is not what I want, since the nominator of each n-term is not in c-collected form.

collect(f,[n],u->collect(u,[c],...))

also does not work, since he messes up again.

By c-collected form I mean the following:

The n^0 and n^{-1} term are actually fine. The factorization in the second term is ok. But for the third term

f2:=(144*c^3 + 1584*c^2 + 1584*c + 144)*ln(c)^2 - 24*Pi^2*(1 + c)*(c^2 + 10*c + 1)*ln(c) + (-96*c^3 - 288*c^2 + 288*c + 96)*Zeta(3) + Pi^2*((Pi^2 + 24)*c^3 + (11*Pi^2 + 72)*c^2 + (11*Pi^2 - 72)*c + Pi^2 - 24)

what I mean by c-collected is

collect(f2,c,simplify)

This is the nominator of the n^{-2} term.

I sort of managed by the following to procedings:

of:=[op(f)];
add(`~`[`/`](collect~(numer~(of), c, factor), ` \$`, denom(of)));

but the first one seems cumbersome for such a trivial thing that should be handled by collect. It also does not factor out the e.g. 12*ln(c)-Pi^2. This seems to be a general behaviour

g:=a*x*(x+1);
collect(g,x) does not factor out the a as in a*(x^2+x).

With the second method I'm more or less happy, but I didn't manage to completely collect the c terms i.e. the n^{-1} term is still c*(c+1) and not c^2+c.