MaplePrimes Questions

whats wrong with the codes while running the codes in maple 13 it will take memory and time as 41.80M, 9.29s while the same code is running in maple 18 it will take 1492.38M , 911.79s

Why the same codes take different time and memory. The codes are here

 

 

restart:
Digits:=15:
d1:=0.2:d2:=0.6:L1:=0.2:L2:=0.2:F:=0.3:Br:=0.3:
Gr:=0.2: Nb:=0.1:Nt:=0.3:B:=1:B1:=0.7:m:=1:k:=0.1:
Ro:=1:R1:=1:q:=1:alpha:=Pi/4:
h:=z->piecewise( z<=d1,    1,
                 z<=d1+L1,   1-(gamma1/(2*Ro))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))), 
                        z<=B1-L2/2,  1 ,          
                    z<=B1,  1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B1+L2/2,  R1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B,    R1):
A:=(-m^2/4)-(1/4*k):
S1:=(h(z)^2)/4*A-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:
a2:=Int((1/S1),z=0..1):
b2:=Int((sin(alpha)/F),z=0..1):
c2:=(1/S1)*(-h(z)^6/(6912*A)-h(z)^4/(9216*A)+h(z)^2/(4608*A^3)+ln(1+A*h(z)^2)*(h(z)^6/(576*A)+h(z)^4/(512*A^2)-1/(4608*A^4))):
c3:=Int(c2,z=0..1):
c4:=2*Gr*(Nb-Nt)*c3:
e2:=(1/S1)*(-7*h(z)^4/(256*A)-h(z)^2/(128*A^2)+ln(1+A*h(z)^2)*(3*h(z)^4/(128*A)+h(z)^2/(32*A^2)+1/(128*A^3))):
e3:=Int(e2,z=0..1):
e4:=2*(Nt/Nb)*Br*e3:
l1:=-a2:
l2:=-b2-c4+e4:
Dp:=q*l1+l2:

igRe:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Re(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igRe,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Re(Dp)'],
     gridlines=false, axes=boxed);

igIm:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Im(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igIm,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Im(Dp)'],
     gridlines=false, axes=boxed);
 

 

why do solve and fsolve have different results?

solve-fsolve.mw

I have to solve the equation rH''(r)+H'(r)+(rk^2-r^2*b^2/R^2)=0 where k, b, and R are real constant positive number, with condition H(R)=0 and H(1/R)=R to be solved into series of power. I know from the literature that xy''+y'+xy=0, can't be solved in terms of elementary function(see G.Nagy-ODE-November 29, 2017) that's why I'm interested in an approximate solution based on series, or any results as long as it satisfied the too condition H(R)=0 and H(1/R)=R of the real function H(r). 

Please advice!.

I want to find one option of coodiantes of vertices A, B, C of the triangle ABC, knowing that coordinates centre of circumcircle is O(0,0) and length of sides are 3, 5, 7. 
How can I get the result?

    I have encountered a peculiar behavior in Maple 2019 worksheets. I have attached a worksheet which illustrates a reversal of the coefficient and the blade in the following types of expression.  My Maple installation is set in options to use maple input and output (1D notation).  I am using build ID 1399874.

The procedure I was testing used the add function to expand a multivector over basis blades and coefficients represented by indexed names; for example
    add(a[indx[]]*e[indx[]], indx = indxes); where indxes:={[1],[2],[3],[1,2],[1,3],[1,4],[2,3],[2,4]};

The expected result
a[1]*e[1]+a[2]*e[2]+a[3]*e[3]+a[4]*e[1, 2]+a[5]*e[1, 3]+a[6]*e[1, 4]+a[7]*e[2, 3]+a[8]*e[2, 4] in 1D notation but instead I got

e[1]*xx[1]+e[2]*xx[2]+e[3]*xx[3]+e[1, 2]*xx[4]+e[1, 3]*xx[5]+e[1, 4]*xx[6]+ e[2, 3]*xx[7]+e[2, 4]*xx[8]

(Note and the different coefficient names illustrates the exchange is caused by sorting.)

Initially, I assumed that this resulted from the add command, but after I directly entered an indexed expression into the worksheet and obtained a similar result I realized it must be occurring during the output.  Apparently, before the expression is written, it is first sorted. I know this because, if the coefficient is named a,b,c,d ( less than e), the expression is not exchanged. In addition, if I convert the expression to 2D output, the expression is written in the normal order specified in the add command.

I also confirmed this behavior in Maple 2018.2 as well.  Hopefully, the example worksheet attached will illustrate this behavior.  Am I correct in assuming that when the code I am using in the worksheet with is incorporated into a module in an mpl file and loaded, this will not be an issue.

exchangeproblem.mw

Hello,

How I can extract coefficients from and by calculating determinant for Eigenvalue problem, the value of omega.

For more details please see attached PDF file.

Thanks so much.

eign.pdf

 

How to run the following calculation in multiple processor

 

ADD.mw

In Maply 2018, inputting (entering in red text)

A := <<1,2,3>|<6,7,8>>;

produces output (in blue text)

A := Matrix(3, 2, {(1, 1) = 1, (1, 2) = 6, (2, 1) = 2, (2, 2) = 7, (3, 1) = 3, (3, 2) = 8}, datatype = anything, storage = rectangular, order = Fortran_order, shape = [])

