Maple 2019 Questions and Posts

These are Posts and Questions associated with the product, Maple 2019

Hello, I have a question about converting an output of a expression into another.

solve({-1 < x, 0 < 2*x/(x^2 - 1), x < 1}, {x})

This is my expression which evaluates into: solve({-1 < x, 0 < 2*x/(x^2 - 1), x < 1}, {x}). Which is correct but I would like it to be a classic range, more precisely (-1,0).

Is there a command to do that?

Thanks,

David.

I compared the numerical value of an integral expression in Gradshteyn and Rhyzhik (8.431.5) for the BesselI(v,z) function to the BesselI(v,z) function in Maple 2019.2 and got different answers.  The GR expression is the difference of two integrals and it looks like Maple only evaluates the first integral, which is correct only if the order v is an integer.  Please see the attached.

BesselI.mw

Hello,

I am trying to pass the graphics to .txt format so that I can plot them in Origin (OriginLab).

npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    PA[i] := x[i](t);
    printf("%e %e\n", t[i], PA[i]);
    fprintf(fd, "%e %e\n", t[i], PA[i]);
end do;
0.000000e+00 

Error, (in fprintf) number expected for floating point format
fclose(fd);
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    PB[i] := x[i + n](t);
    printf("%e %e\n", t[i], PB[i]);
    fprintf(fd, "%e %e\n", t[i], PB[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    qA[i] := x[i + 2*n](t);
    printf("%e %e\n", t[i], qA[i]);
    fprintf(fd, "%e %e\n", t[i], qA[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    qB[i] := x[i + 3*n](t);
    printf("%e %e\n", t[i], qB[i]);
    fprintf(fd, "%e %e\n", t[i], qB[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    Tg[i] := x[i + 4*n](t);
    printf("%e %e\n", t[i], Tg[i]);
    fprintf(fd, "%e %e\n", t[i], Tg[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format
npontos := 10;
dt := 0.02;
fd := fopen("out.txt", WRITE);
for i from 0 to npontos do
    t[i] := i*dt;
    Ts[i] := x[i + 5*n](t);
    printf("%e %e\n", t[i], Ts[i]);
    fprintf(fd, "%e %e\n", t[i], Ts[i]);
end do;
fclose(fd);
0.000000e+00 

Error, (in fprintf) number expected for floating point format

trabalho_final_2019.mw

I would like to know how to create a group with some elements (numbers) {1,2,4,...} with a defined operation on it like X_42 (modular  multiplication by 42).

What is the command to yield the expansion of Z^N in terms of x and y.

Z complex = x+iy,

N integer >1

e.g. Z^2 = x^2 - y^2 + 2.i.x.y

 

could you just delete the post !!!!!!!!!!!!!!!!!!!!!!!!!!!x!xxxx!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Hi,

Let's take the last example (Maple 2019) given in help[sparsematrixplot] (representation of the adjacency matrix of a graph).
Vertices of this graph are labelled 1, 2, ...20.
Suppose I change these names as a, b, ...t.
I would like the tickmarks of the sparsematrixplot output match the names of the vertices of the graph, and not the integers 1, 2, ..20

I tried this:
S := [$1..20] =~ StringTools:-Char~(96 +~  [$1..20]);
plots:-sparsematrixplot(..., tickmarks=[S, S])

But the only the tickmars of the columns are changed, not those of the rows.

Is it possible to change the names of the tickmarks ?


Thanks in advance.

Hello,

Please, what is going wrong that it is not graphing the ODE system solution?

eqs := seq(eq[i], i = 1 .. 6*n);
cis := seq(ci[i], i = 1 .. 6*n);
sol := dsolve([eqs, cis], numeric, stiff = true, output = listprocedure);
for i to n do
    graf1[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = black);
end do;
for i from 11 to 2*n do
    graf2[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = blue);
end do;
for i from 21 to 3*n do
    graf3[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = green);
end do;
for i from 31 to 4*n do
    graf4[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = red);
end do;
for i from 41 to 5*n do
    graf5[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = pink);
end do;
for i from 51 to 6*n do
    graf6[i] := odeplot(sol, [t, x[i](t)], 0 .. 5, color = orange);
end do;

display(seq(graf1[i], i = 1 .. n));
display(seq(graf2[i], i = 11 .. 2*n));
display(seq(graf3[i], i = 21 .. 3*n));
display(seq(graf4[i], i = 31 .. 4*n));
display(seq(graf5[i], i = 41 .. 5*n));
display(seq(graf6[i], i = 51 .. 6*n));


trabalho_final_2019.mw

BIOMAT_project.mw

 

I am looking at an SIR model and an adapted model that has a vaccine for measles. I would like to use Maple to plot the difference between the two models. 

All the work that's been done so far is in the attached file. I would like to have multiple graphs, changing the starting values but I just need the general idea of how to do this first. 

Hi

I'm trying to rearrange a transfer function to get my s^2 term with other specific terms . Below is the denominator of the transfer function. I know that my goal is to get (Izz*u)/m for the s^2 term, so I divide by Df*Dr*(a+b)*u*m, as shown below.

However, if we look at the s^2 terms for now, the equation should be further simplified leaving me with simply (Izz*u)/m, but Maple doesn't want to do this for some reason, and if I use simplify on the above expression it tries to expand everything again, and forgetting about my collect(fun, s).

 

Is there any way to get around this?

 

Many thanks

 

Hi, 

This is a question more or less related to this one Is it possible to define variables with unusual na... but I think it's better to open a new thread. If some think otherwise, please feel free to displace it to the link above.

I want to relabel the vertices of a graph by using special characters.
It happens that this works perfectly if I do not impose the style of the drawing but that it doesn't if I set, for instance, spring=style.
In the attached file you will see that the subsitution of the old vertex names by the new ones doesn't work if apply it directly on the many operators of the PLOT command contains.

Is this behaviour fixed in more recent versions of Maple or it's still present?


Strange-Behaviour-with-SpringStyle.mw

I have a region that can be graphed by A := plots:-inequal([evalc(abs(z)) < 3, evalc(1 < abs(z - 1))], x = -5 .. 5, y = -5 .. 5)

From there, I need to use the transformation 

M := (3 + sqrt(5))/2*(z - x1)/(z - x2) where x1 := (9 - sqrt(45))/2 and x2 := (9 + sqrt(45))/2 

 

How do I do this? Do I need to extract data points from the first graph? Is there an easier way to do this? 

The Library:-RedefineTensorComponent in the physics package has got some serious problems, I guess in the update. It is not assigning the components at the right location for a tensor of rank 4 and above. It is working for tensors of rank 1, 2 and 3. Can someone please look into the issue and help out?

I am attaching the code with an example to indiacate the problem. Redefine.mw

Hi,

Defining variables named H2 or O2 doesn't pose any problem (H__2 for instance), but could it be possible in Maple 2019 to define a variable named H2O2 ?

Thanks in advance

Hi there!

Sorry to ask, but I don't know how I can solve it in a smart way. I want to take the covariant derivative of a specific vector, whose components are specifically defined, which can be constant or some functions of the coordinates. But, as soon as I define that specific vector, the covariant derivative fails to compute, saying there are "too many levels of recursion". Let me show what I mean.

I have these two attempts to get this:

 

First attempt

 

restart

with(Physics)

Setup(mathematicalnotation = true)

Coordinates(X = spherical)

{X}

(1.1)

Parameters(k)

{k}

(1.2)

Setup(metric = {(1, 1) = a(t)^2/(-k*r^2+1), (2, 2) = (a(t)*r)^2, (3, 3) = (a(t)*r*sin(theta))^2, (4, 4) = -1})

[metric = {(1, 1) = a(t)^2/(-k*r^2+1), (2, 2) = a(t)^2*r^2, (3, 3) = a(t)^2*r^2*sin(theta)^2, (4, 4) = -1}]

(1.3)

Define(b[mu])

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(1.4)

NULL

Define(Db[nu, mu] = D_[nu](b[mu](X)))NULL

{Physics:-D_[mu], Db[nu, mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(1.5)

Define(b[mu] = [0, 0, 0, beta], redo)

{Physics:-D_[mu], Db[nu, mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(1.6)

Db[]

Db[mu, nu] = Matrix(%id = 18446746372997772822)

(1.7)

beta := proc (X) options operator, arrow; b0 end proc``

proc (X) options operator, arrow; b0 end proc

(1.8)

Define(b[mu] = [0, 0, 0, beta], redo)

{Physics:-D_[mu], Db[nu, mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(1.9)

Db[]

Error, (in index/PhysicsTensor) too many levels of recursion

 

````

Second attempt

 

restart

with(Physics)

Setup(mathematicalnotation = true)

Coordinates(X = spherical)

{X}

(2.1)

Parameters(beta, k)

{beta, k}

(2.2)

Setup(metric = {(1, 1) = a(t)^2/(-k*r^2+1), (2, 2) = (a(t)*r)^2, (3, 3) = (a(t)*r*sin(theta))^2, (4, 4) = -1})

[metric = {(1, 1) = a(t)^2/(-k*r^2+1), (2, 2) = a(t)^2*r^2, (3, 3) = a(t)^2*r^2*sin(theta)^2, (4, 4) = -1}]

(2.3)

Define(b[mu])

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.4)

``

Define(Db[nu, mu] = D_[nu](b[mu](X)))``

{Physics:-D_[mu], Db[nu, mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.5)

Define(b[mu] = [0, 0, 0, beta], redo)

{Physics:-D_[mu], Db[nu, mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], b[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2.6)

Db[]

Error, (in index/PhysicsTensor) too many levels of recursion

 

````

``

On my first attempt, expression (1.7) is almost fine, but β is supposed to be constant (and a function of "t" in the future), so I set it as a constant function. But then it causes that problem. Therefore, on my second attempt, I tried to set β as a parameter since the beginning, but it was no good either.


If I were to take the covariant derivative as "D_[nu](b[mu])" (without the "(X)"), it would not have that specific problem, but would not be a good solution, since the covariant derivative would discard the partial derivative of b[mu] and, if it would have some dependence on the coordinates, it would give a wrong result.


The only way it seems to work is by defining the tensor "Db[mu,nu]" explicitly as "d_[mu](b[nu](X)) - Christoffel[~alpha, mu, nu]*b[alpha]". (It seems that the problem comes from that "(X)" next to "b[alpha]" in the connection term.) But that would be an awful way to circumvent the problem. Isn't there any better way to get this?


Can someone help me with this, please?


Thanks for any help!

 

Download Cov._derivative_of_a_specific_vector.mw

 

1 2 3 4 5 6 7 Last Page 1 of 19