Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have the following Maplesoft code:

with(ImageTools);

with(IterativeMaps):
Crystal, xrange, yrange := Attractor([x, y], [[1/2 - y/2, x/2], [y/2 + 1/2, 1/2 - x/2], [x/2 + 1/4, y/2 + 1/2]], height = 400, width = 400, xmin = -1, xmax = 2, ymin = -1, ymax = 1, fixview = true, [0, 0], [0.33, 0.33, 0.33], greenexpression = 1 - 1/(1/(1 - G) + 1), iterations = 2500000);
xrange, yrange;
                        -1 .. 2, -1 .. 1

ColouringProcedures:-HueToRGB(Crystal);
                               0.

Embed(Crystal);

which yields the following image:


However, I should be seeing the following image:

Any help would be appreciated. Thanks!

Justify that 2 vectors (1,1) and (1,2) are an R² base; How to write calculations correctly ?
<x, y> = lambda*<1, 1> + mu*<1, 2>:
 solve({lambda+mu=x,lambda+2*mu=y},{lambda,mu}):
 <x, y> := (2*x - y)*<1, 1> + (-x + y)*<1, 2>:
Thank you.

I get this error when I try to use the ODE numeric solver, can anybody help me figure out what Im doing wrong? 

hi guys,

I have a question about computing reimann tensor in general relativity.

suppose we have schwarzschidl metric: ds^2=-(1-2*m*(r^-1))*dt^2+(1-2*m*(r^-1))^(-1)*dr^2+r^2*dtheta^2+r^2*sin^2(theta)*dphi^2.

I want to caclulate R[alpha,beta,mu,nu]*R[~alpha,~beta,~mu,~nu] where R[alpha,beta,mu,nu] is covariant form of Reimann tensor and also R[~alpha,~beta,~mu,~nu] is the contravariant form of Riemann tensor. I also want to calculate same thing for weyl tensor. please guide me.

with best regards.

A simple suggestion...

I would appreciate being able to open multiple help pages simultaneously instead of just one.
This seems to me particularly interesting when you have to browse back and forth between several related items.

How to reconstruct commutators like for example in Drinfeld associators (see (4.5) in https://arxiv.org/pdf/1310.3259.pdf)?

We have as computed in Drinfieldstuff_display.mw (note to run this it requires loading HyperInt package https://arxiv.org/pdf/1403.3385.pdf):

H[2] := a^2*(e[0]*e[1] - e[1]*e[0])*zeta[2]

H[3] := zeta[3]*a^3*(((e[0]*e[1]^2 + e[0]^2*e[1] - (2*e[1])*e[0]*e[1]) + e[1]^2*e[0]) - (2*e[0])*e[1]*e[0] + e[1]*e[0]^2)

H[4] := zeta[2]^2*a^4*((((((4*e[0])*e[1]^3 + (12*e[0])*e[1]*e[0]^2 - (5*e[1])*e[0]^2*e[1] - (4*e[1])*e[0]^3) - (4*e[1]^3)*e[0]) + (7*e[1])*e[0]*e[1]*e[0] + (12*e[1]^2)*e[0]*e[1] + (3*e[0])*e[1]*e[0]*e[1] - (12*e[0]^2)*e[1]*e[0] - (5*e[0])*e[1]^2*e[0] + e[0]^2*e[1]^2 - (12*e[1])*e[0]*e[1]^2) - e[1]^2*e[0]^2) + (4*e[0]^3)*e[1])/10

And we want maple rebuild them as  commutators as below ([x,y]=xy-yx). Correspondingly:

H[2] :=zeta[2] [e[0] , e[1] ]

H[3] :=zeta[ 3] ( [e[0] , [e[0], e[1] ]] − [e[1] , [e[0] , e[1] ]] )

H[4] :=zeta[4] [e[0] , [e[0], [e[0] , e[1]]]] −1/4* [e[0] , [e[1] , [e[0] ,e[1] ]]] + [e[1] , [e[1] , [e[0] , e[1] ]]] + 5/4*[e[0], e[1]] ^2

Does anyone know how to do it?

In the plotting guide I didn't see a waterfall chart so I created a procedure. 
If anyone has a more efficent, better or alternate way please feel free to add.


 

waterfall := proc (data, colorinc := green, colordec := red) local i, r1; r || 1 := plots:-display(plottools:-rectangle([0, 0], [1, data[1]]), color = colorinc); for i from 2 to nops(data) do if data[i-1] < data[i] then r || i := plots:-display(plottools:-rectangle([i-1, data[i-1]], [i, data[i]]), color = colorinc) elif data[i] < data[i-1] then r || i := plots:-display(plottools:-rectangle([i-1, data[i-1]], [i, data[i]]), color = colordec) else r || i := plots:-display(plottools:-rectangle([i-1, data[i-1]], [i, data[i]])) end if end do; plots:-display(seq(r || i, i = 1 .. nops(data))) end proc
``

data := [6, 4, 4, 4, 7, 9, 12, 16, 25, 100, 105, 95, 90, 55, 45, 30]

[6, 4, 4, 4, 7, 9, 12, 16, 25, 100, 105, 95, 90, 55, 45, 30]

(1)

waterfall(data)

 

waterfall(data, purple, yellow)

 

``


 

Download Waterfall.mw

 

Hi

I got the error like this unable to convert to an explicit first-order system

please anyone can help me to solve this

I am attaching the worksheet

with(plots); restart

eq1 := (2*eta*gamma+1)*(diff(f(eta), `$`(eta, 3)))+2*gamma*(diff(f(eta), `$`(eta, 2)))+f(eta)*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))^2-(Q+S)*(diff(f(eta), eta))+beta*(diff(F(eta), eta)-(diff(f(eta), eta))) = 0;

