Maple 2017 Questions and Posts

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

Hello,

     I'm attempting to use unevaluation quotes on a keyword argument within a procedure. For instance, if I have two procedures with the same keyword arguments, I need to unevaluate one to call the other:

foo1 := proc( {param:={}}, $)
  foo2('param'=param):
end proc:


foo2 := proc( {param:={}}, $)
end proc:

foo1('param'=1);

The above code throws the error,

Error, (in foo1) invalid input: too many and/or wrong type of arguments passed to foo2; first unused argument is 1 = 1

which I take to mean that 'param' in foo1 isn't being unevaluated in the call to foo2. What is the correct way to accomplish this?

Thanks!

Hello. Tell me please how to fix it and build a graph? Thank you in advance.

p := PolyhedralSets([-x >= 0, -y >= 0, -z >= 0, -(1/2)*x >= 0, (-x-y)*(1/2) >= 0, (-x-z)*(1/2) >= 0], {y = -20}, [x, y, z]);
plot(p);
Error, (in plot) cannot determine plotting variable
 

I am trying to solve the equation

exp(2*sin(t))-1=0, over the interval 0 <= t <=  16

I tried entering this into Maple:

solve({exp(2*sin(t))-1=0, 0 <= t,t <= 16}, AllSolutions, Explicit)

When I enter it, Maple just says "Evaluating"... and then returns nothing.

I tried "solve" without AllSolutions/Explicit, and even fsolve.

Then Maple only gives me the trivial result t = 0.

Is there a way to approximate the roots, like a root solver.

Ideally I would like to get the exact roots over the interval [0,16].

Wolfram has no problem solving this exactly.https://www.wolframalpha.com/input/?i=solve(%5Bexp(2*sin(t))-1%3D0,+0+%3C%3D+t,t+%3C%3D+16%5D,+AllSolutions,+Explicit)

I posted the worksheet

solveroots.mw

Hello. I have the system of inequalities -x / 2> 0, -x> 0, (-x-y) / 2> 0, (-x-z) / 2> 0, -y> 0, -z> 0. Tell me, please, how to build a graph on it?

How I can pdsolve this partial fractional  equation?

1.mw
 

restart; CK := .3; Z := 10; L := 1; alpha := .95

###The Riemann–Liouville fractional integral H^alpha  is written in a convolution-form as:

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

 

#where GAMMA(...) represents the Gamma function

 

 
PDE := diff(theta(xi, beta), beta, beta)+L*(diff(theta(xi, beta), xi, beta, beta))+diff(theta(xi, beta), beta, beta, beta)+(1/2)*(diff(theta(xi, beta), beta, beta, beta, beta)) = H^(alpha-1)*CK*(diff(theta(xi, beta), xi, xi))+H(CK*Z+1)^(alpha-1)*(diff(theta(xi, beta), xi, xi, beta))+H^(alpha-1)*Z*(diff(theta(xi, beta), xi, xi, beta, beta))

Init := {theta(xi, 0) = 0, (D[2](theta))(xi, 0) = 0}

{theta(xi, 0) = 0, (D[2](theta))(xi, 0) = 0}

(1)

Bdry := {theta(0, beta) = 1, theta(10, beta) = 0}

{theta(0, beta) = 1, theta(10, beta) = 0}

(2)

smod1 := pdsolve(PDE, Init, Bdry, numeric)

 

 

``


 

Download 1.mw

 

Hi, 

I'm currently studying the Rossler Attractor, which is the following system:

diff(x(t), t) = -y(t)-z(t)

 diff(y(t), t) = x(t)+a*y(t)

diff(z(t), t) = b+x(t)*z(t)-c*z(t).

I have found the points of equilibrium of the system.

But now I need to draw bifurcation diagrams: one for varying a, one for varying b, and one for varying c.

 

Can someone please help me with a procedure of how to do this?

Thanks in advance.

 

Hi!

Consider, fixed an integer m>1, the mapping given by the following procedure:

 

G := proc (t) local k, C; C := NULL; C := t; for k from 2 to d do C := C, 1/2-(1/2)*cos(Pi*m^(k-1)*t) end do; return [C] end proc

Then, it can be proved that given x in the cube [0,1]^{d} there is t in [0,1] such that the norm of x-G(t) is less, or equal, than sqrt(d-1)/m. Indeed, dividing the cube [0,1]^{d} into m^{d-1} subcubes of side-length 1/m x ... x 1/m x 1, the point x belongs to some of these subcubes, say J. As, by the properties of the cosines function, the curve G(t) lies in J whenever t in certain subinterval of [0,1], the result follows.

In other words, computing all the solutions of the equation

1/2*(1-cos(Pi*m^(d-1)*t)) = x[d], (j-1)/m <= t and t <= j/m

