Maple 2017 Questions and Posts

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

Hello,

I have created my own costume package inspired from an already existing one but this package relies and uses many functions from the original package which I used to create mine. The question: is there an easy way to automatically import all the needed functions and commands from the original package without having to write the name of the original package followed by the name of each function or command ( which is really laborious and hard to complete) ?

Thank you

Hello, 

 I created my own costum package and I want to edit this package: insert procedures or modules. Is there a way?

Thank you.

Hi, 

I am interested to find the primes in in field Zp which Have prime inverses.  In particular, for any prime p up to an arbitrary number N, the number of pairs (a,b) where a and b are mutually inverse primes <p in Zp. Obviously in this context (a,b) is the same as (b,a) so no need for double counting. What I have so far is the following simple code for finding the inverse of prime q<p, given a chosen value of p. I can then see which results are prime and which are composite.

N:=p:

for n from 1 to N do

X:=q*n-1;

if mod(X,p)=0 then print(n);

end if:

end do:

This “hand cranking” method works but is of course boring but I don’t know how to scale it up to a more efficient code as described above. I would be grateful to anyone  able to assist me with this.

Thanks in advance

David

Hello everyone,
My name's Rafael, I am a master's student in Dentistry in Brazil.
I need your help.
I have several points with X, Y and Z coordinates. I would like to create a curve that represents these points in a 3-dimensional plane.
I'm new using Maple and managed to use the "plots [pointplot3d]" function to represent the points in the chart. However I have a list in excel with several point (over 100) and would like to know how to import these points to use this function.
Thank you very much
 
 
 

 

In ScientificConstants, the density of carbon is given as 2.2 g/cm^3. That happens to be the value for graphite. Carbon comes in different states with different density, diamond being one of them, amorphous being another. Is this somewhere in ScientificConstants where just I cannot find it, or is it not there?

TIA,

M.D.

PS: I do know the values and where to find them (Particle Data Group). I'd like to use ScientificConstants so I can write a more general piece of code.

The curve is defined by

I am trying to add a specific property (radiation length) to the Elements in ScientificConstants.

To do this  I first 

ScientificConstants:-AddProperty(radiationlength); # this seems to work

I then load a table of element name - radiationLength pairs (it is really a bigger table but only these are of interest):

data:=ImportMatrix(cat(libname[1],"/RadiationLengthTable.txt"),source=delimited,\
                       datatype=anything,delimiter="\t"); # works too

(I made the file using downloaded data).

I then want to fill the radiationlength properties for all elements for which I've got the value:

for i from 1 to LinearAlgebra:-RowDimension(data) do
  elemt:=data[i,1]; # the element name as a string
  ScientificConstants:-ModifyElement(cat(elemt),radiationlength=[value=data[i,4],units=g/cm^2]);
end do;

which fails with the error

Error, (in ScientificConstants:-ModifyElement) element ``H `` is not known

H is the first element in the table of radiation lengths so it is getting the right one.

At  issue is that somehow the element name (called descriptor in the Help files) does not seem to get properly evaluated. In fact I tried various ways "by hand", none except just the unevaluated element name (i.e H,He etc. worked).

There must be a way to set these in a loop. Does someone know how?

TIA,

Mac Dude

 

 

I am writing a small code to find median and mean. The code works for an even number of terms, not for an odd number of terms. I tried to find the error but cannot.

restart:medianmean:= proc(x) local a,b,c,d,m,g;
a:=sort(x); b:=nops(x); c:=nops(x)/2; d:=(nops(x)+1)/2;
m:=(a[c]+a[c+1])/2; g:=add(a)/b;
if (b mod 2 = 0) then evalf([a,m,g]) ;
else evalf([a,a[d],g]);
end if; end proc:

 

I am not sure why I am getting this RootOf result when I solve for x.

Here is my code.

restart:
eq:=4*x^2+2*y(x)^2=32.5625:
deq:=solve(  diff(eq,x), diff(y(x),x) ):
deq=3;
y(x)=solve(deq=3,y(x));
x=solve(deq=3,x);

The last equation we are solving is  -2x / y = 3.
So we should get y  = -2/3 x and  x = -3/2 y.

The Maple software correctly solves for y in terms of x,
but gives an odd Rootof answer when solving for x. Why is that?

I am not sure how to intepret RootOf(2*_Z+3*y(_Z)).

Dear All,

I have two beta distributed r.v. as:

p1 := RandomVariable(BetaDistribution(1, 100));

p2 := RandomVariable(BetaDistribution(1, 50));

my Maple stucks when i try to calculate numerically:

evalf(int(z*PDF(0.3*p1+0.7*p2, z), z = 0 .. 1))

Any help to speed this up or other solutions?

It seems PDF(0.3*p1+0.7*p2, z) is the pain.

Thanks!

 

 

I need to simplify a differential equation by ignoring higher order terms. The terms are of the following form:

180.495*theta_dot*beta_dot*zeta_dot*psi_dot*sin(beta)*cos(delta__3)*sin(delta__3)^3*zeta_dot*cos(zeta)*zeta*beta*sin(psi)*p

Here beta, zeta and theta are hinge deflections for a helicopter blade and thus can be assumed to be small. Everything other than delta__3 is a function of time, _dot represents a derivative wrt time. Higher order terms, such as those containing betan, zetan, thetan where n > 1, and terms containing combinations of the hinge deflections, i.e. betaj.zetak, betaj.thetak or zetaj.thetak where j,k >= 1 need to be neglected. Since beta, zeta and theta are functions of time, and the equation contains derivatives, maple functions like 'degree' and 'match' don't seem to work. Also, the solution suggested over here does not seem to be suitable for this problem, since my equation is very long (~70 pages) and the various derivatives appearing in it are not known.

Thanks in advance!

 

 

Hi. I wrote a command for finding second derivative.

#secondderiv test of f(x,y)
f:=x^2+2*x*y+2*y^3:
Gradient(f,[x,y]);
soln:=solve(Equate(Gradient(f,[x,y]),<0,0>));
H:=hessian(f,[x,y]);
seq([subs(soln[k],eval(H)),det(subs(soln[k],eval(H)))],k=1..nops(op(soln)))

Everything runs fine ... except if I change the function f to
f:=x^2+2*x*y+2*y^2
Then I get error :
Error, invalid input: nops expects 1 argument, but received 2

I sort of understand the error, when there is a single solution
{x=0,y=0} , then the op removes the parentheses to get x=0, y=0
which is now two arguments, and nops requires one argument.
I tried to use  nops(op({soln} ) , but that is not the correct approach
since it overcounts. Also it throws an error if change back f to the original expression.


 

 

 f(a)(x) = a*x mod 256  for all x in Z[256]

3 4 5 6 7 8 9 Last Page 5 of 32