Maple 2017 Questions and Posts

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

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]

I am a little bit clueless here, about how to use maple to calculate Christoffel symbol and Ricci tensor and scalar?

 

I read the help, but it got me confused; I have the metric ds^2 = du*dv+F(y,z)du^2+dy^2+dz^2

It's not Minkowski nor Cartesian, so how to use maple to calculate these symbols?

 

I am sure it's easy, but I didn't quite follow maple's instructions.

 

Hello!

I am interested in plot the so-called "free space diagram", please see https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance for a formal definition. Essentially, given two curves (i.e., two polygonal from [0,1] to the plane) the "free space" is the points (s,t) in the square [0,1]x[0,1] such that the distance from P(s) to Q(t) (if P and Q are the parametrizations of the curves) is less or equal than a prefixed epsilon>0. An image can be the following (the free space is, in the image, the area not colored in black):

 

 

I have found nothing about this topic in Maple, any suggestion will be welcome!

 

Thanks!

 

In Maple 2017, a simple one-liner can crash the current worksheet (in any mode with any text type it seems).

z[x]:=z

z[x]:=z(x)

Note that z and x can be any two letters, and that you can replace z[x] with the equivalent z+(ctrl shift _)+x (which displays as zx)

Hi all. I have two questions about polynomials over Q.

i) Let f,g be polynomials over Q. How to show (with Maple) that the decomposition field of f is included in the decomposition field of g?

ii) Let f be a polynomial of degree n  over Q with Galois group C_n, the cyclic group of order n. Then, there is a polynomial P with coefficients in Q, of degree n-1, s.t. the iteration: u0=some root of f, u_{k+1}=P(u_k) gives all the roots of f; how to find P (with Maple)?

Thanks in advance.

How do I plot just 10 points of the equation?

I got ..

with(plots):
a := x+2*y = 3;
implicitplot(a, x = -5 .. 5, y = -5 .. 5, style = point);
 

but I only need 10 points. How do I do that? Thank you

 

I would like to use Gröbner's method to study polynomial systems (with equality or (and) inequalities) in the case where the variables are REAL. It is known that in general the problem is much more complicated than in the complex case; in particular it is necessary to use gradient methods.
In Maple, we can use the patch "Raglib" (Lip6 laboratory). However "with (RAG)" does not work very well, even for "simple problems" like this one: the $ 9 $ real unknowns are $ X = [x_ {i, j}] \ in M_3 (\ mathbb {R} $. The  system to satify is $ X ^ TX = I_3, x [1,1] <1 / 2,3 / 10 <x [2,3] $, that is, $6$ polynomial equations and $2$ inequalities; clearly, a particular solution is a permutation of the canonical basis. The "HasRealSolutions" command does not provide any result after 2 hours 15 minutes of calculation. The "PointsPerComponents" command indicates that there are no solutions... 
It seems to me that we can also use "RegularChains" but I am not familiar with this library.

  Have you any ideas on these questions? Thank you in advance.
 
4 5 6 7 8 9 10 Last Page 6 of 33