for some of these solutions the desired t is obtained, where j is such that x1 in [(j-1)/m,j/m] (x1 is the first coordinate of the point x). However, for large values of m and d, the above equation have many solutions, I have tried find all of them and the process is extremely slow....Other way to find such a t can be the following: find a t satisfying the following system of inequalities

EQ := abs(t-x[1]) <= 1/m; for k from 2 to d do EQ := EQ, abs(1/2*(1-cos(Pi*m^(k-1)*t))-x[k]) <= 1/m end do

 

and then, a solution of this system is a such t. I do not know how to find, efficiently, a t such that of x-G(t) is less, or equal, than sqrt(d-1)/m   :(

Some idea?

Many thanks for your comments in advance.

 

Hi,
I am new to using maple and was wondering if i could get some help with this problem...

 

I'm having problems with 2b)

pell := proc (d, K)

local y; 

y := sqrt(d*x^2+1); 

d := 2; 

if y <= K then print*(x, y) end if 

end proc


this is what i have come up with, feel like it is completely wrong though.

Any help would be much appreciated.

I am having trouble getting Maple 2017.3 with latest Physics update to give solution to Burger's PDE for viscous fluid flow with the following initial condition. May be I am not doing something right. I tried different HINTS, but no luck.

Maple can solve the PDE without the initial conditions.

May be a Maple expert can find work around or show what I might be doing wrong.

restart;
pde := diff(u(x, t), t) + u(x, t)*diff(u(x, t), x) = mu*diff(u(x,t),x$2);
ic  := u(x,0) = PIECEWISE([0,x>=0],[1,x<0]);
sol := pdsolve({pde,ic}, u(x, t)) assuming mu>0;

Maple returns () as solution.

This PDE can be solved analytically. Here is Mathematica' solution

ClearAll[u,x,y,mu]
pde = D[u[x,t],{t}]+u[x,t]*D[u[x,t],{x}]==mu*D[u[x,t],{x,2}];
ic  = u[x,0]==Piecewise[{{1,x<0},{0,x>=1}}];
sol = DSolve[{pde,ic},u[x,t],{x,t},Assumptions->mu>0]

 

 

This is on Maple 2017.3 under windows

After obtaining solution from pdsolve(), I tried to see if Maple can convert it to hyperbolic trig functions by calling `convert(sol,trigh)`. 

 

I waited and waited and nothing happened. Then clicked on the `interrupt current operation` button at top of menu. 

But I found that mserver.exe has hanged in a loop. Taking 100% CPU and still running. So Had to terminate it from task manager.

Question is: It is ok if Maple can't do the conversion, but why does it hang? Maybe if I want for one hr it will finish, I do not know. But the important part, why does `interrupt current operation` does not work, in the sense that the mserver.exe is still running?

Is this common thing to happen? Should this be fixed? 

Here is example

 

restart;
interface(showassumed=0);
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0;
f:=x-> piecewise(x>0 and x<1/2, 2*x, x>1/2 and x<1, 2-2*x);
bc:=u(0,y)=0,u(1,y)=0,u(x,0)=f(x),u(x,2)=f(x);
sol:=pdsolve([pde,bc],u(x,y)) assuming x>0,y>0;

The above works OK and generates a solution. Now the next call hangs mserver.exe

convert(sol,trigh);

In case your Maple version can't solve the above PDE. Here is the solution obtained, so you can try this below without having to solve the PDE

 

sol := u(x, y) = Sum(8*sin((1/2)*n*Pi)*sin(Pi*x*n)*(exp(Pi*n*(3*y-2))-
         exp(Pi*n*(3*y-4))+exp(Pi*y*n)-exp(Pi*n*(y-2)))*exp(-2*Pi*n*(y-2))/(Pi^2*n^2*(exp(4*n*Pi)-1)),
            n = 0 .. infinity);
convert(sol,trigh);

I also tried convert(rhs(sol),trigh); but it made no difference.

 

This is my code.  It's not appending as I need it to.  Any help would be humbly and gratefully appreciated!

 


 

restart; Sort4 := proc (Q, T, U, Rx1, Ry1, Rx2, Ry2, Rx3, Ry3, Rx4, Ry4) local i, k; description "Organizes vectors Q,T into new vectors Rx1...Ry4 correspponding to values of U."; for i from 5 to nops(U) do if U(i) = 1 then Append(Rx1, Q(i)); Append(Ry1, T(i)) elif U(i) = 2 then Append(Rx2, Q(i)); Append(Ry2, T(i)) elif U(i) = 3 then Append(Rx3, Q(i)); Append(Ry3, T(i)) elif U(i) = 4 then Append(Rx4, Q(i)); Append(Ry4, T(i)) end if end do; return Rx1, Rx2, Rx3, Rx4, Ry1, Ry2, Ry3, Ry4 end proc

Q, T, U := `<,>`(0, 2, 4, 6, 7, 17, 27, 57, 67, 97), `<,>`(0, 2, 1, 8, 19, 20, 21, 22, 23, 24), `<,>`(o, o, o, o, 1, 2, 3, 2, 4)

Vector[column](%id = 18446744078670632710), Vector[column](%id = 18446744078670632830), Vector[column](%id = 18446744078670632950)

(1)

Rx1 := Vector([Q(1)]); Ry1 := Vector([T(1)]); Rx2 := Vector([Q(2)]); Ry2 := Vector([T(2)]); Rx3 := Vector([Q(3)]); Ry3 := Vector([T(3)]); Rx4 := Vector([Q(4)]); Ry4 := Vector([T(4)])

_rtable[18446744078670623558]

 

_rtable[18446744078670624518]

 

_rtable[18446744078670625238]

 

_rtable[18446744078670625958]

 

_rtable[18446744078670626678]

 

_rtable[18446744078670619222]

 

_rtable[18446744078670619942]

 

Vector[column](%id = 18446744078670620662)

(2)

Sort4(Q, T, U, Rx1, Ry1, Rx2, Ry2, Rx3, Ry3, Rx4, Ry4)

Vector[column](%id = 18446744078670623558), Vector[column](%id = 18446744078670625238), Vector[column](%id = 18446744078670626678), Vector[column](%id = 18446744078670619942), Vector[column](%id = 18446744078670624518), Vector[column](%id = 18446744078670625958), Vector[column](%id = 18446744078670619222), Vector[column](%id = 18446744078670620662)

(3)

``


 

Download Sort4_320.mw

f(x)=sqrt(sin(x)); x over the intervall [0,T]

can anyone help me to find this integral ?

 

I might be doing something wrong since I expected Maple to be able to solve this. Could some Maple manage to make Maple solve the following beam PDE problem taken from a textbook?

 

This is what I tried.

restart;
pde:=diff(u(x,t),t$2)+diff(u(x,t),x$4)=0;
bc:=u(0,t)=-12*t^2,u(1,t)=1-12*t^2,D[1,1](u)(0,t)=0,D[1,1](u)(1,t)=12;
ic:=u(x,0)=x^4,D[2](u)(x,0)=0;
sol:=pdsolve({pde,ic,bc},u(x,t));

But Maple returns no solution.

I am using Maple 2017.3 on windows.

 

I have two tensors, E_ and F_ below, that I believe should be equal. But they are not, and I cannot understand why. The problem does not appear in, say, Schwarschild spacetime, but it appears in Boyer-Lindquist spacetime, metric [5,29,1]; perhaps it appears only if the vierbein is nondiagonal?

The code: Loading the packages and the metric:

restart:
with(Physics):
with(Tetrads):
g_[[5,29,1]];   # The Boyer-Lindquist metric

Set up galilean and nongalilean Levi-Civita's, respectively, following the recipe given elsewhere:

Define(varepsilon[a,b,c,d] = Array((1..4)$4,rhs(LeviCivita[nonzero])),quiet):
Setup(levicivita = nongalilean):
# Checking that the Levi-Civita's are indeed different
varepsilon[1,2,3,4];   # The galilean case
LeviCivita[1,2,3,4];   # The nongalilean case

Define the two tensors E_ and F_, using mixed type Levi-Civita's for the latter:

Define(
   E_[~a,mu] = varepsilon[~a,~b,~c,~d]*LeviCivita[mu,nu,rho,sigma]*e_[b,~nu]*e_[c,~rho]*e_[d,~sigma],
   F_[~a,mu] = varepsilon[~a,b,c,d]*LeviCivita[mu,~nu,~rho,~sigma]*e_[~b,nu]*e_[~c,rho]*e_[~d,sigma]
,quiet):
E_[definition];
F_[definition];

Compare the two expressions, which should be equal, I believe.

expr := simplify(TensorArray(E_[~a,mu] - F_[~a,mu])) assuming a::real,theta > 0,theta < Pi;
eval(expr,{a = 1,m = 1,r = 2,theta = Pi/4});   # Just to make the difference completely obvious

[I have trouble copy-pasting the output from these two lines, so you will have to execute the worksheet provided below to see it.]

However, they are not equal. Why not?

Download worksheet: MixedTypeLeviCivitas.mw.


 

Suppose I am given the following summation:

 

sum(a*i, i = 1 .. n)

``

Can Maple write the first few terms of the summation? For example, if I want to see first three terms of the summation, I'd like Maple to output the following:

 

a + 2 a + 3 a

 

My use case is that if I am given a complicated summation, it can be useful to look at the first few terms to see if there are any patterns.

 

The things I've tried are:

 

sum(a*i, i = 1 .. 3)

6*a

(1)

'sum(a*i, i = 1 .. 3)'

sum(a*i, i = 1 .. 3)

(2)

eval(sum(a*i, i = 1 .. 3))

6*a

(3)

expand(sum(a*i, i = 1 .. 3))

6*a````

(4)

``


 

Download expandsum.mw

First 16 17 18 19 20 21 22 Last Page 18 of 40