What must I do to make the output appear appear instead as a standard 2-d array, with big brackets to the left and right, 1st column = <1,2,3>; 2nd column = <6,7,8>?

Thank you.

 

We solve Laplace's equation in the domain a < r and r < b, c < t and t < d
in polar coordinates subject to prescribed Dirichlet data.

Maple produces a solution in the form of an infinite sum,
but that solution fails to satisfy the boundary condition
on the domain's outer arc.  Is this a bug or am I missing
something?

restart;

kernelopts(version);

`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

with(plots):

pde := diff(u(r,t),r,r) + diff(u(r,t),r)/r + diff(u(r,t),t,t)/r^2 = 0;

diff(diff(u(r, t), r), r)+(diff(u(r, t), r))/r+(diff(diff(u(r, t), t), t))/r^2 = 0

a, b, c, d := 1, 2, Pi/6, Pi/2;

1, 2, (1/6)*Pi, (1/2)*Pi

bc := u(r,c)=c, u(r,d)=0, u(a,t)=0, u(b,t)=t;

u(r, (1/6)*Pi) = (1/6)*Pi, u(r, (1/2)*Pi) = 0, u(1, t) = 0, u(2, t) = t

We plot the boundary data on the domain's outer arc:

p1 := plots:-spacecurve([b*cos(t), b*sin(t), t], t=c..d, color=red, thickness=5);

Solve the PDE:

pdsol := pdsolve({pde, bc});

u(r, t) = Sum((1/6)*cos(3*signum(n1-1/4)*(-1+4*n1)*t)*(2*Pi*sin((1/2)*signum(n1-1/4)*Pi)*abs(n1-1/4)-6*Pi*sin((3/2)*signum(n1-1/4)*Pi)*abs(n1-1/4)+cos((3/2)*signum(n1-1/4)*Pi)-cos((1/2)*signum(n1-1/4)*Pi))*signum(n1-1/4)*8^(signum(n1-1/4)*(4*n1+1))*(r^((-3+12*n1)*signum(n1-1/4))-r^((3-12*n1)*signum(n1-1/4)))/(abs(n1-1/4)*Pi*(-1+4*n1)*(16777216^(signum(n1-1/4)*n1)-64^signum(n1-1/4))), n1 = 0 .. infinity)+Sum(-(1/3)*((-1)^n-1)*sin(n*Pi*ln(r)/ln(2))*(exp((1/6)*Pi*n*(Pi+6*t)/ln(2))-exp((1/6)*Pi*n*(7*Pi-6*t)/ln(2)))/(n*(exp((1/3)*n*Pi^2/ln(2))-exp(n*Pi^2/ln(2)))), n = 1 .. infinity)

Truncate the infinite sum at 20 terms, and plot the result:

eval(rhs(pdsol), infinity=20):
value(%):
p2 := plot3d([r*cos(t), r*sin(t), %], r=a..b, t=c..d);

Here is the combined plot of the solution and the boundary condition.
We see that the proposed solution completely misses the boundary condition.

plots:-display([p1,p2], orientation=[25,72,0]);


 

Download mw.mw

Dears, greeting for all

I have a problem, I try to explain it by a figure

This formula does not work.

I need to substitute n=0 to give G_n+1 as a function of the parameter s, then find the limit. 

.where G_n is a function in s.

this is the result

 

how to express eigenvector or eigenvalues in terms of fibonacci or lucas or golden ratio?

fibonacci ratio has many 

f(n)/f(n-1) , all eigenvector can not divided by any one of them

 

how to verify lambda calculus is computable and realizable in maple?

is it possible to realize lambda calculus into algebra ?

how to use β-reduction to convert algebra function into lambda calculus?

is there a way to convert back ?

how to combine multiple lambda calculus into one lambda calculus and check computable and then convert back to algebra function?

I'm starting to use procs a lot just because they are more general and can more easily handle complex functionality.

 

I usually have to pass a function to them and that function may or may not take a series of arguments.

 

e.g.,

 

f := (x,y,a)->a*x*y;

g := proc(q, ...)

    q(x,y,...)

end proc;

 

g(f, 3);

 

Here 3 should be passed for a(using ... to represent it).

 

If I pass a function

 

h := (x,y)->x*y

then it would be g(f)

 

I could possibly use nops, ops, arrays, etc... but looking for the right solution.

 

Hello. To generate nine numbers with Cauchy distribution C(0,1) I use Sample(Random Variable(Cauchy(0, 1)), 9). Is there a way to make all generated numbers belong to the interval (-1,1)?

I spend some time searching and reading help. But not able to find if this is possible.

I use worksheet only (i.e. not 2D document). I have my display set as

 

I'd like diff(y(x),x) to display as y'(x) in output.

I know I can do this 

PDEtools:-declare(y(x), prime = x);

And that will make diff(y(x),x) display as y'  but I want y'(x). And the same for diff(y(x),x$2) to display as y''(x). And to be clear, y(x) will still display as y(x).  I am mainly interested in making the derivative display a little nicer if possible.

Is there a way to do this?

I am using 2019.1 on windows 10.

 

First 658 659 660 661 662 663 664 Last Page 660 of 2425