(2*eta*gamma+1)*(diff(diff(diff(f(eta), eta), eta), eta))+2*gamma*(diff(diff(f(eta), eta), eta))+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2-(Q+S)*(diff(f(eta), eta))+beta*(diff(F(eta), eta)-(diff(f(eta), eta))) = 0

(1)

eq2 := (diff(F(eta), `$`(eta, 2)))*F(eta)-(diff(F(eta), eta))^2+beta*(diff(f(eta), eta)-(diff(F(eta), eta))) = 0;

(diff(diff(F(eta), eta), eta))*F(eta)-(diff(F(eta), eta))^2+beta*(diff(f(eta), eta)-(diff(F(eta), eta))) = 0

(2)

eq3 := (2*eta*gamma+1)*(1+Rd)*(diff(theta(eta), `$`(eta, 2)))+Pr*((diff(theta(eta), eta))*f(eta)-2*(diff(f(eta), eta))*theta(eta))+gamma*(diff(theta(eta), eta))+N*Pr*betat*((theta[p](eta), eta)-theta(eta))+N*Pr*Ec*betat*(diff(F(eta), eta)-(diff(f(eta), eta)))+Pr*delta*theta(eta) = 0;

(2*eta*gamma+1)*(1+Rd)*(diff(diff(theta(eta), eta), eta))+Pr*((diff(theta(eta), eta))*f(eta)-2*(diff(f(eta), eta))*theta(eta))+gamma*(diff(theta(eta), eta))+N*Pr*betat*((theta[p](eta), eta)-theta(eta))+N*Pr*Ec*betat*(diff(F(eta), eta)-(diff(f(eta), eta)))+Pr*delta*theta(eta) = 0

(3)

eq4 := 2*(diff(theta[p](eta), eta))*f(eta)-F(eta)*theta[p](eta)+betat*delta*(theta[p](eta)-theta(eta)) = 0;

2*(diff(theta[p](eta), eta))*f(eta)-F(eta)*theta[p](eta)+betat*delta*(theta[p](eta)-theta(eta)) = 0

(4)

bcs := f(0) = 0, (D(f))(0) = 1, (D(f))(5) = 0, (D(F))(5) = 0, F(5) = f(5), theta(0) = 1, theta(5) = 0, theta[p](5) = 0;

f(0) = 0, (D(f))(0) = 1, (D(f))(5) = 0, (D(F))(5) = 0, F(5) = f(5), theta(0) = 1, theta(5) = 0, theta[p](5) = 0

(5)

params := [Rd = .1, beta = .5, Q = .5, S = .5, gamma = .1, Pr = 6.2, N = .5, betat = .5, Ec = .1];

[Rd = .1, beta = .5, Q = .5, S = .5, gamma = .1, Pr = 6.2, N = .5, betat = .5, Ec = .1]

(6)

sol := dsolve(eval([eq1, eq2, eq3, eq4, bcs], params), numeric, output = array([0]), maxmesh = 5000, initmesh = 1000)

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system

 

``

Download MapleOde.mw

Hi,

I try to display a different steps of an mathematical developpement with ShowSteps command, but But the command gives nothing in the new version Maple 2021?

Thanks for your Help

QShowSteps.mw

I do not know why int() on this integrand fails always first time, and works second time it is called. seems like something is not loaded correctly first time?

