MaplePrimes Questions

I need the final line of the uploaded worksheet to be the "Select Action", preprogrammed prior to the execution of the insert xml command, how do i do this?

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/ASK.mw .
 

Download ASK.mw

I am trying to do matrix multiplication with Dirac gamma matrices, but am getting a recursion error. 

the final input line, which is causing the error, doesn't seem to be inserted, but it is:

Library:-PerformMatrixOperations((mt . (Dgamma[2])) . m)

can anybody tell me what i'm doing wrong? i don't understand why 

Dgamma[2] . m 

works but 

mw . Dgamma[2] . m 

gets the recursion error. 

then i saw something that made me think i needed to use 'matrix', instead of 'Matrix'. so i tried that(gamult2) - now the 2nd multiply works, and the first fails.

any help greatly appreciated!

thanks,

larry

restart

with(Physics)

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 452 and is the same as the version installed in this computer, created 2019, October 23, 13:26 hours, found in the directory /Users/lstead/maple/toolbox/2019/Physics Updates/lib/`

(1)

with(LinearAlgebra)

``

m := Matrix(4, 1, {(1, 1) = 1, (2, 1) = 2, (3, 1) = 3, (4, 1) = 4})

Matrix(%id = 18446744078528784254)

(2)

mt := Transpose(m)

Matrix(%id = 18446744078392267830)

(3)

mt.m

Matrix(%id = 18446744078392260238)

(4)

Library:-PerformMatrixOperations(Dgamma[2].m)

Matrix(%id = 18446744078528770526)

(5)

Library:-PerformMatrixOperations(mt.Dgamma[2].m)

Error, (in Physics:-GetDefineINFO) too many levels of recursion

 

``


 

Download gammult.mw

gammult2.mw

hello

why this pdsolve not be answer

pde := diff(T(x, y, t), x, x)+diff(T(x, y, t), y, y) = (1/0.44e-2)*(diff(T(x, y, t), t));
conds := T(0, y, t) = 1, T(1, y, t) = 1, T(x, 0, t) = 1, T(x, 1, t) = 1, T(x, y, 0) = 0;
`assuming`([pdsolve([pde, conds])], [0 <= x and x <= 1, 0 <= y and y <= 1, t >= 0]);
 

Dear all

I have a fourth-order PDEs, with some boundary condition, I would like to compute an explicit solution or plot the solution in the interval [0,2]

 

PDEsolve.mw

thinks

Hello everyone,

Say I have the differential equation:

x1'(t) = 3C1*cos(t) + 2C2*sin(t)

x2'(t) = 5C1*cos(t) + 1C2*sin(t)

How can one draw phase portraits in maple?

 

 

I have a piecevise defined function where i wanna reference the condition inorder to use the maximum and minimum values of the defined range in other functions. Is there a function for this that i just cant find or do i have to use a workaround?

These are the values im trying to access. and heres the function:

f := proc (t) options operator, arrow; piecewise(-1 < t and t <= 0, t+1, 0 < t and t <= 1, 1-t) end proc

Hi,

I have written a module M which contains some procedures P1, P2, ...
This module contains the statement option package.

In a separate worksheet I type the command L := with(M) to load this module and stack in the list L the names of all the procedures M contains.
I would like now to use showstat to display the content of all these procedures..

I thus typed:
for p in L do  showstat(p) end do;

I got an error saying that showstat expects a name as argument.
In the command above p is not a name but a symbol.

Is there a possibility to "showstat" all the procedures M contains ?

Motivation:I'd like to count the number of command lines in module M (showstat removes the lines of comments) ... maybe there exist an other way than using showstat ?


Thanks in advance

from help, it says about option of 'spacestep'=numeric to pdsolve numerical solver the following

Specifies the spacing of the spatial points on the discrete mesh on which the solution 
is computed, and defaults to 1/20th of the spatial range of the problem, 
r-L, where L is the left boundary, and r is the right. Note: The spacing must 
be small enough that a sufficient number of points are in the spatial domain 
for the given method, boundary conditions, and spatial interpolation (see below). 
If the given value of spacestep does not fit into the input domain an integral 
number of times, the closest smaller step size that does is used. For problems 
using error estimates, or an adaptive approach, the total number of spatial 
points must be odd, so again, if this is not the case for the specified 
spacestep, then it is reduced to satisfy this requirement.

In this problem, the domain is [-1,1]. So the default is 1/20 of this which is 1/10.  Why is it when using spacestep smaller than 1/11, the animator generated from the solution does not work right?  i.e. playing the animate does not produce correct result as the case when using spacestep=1/11 or spacestep=1/10?   

When using spacestep=1/16 or 1/15 or 1/14 or 1/13 or 1/12, it all produce bad animation.  I do not see why that is. 

Any ideas?  Am I doing something wrong?
 

pde := diff(u(x,t),t$2)=diff(u(x,t),x$2):
bc  := u(-1,t)=u(1,t),D[1](u)(-1,t)=D[1](u)(1,t):
f:=x->piecewise(-1/2<x and x<0,x+1/2,0<x and x<1/2,1/2-x,true,0):
plot(f(x),x=-1..1):
ic  := u(x,0)=f(x),D[2](u)(x,0)=0:
sol:=pdsolve(pde,{bc,ic},u(x,t),numeric,time=t,range=-1..1,  timestep=1/16,spacestep=1/16)

_m1793827573184

sol:-animate(t=1,frames=50,title="time = %f");

sol:=pdsolve(pde,{bc,ic},u(x,t),numeric,time=t,range=-1..1,  timestep=1/16,spacestep=1/12):
sol:-animate(t=1,frames=50,title="time = %f");

sol:=pdsolve(pde,{bc,ic},u(x,t),numeric,time=t,range=-1..1,  timestep=1/16,spacestep=1/11):
sol:-animate(t=1,frames=50,title="time = %f");

 

 

Download solving_wave_pde_2.mw

 

 

When solving this 1D wave PDE numerically, if the range used is -Pi..Pi then I get this error

sol:-plot(t=0,numpoints=100);
Error, (in Vector) unable to store '-Pi' when datatype=float[8]

When trying to plot the solution. Changing the range to -1..1 the error goes away.

I would expect the numerical solver to handle these things automatically? 

Please see attached worksheet.   How to work around this if one wants to use range from -Pi..Pi?

 

#wave PDE with periodic BC.
restart;

pde := diff(u(x,t),t$2)=diff(u(x,t),x$2);
bc  := u(-Pi,t)=u(Pi,t),D[1](u)(-Pi,t)=D[1](u)(Pi,t);
f:=x->piecewise(-Pi/2<x and x<Pi/2,1,true,0);
plot(f(x),x=-Pi..Pi);
ic  := u(x,0)=f(x),D[2](u)(x,0)=0;
sol:=pdsolve(pde,{bc,ic},u(x,t),numeric,time=t,range=-Pi..Pi)

pde := diff(u(x, t), t, t) = diff(u(x, t), x, x)

bc := u(-Pi, t) = u(Pi, t), (D[1](u))(-Pi, t) = (D[1](u))(Pi, t)

f := proc (x) options operator, arrow; piecewise(-(1/2)*Pi < x and x < (1/2)*Pi, 1, true, 0) end proc

u(x, 0) = piecewise(-(1/2)*Pi < x and x < (1/2)*Pi, 1, 0), (D[2](u))(x, 0) = 0

_m1174810042944

sol:-plot(t=0,numpoints=100);

Error, (in Vector) unable to store '-Pi' when datatype=float[8]

pde := diff(u(x,t),t$2)=diff(u(x,t),x$2);
bc  := u(-1,t)=u(1,t),D[1](u)(-1,t)=D[1](u)(1,t);
f:=x->piecewise(-1/2<x and x<1/2,1,true,0);
plot(f(x),x=-1..1);
ic  := u(x,0)=f(x),D[2](u)(x,0)=0;
sol:=pdsolve(pde,{bc,ic},u(x,t),numeric,time=t,range=-1..1)

pde := diff(u(x, t), t, t) = diff(u(x, t), x, x)

bc := u(-1, t) = u(1, t), (D[1](u))(-1, t) = (D[1](u))(1, t)

f := proc (x) options operator, arrow; piecewise(-1/2 < x and x < 1/2, 1, true, 0) end proc

u(x, 0) = piecewise(-1/2 < x and x < 1/2, 1, 0), (D[2](u))(x, 0) = 0

_m1174805392512

sol:-plot(t=0,numpoints=100);

 


 

Download solving_wave_pde.mw

The problem is to find a100 for a sequence defined as follows.


https://snipboard.io/AdZKX5.jpg I tried the following command for a recursive sequence.
(I used 10 instead of 100 to test run it).

a||1:=1;
for n from 2 to 10 do a||n:=2*sum( a||i ,i=1..n)^2/(2*sum( a||i ,i=1..n)-1); od;

This approach did not work. It says "error recursive assignment"

Any ideas how to get a(100), also if its possible how to solve the recursive sequence explicitly.

I tried rsolve :

rsolve({ f(n)=(2*sum(f(i),i=1..n)^2/(2*sum(f(i),i=1..n)-1)),f(1)=1},f(n))
rsolve({ f(n)=(2*sum(f(i),i=1..n)^2/(2*sum(f(i),i=1..n)-1)),f(1)=1},f(n))

It just returned back the expression inertly.

 

Assume that x[i] with 1≤i≤n are binary numbers. Let I_[k] be a subset with k elements of the set {1,2,⋯,n}.

Now Consider the following binary linear functions

It is clear that to obtain f[j]'s we need to compute ∑k[j] XOR bitwise operator. But it is possible to get f[j]'s with less than ∑k[j] XOR.

Example: Let n=8 and m=7 and suppose that

It follows from (1) that we need to do 20 XOR bitwise operator to get f[j]'s with 1≤j≤7. But set

which results in  f[j]'s are computed with just 9 XOR.

It is useful to mention that the relation (1) can be represented by a 8x8 binary matrix in the form of M*X=F. 

Question: Is it possible to implement a procedure in Maple such that by applying the procedure we get  f[j]'s with the minimum number of XOR bitwise operator.

One solution for this question is the "parr algorithm" that is given in the following paper

https://ieeexplore.ieee.org/document/613165

This edition is because of @Carl Love commnet.

The paar algorithm is provided in C++ in the following link

https://github.com/rub-hgi/shorter_linear_slps_for_mds_matrices/blob/master/paar.cpp

and is defined by 

My problem is that I couldn't implement the paar algorithm in Maple.

Thanks for any help

 

 

 

Hi,

How can I extract the coefficients of uij in Eq.(3) to form a system of PDEs in F, P and Q?

 

coeff_of_DE.mw

Hello,

I'm trying to verify a computation using maple. But the simplification of Physics doesn't return the right value.

The computation is

I wrote the follow code


 

J[x]^2*J[z]^2+(J[x]*J[z]*J[x])*J[z]+J[x]*J[z]^2*J[x]+J[x]^2*J[z]*J[z]+(J[x]*J[z]*J[z])*J[x]+J[x]^2*J[z]^2 = 3*J[x]^2*J[z]^2+3*J[x]^2*J[z]^2+2*J[x]^2-3*J[y]^2+2*J[z]^2

``

restart; with(Physics)*Setup(noncommutativepre = J)

CommuRules := seq(op([%Commutator(J[j[1]], J[j[2]]) = I*J[j[3]]]), j = [[x, y, z], [y, z, x], [z, x, y]])

NULL

NULL

Setup(CommuRules)

[algebrarules = {%Commutator(J[x], J[y]) = I*J[z], %Commutator(J[y], J[z]) = I*J[x], %Commutator(J[z], J[x]) = I*J[y]}]

(1)

NULL

with(combinat)

np := numbperm([J[x], J[x], J[z], J[z]], 4)

6

(2)

``

``

L := permute([J[x], J[x], J[z], J[z]], 4)

[[J[x], J[x], J[z], J[z]], [J[x], J[z], J[x], J[z]], [J[x], J[z], J[z], J[x]], [J[z], J[x], J[x], J[z]], [J[z], J[x], J[z], J[x]], [J[z], J[z], J[x], J[x]]]

(3)

``

NULL

L2 := seq(map(proc (x, y, z, t) options operator, arrow; x*y*z*t end proc, op(L[i])), i = 1 .. np)

Physics:-`*`(Physics:-`^`(J[x], 2), Physics:-`^`(J[z], 2)), Physics:-`*`(J[x], J[z], J[x], J[z]), Physics:-`*`(J[x], Physics:-`^`(J[z], 2), J[x]), Physics:-`*`(J[z], Physics:-`^`(J[x], 2), J[z]), Physics:-`*`(J[z], J[x], J[z], J[x]), Physics:-`*`(Physics:-`^`(J[z], 2), Physics:-`^`(J[x], 2))

(4)

S := add(j, j = L2)

Physics:-`*`(Physics:-`^`(J[x], 2), Physics:-`^`(J[z], 2))+Physics:-`*`(J[x], J[z], J[x], J[z])+Physics:-`*`(J[x], Physics:-`^`(J[z], 2), J[x])+Physics:-`*`(J[z], Physics:-`^`(J[x], 2), J[z])+Physics:-`*`(J[z], J[x], J[z], J[x])+Physics:-`*`(Physics:-`^`(J[z], 2), Physics:-`^`(J[x], 2))

(5)

NULL

NULL

S1 := Simplify(S, algebrarules)

-(3*I)*Physics:-`*`(J[x], J[y], J[z])-7*Physics:-`^`(J[z], 2)-(8*I)*Physics:-`*`(J[z], J[x], J[y])+6*Physics:-`*`(Physics:-`^`(J[z], 2), Physics:-`^`(J[x], 2))-I*Physics:-`*`(J[y], J[z], J[x])

(6)

NULL

NULL

``


 

Download MapleCode.mw

 


If someone knows, or have suggestions that what i can do to find the right result, plz let me know

I realize that it would be fairly straight forward for me to perform the necessary conversions on the raw data set elements to achieve the same result, but it would be helpful I think if I were able to load the transform into the plot command as I go, basically I want to implement the ability to make additions to the list that is on the coords help page, give the entry a name that plot()  will remember, because I will have commentary data on why I was looking at the plot, what ideas it was relevant to, references etc  and date of entry  etc etc that will also be associated with that name.

Essentially a hint as to where I should start is what I need 

When call_external is a part of a procedure, how does one retrive the code pertaining to the external function being called, and how does maple know what call_external refers to, I thought maybe the packages that have been loaded contain these instructions, how can I retrive the relevant code for a given procedure that contains call_external when 'showstat' is used to inspect a command's maple code?

 

The help page for call_external redirects me to define_external, which is really what I expected to need calling before call_external can take on it's necessary meaning.

First 627 628 629 630 631 632 633 Last Page 629 of 2425