integrand:=(((-3*x^2-18*x-27)*exp(2)^2+(30*x^3+330*x^2+1170*x+1350)*exp(2)-75*x^4-1200*x^3-7050*x^2-18000*x-16875)*ln(x)+(12*x^2+54*x+81)*exp(2)^2+(-120*x^3-1106*x^2-3510*x-4050)*exp(2)+225*x^4+3560*x^3+20990*x^2+54000*x+50625)/((3*x^4+18*x^3+27*x^2)*exp(2)^2+(-30*x^5-330*x^4-1170*x^3-1350*x^2)*exp(2)+75*x^6+1200*x^5+7050*x^4+18000*x^3+16875*x^2):

print("First time");
int(integrand,x);

print("second time");
int(integrand,x);

Worksheet attached.

Update

Here is a movie. it is few minutes long. This happens by random and not each time. This movie shows the command starting from "restart" are repated 4 times. First two times, no error. Then the error shows up.  So it is random. Maybe it depends if Maple is busy with other things or not. I have each worksheet set to use its own server though. So I have no idea why this happens sometimes and not other times.

 

 

 

issue_int_nov_11_2021.mw

I think there is a problem here

restart;
the_integrand:=(((-2*x^2+2)*exp(exp(exp(3)))^2+(4*x^3-4*x)*exp(exp(exp(3)))-2*x^4-6*x^2+8)*exp(ln(x)-x^2)*ln(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4)+((2*x^2-2)*exp(2)*exp(exp(exp(3)))^2+((-4*x^3+4*x)*exp(2)-2*x)*exp(exp(exp(3)))+(2*x^4+6*x^2-8)*exp(2)+2*x^2)*exp(ln(x)-x^2))/(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4);

int(the_integrand,x,method=_RETURNVERBOSE)

#try MeijerG
int(the_integrand,x,method=MeijerG);

gives

I do not know if this known or not.

Maple 2021.1 on windows

This is Maple 2021.1 on windows.

===================
restart;
expr:=x^(6+1/3);
res:=series(expr,x=0,6);
==============

gives
        O(x^(19/3))

But type of the above is not series:

===========
type(res,'series');
        false
===========

Yet convert(res,polynom) works

================
convert(res,polynom)
          0
================

Which is correct conversion. But help says that

"convert/polynom
convert a series to polynomial form"

Notice, it says "series" there.

So the input must be type series. But Maple says
O(x^(19/3)) is not type series. I think this is wrong. The
type returned should be series. Now the type returned is 'function'
from the series command.

What Am I overlooking here?

I want to calculate the numerical value of the following integral at a given (r,z) where r and z are real numbers:

g(r,z)=int(exp(-sqrt(k^2 - k0^2)*z)*BesselJ(0, k*r)*k/sqrt(k^2 - k0^2), k = 0 .. infinity) where k0 is a real number.

In other words, it is the hankel transform g(r,z) of the function f(k):

f(k)=exp(-sqrt(k^2 - k0^2)*z)/sqrt(k^2 - k0^2)

The theoretical result is exp(-I*k0*R)/R with R=sqrt(r^2+z^2)

I tried to use the commande evalf(Int(exp(-sqrt(k^2 - k0^2)*z)*BesselJ(0, k*r)*k/sqrt(k^2 - k0^2), k = 0 .. infinity)) but it takes hours to evaluate and I did not get any results yet. I tried to calculate this integral with another software which uses a vectorized adaptive quadrature algorithm and I got the result in a few seconds.

How could I calculate this integral with Maple ?

Thanks.

Hello. Please help me. I need to calculate the integral (3). This integral has many singular points at which there is convergence in the sense of the principal Cauchy value. The Maple integral itself does not count. I don't understand how to find automatically all the singular points on the integration area. Then, perhaps, it would be possible to split the integral into the sum of integrals by regions, as I roughly wrote in the picture. I want to automate this process, because in fact it is necessary to calculate many integrals of the form (4), where f(x,y) are arbitrary functions that can oscillate strongly, so I don't want to write banal quadrature formulas. I would like to use the means of Maple, since the accuracy will be greater and faster, but we need to somehow bypass the special points. I will be glad of any help. Thank you very much


restart

r1 := 1:

1/1000000

(1)

F1 := 1/(Zp*sqrt(k^2-x^2)*sin(y)+omega*rho1);

1/(46715093.93*(-x^2+1)^(1/2)*sin(y)+1485000)

(2)

Int(F1, x = -k+epsilon .. k-epsilon, y = 0 .. 2*Pi);

Int(1/(46715093.93*(-x^2+1)^(1/2)*sin(y)+1485000), x = -999999/1000000 .. 999999/1000000, y = 0 .. 2*Pi)

(3)

F2 := F1*f(x, y);

f(x, y)/(46715093.93*(-x^2+1)^(1/2)*sin(y)+1485000)

(4)

``

Download Integrate.mw

First 360 361 362 363 364 365 366 Last Page 362 of 2216