Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Hello All,

 

I am running Maple 18 on Ubuntu 14.04.4 with x86_64 architecture. When running the xmaple command for a specific user, the java loading window takes about 5-10 minutes to appear. With other users, it takes around 15 seconds. All users are running the same xmaple script, I did not see and conflicting environment variables.

 

I was wondering if the community had any other ideas as to what could be causing this slow response?

 

Thank you in advance,

Michael

 

 

 

 

 

 

Hello,

I receive this message when I try to store the package that I have created as a table

 

Do you have some ideas how I can correct my code so as to store efficiently my package ?

Thanks a lot for your help

 

I have an equation as shown below.  In this i need to get the value of 'a' for each 'omega'.  'omega' range from 0 to 2 with increment 0.01

And save all the values of 'a' as a column matrix named 'result'.

 

!!!  Please help  !!!

0.4e-3*a^2*omega^2+(-2.1739*a+a*omega^2+(1.495414012*(sqrt(a^2+.2916)*EllipticE(sqrt(a^2/(a^2+.2916)))-.2916*EllipticK(sqrt(a^2/(a^2+.2916)))/sqrt(a^2+.2916)))/a)^2-0.1e-3 = 0

 

Download problem_1.mw

 

 

Hello,

In a worksheet, I have defined several long procedures. In order to simplify my worksheet, I would like define thes procedures in a package so as to call theses procedures from the package. It should enable to improve the readability of my worksheet.

However, i have never make a custom package. Can you detail me the main steps so as to create a custom package ?

Thanks a lot for your help.

 

I am interested in efficiently plotting a grid of squares where each square is coloured. 

 

From what I understand I can do this using plotting primitives. For example,

P1 := Array( 1..4, 1..2, [[0,0],[1,0],[1,1],[0,1]],storage=rectangular, order=C_order, datatype=float[8] );

P2 := Array( 1..4, 1..2, [[1,1],[2,1],[2,2],[1,2]],storage=rectangular, order=C_order, datatype=float[8] );

PLOT( POLYGONS(P1,P2), COLOUR(RGB,1,0,0,0,1,0)  );

plots one red and one green unit sqaure.

 

I am interested however in plotting millions of squares.  Is there a way to efficiently store the sequence required for the POLYGONS and COLOUR primitive?  Ideally I want to store them as arrays.

Dear All

Is there anybody who is working on contruction of optimal Lie algebra using Maple packages like DifferentialGeometry and LieAlgebra, I tried to find commands for constructing algebra in these packages but could not find such commands. I am sure these are only package that might help me. Following is Lie algebra whose optimal system is required:

 

with(PDEtools, SymmetryCommutator, InfinitesimalGenerator):

S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[8], S[9], S[10], S[11] := [_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 1], [_xi[x] = 0, _xi[y] = t, _xi[t] = 0, _eta[u] = 0, _eta[v] = x], [_xi[x] = 0, _xi[y] = y, _xi[t] = 2*t, _eta[u] = -2*u, _eta[v] = -v], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = t], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = y], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 1, _eta[u] = 0, _eta[v] = 0], [_xi[x] = 1, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 0], [_xi[x] = t, _xi[y] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = 0], [_xi[x] = y, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 2*x], [_xi[x] = x, _xi[y] = 0, _xi[t] = -t, _eta[u] = 2*u, _eta[v] = 2*v], [_xi[x] = 0, _xi[y] = 1, _xi[t] = 0, _eta[u] = 0, _eta[v] = 0]

[_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 1], [_xi[x] = 0, _xi[y] = t, _xi[t] = 0, _eta[u] = 0, _eta[v] = x], [_xi[x] = 0, _xi[y] = y, _xi[t] = 2*t, _eta[u] = -2*u, _eta[v] = -v], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = t], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = y], [_xi[x] = 0, _xi[y] = 0, _xi[t] = 1, _eta[u] = 0, _eta[v] = 0], [_xi[x] = 1, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 0], [_xi[x] = t, _xi[y] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = 0], [_xi[x] = y, _xi[y] = 0, _xi[t] = 0, _eta[u] = 0, _eta[v] = 2*x], [_xi[x] = x, _xi[y] = 0, _xi[t] = -t, _eta[u] = 2*u, _eta[v] = 2*v], [_xi[x] = 0, _xi[y] = 1, _xi[t] = 0, _eta[u] = 0, _eta[v] = 0]

(1)

G[1] := InfinitesimalGenerator(S[1], [u(x, y, t), v(x, y, t)]); 1; G[2] := InfinitesimalGenerator(S[2], [u(x, y, t), v(x, y, t)]); 1; G[3] := InfinitesimalGenerator(S[3], [u(x, y, t), v(x, y, t)]); 1; G[4] := InfinitesimalGenerator(S[4], [u(x, y, t), v(x, y, t)]); 1; G[5] := InfinitesimalGenerator(S[5], [u(x, y, t), v(x, y, t)]); 1; G[6] := InfinitesimalGenerator(S[6], [u(x, y, t), v(x, y, t)]); 1; G[7] := InfinitesimalGenerator(S[7], [u(x, y, t), v(x, y, t)]); 1; G[8] := InfinitesimalGenerator(S[8], [u(x, y, t), v(x, y, t)]); 1; G[9] := InfinitesimalGenerator(S[9], [u(x, y, t), v(x, y, t)]); 1; G[10] := InfinitesimalGenerator(S[10], [u(x, y, t), v(x, y, t)]); 1; G[11] := InfinitesimalGenerator(S[11], [u(x, y, t), v(x, y, t)])

proc (f) options operator, arrow; diff(f, v) end proc

 

proc (f) options operator, arrow; t*(diff(f, y))+x*(diff(f, v)) end proc

 

proc (f) options operator, arrow; y*(diff(f, y))+2*t*(diff(f, t))-2*u*(diff(f, u))-v*(diff(f, v)) end proc

 

proc (f) options operator, arrow; t*(diff(f, v)) end proc

 

proc (f) options operator, arrow; diff(f, u)+y*(diff(f, v)) end proc

 

proc (f) options operator, arrow; diff(f, t) end proc

 

proc (f) options operator, arrow; diff(f, x) end proc

 

proc (f) options operator, arrow; t*(diff(f, x))+diff(f, u) end proc

 

proc (f) options operator, arrow; y*(diff(f, x))+2*x*(diff(f, v)) end proc

 

proc (f) options operator, arrow; x*(diff(f, x))-t*(diff(f, t))+2*u*(diff(f, u))+2*v*(diff(f, v)) end proc

 

proc (f) options operator, arrow; diff(f, y) end proc

(2)

``

 

Download Lie_Algebra_Classification.mwLie_Algebra_Classification.mw

   
 

 

 

   

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(2)
 

``

Regards

The question in the title has been raised before over the years, but has maybe not received enough attention.
Reraising the question was motivated by a comment by Kitonum to a recent post on improved integration results in Maple 2016:
http://mapleprimes.com/maplesoftblog/202910-New-And-Improved-Integration-Results

Consider the following session.
restart;
assume(n=0);
n^2; #Returns n^2
eval(%);#Returns n^2
sin(n*Pi); # Returns 0
sin(n); # Returns sin(n)
eval(%); # Returns sin(n)
ln(n); #Returns ln(n)
ln(n*exp(1)); # Returns ln(n*exp(1))
expand(%); # Error, (in ln) numeric exception: division by zero
ln((n+1)*exp(1)); Returns ln((n+1)*exp(1))
expand(%); # Returns ln(n+1)+1
sqrt(n^2); # Returns 0
sqrt(n); # Returns n^(1/2)
eval(%,n=n^2); # Returns (n^2)^(1/2)
simplify(%); #Returns 0: simplify doesn't help in the examples above.
##################
We see that assume n=0 certainly doesn't imply that expressions always will be evaluated at n=0, but sometimes it appears that it does.
So what is the intended behavior when assuming equality?
##
Several years ago (Maple 14 or earlier) I overloaded assuming so that equality assumptions were handled by eval.
There was a discussion at the time in MaplePrimes about this. Shall try to find the link.

Hi Maple People

 

# Some Maple code
restart
x:= Vector(10):
y:= Vector(10):

for z from -5 to 4 do
   x[z+6]:=z^2 + 40:
   y[z+6]:=z^2 + z + 41:
end do:

plot(x,y,style=point,symbol=asterisk)

 

Regards

Matt

I am faced by the problem where I used Grid:-Seq()---locally---to do some long time computation and I am faced by the exhaustion of memory problem. I think the problem itself is related to the memory management in maple.

So the problematic function is

# Procedure: ComputeEventsCTypeGrid
#   Compute events such that three quadrics intersects in a point.
#
# Parameters:
#   Q          - a set of quadrics
#
# Output:
#   Indexes of quadrics which intersect in a point.
# TODO:
#  - Memory
#  - Cleanups
ComputeEventsCTypeGrid := proc( Q )
  local s, cType, i, j, k, rootNb, univ, sys;
  s := proc (i, j, k)
    sys := [ Q[i], Q[j], Q[k] ];
    univ := PolynomialIdeals[UnivariatePolynomial]( indets( sys )[1], sys );
    if not type( univ, constant ) then
      rootNb := nops(select(proc(x)op(x)[2]>0;end proc,RootFinding:-Isolate( univ, [ op( indets(univ ) ) ] )) ):
      if rootNb > 0 then
        return [ univ, rootNb, sys ];
      end if:
    end if:
  end proc;
  cType := [Grid:-Seq(seq(seq(s(i,j,k),k=j+1..nops(Q)),j=i+1..nops(Q)),i=1..nops(Q))];
  return cType;
end proc:

A dump from top after calling ComputeEventsCTypeGrid for some data(total amount of memory on this machine is 251G + 48G swap)

VIRT    RES    SHR S  %CPU %MEM     TIME+

33.007g 0.031t   3676 S   0.0 12.5   2606:20
31.137g 0.029t   3436 S   0.0 11.7   2274:34
8645756 4.984g   2840 S   0.0  2.0  32:06.40
28.798g 0.026t   1968 S   0.0 10.7   1821:16
26.650g 0.024t   1968 S   0.0  9.8   1520:54
25.346g 0.023t   1968 S   0.0  9.2   1236:44
23.296g 0.021t   1968 S   0.0  8.4   1004:52
20.498g 0.018t   1968 S   0.0  7.4 790:30.81
16.799g 0.014t   1968 S   0.0  5.9 625:28.12
15.011g 0.013t   1968 S   0.0  5.2 469:36.27
7678444 4.149g   1968 S   0.0  1.6 104:34.22
6734804 623904   1968 S   0.0  0.2  73:13.13
4327420 132516   1968 S   0.0  0.1  24:11.51
3420712 111336   1968 S   0.0  0.0  11:26.16
13.671g 0.011t   1964 S   0.0  4.6 380:15.13
11.771g 9.831g   1964 S   0.0  3.9 274:25.59
9936056 7.769g   1964 S   0.0  3.1 201:13.94
8805512 3.394g   1964 S   0.0  1.3 148:09.53
5077056 1.500g   1964 S   0.0  0.6  42:19.29
2384784  82040   1832 S   0.0  0.0   3:56.57

Size of output data calculated with

> length(sprintf("%m", eval(cType)));

> 326260610

Also, I called gc() at the end of the computations but memory allocated by instances of mserver were not released. Does it mean gc() should be called from each instance separately? My final point is that I have to run some other calculations for different and bigger dataset (It will probably take 2 days to finish -- Q has around 700 polynomials of degree 2) and for this moment I cannot do this because I've gotten an error about not enough amount of memory.


with(PDEtools, casesplit, declare)
``

L := 1651.12; m := 3205.12; r1 := .1875; r2 := 2; z1 := 0; z2 := 12; ld := 4.5

NULL

declare(u(r, z), w(r, z))``

with(DEtools, gensys)

rr := (L+2*m)*(diff(u(r, z), r))+L*(diff(w(r, z), z))+L*u(r, z)/r

zz := L*(diff(u(r, z), r))+(L+2*m)*(diff(w(r, z), z))+L*u(r, z)/r

rz := m*(diff(u(r, z), z))+m*(diff(w(r, z), r))

BCS := {rr(r1, ld) = 0, rz(r1, z) = T, w(r, 0) = 0, zz(r, z2) = 0}

{3205.12*(diff(u(r, z), z))(.1875, z)+3205.12*(diff(w(r, z), r))(.1875, z) = T, 8061.36*(diff(u(r, z), r))(.1875, 4.5)+1651.12*(diff(w(r, z), z))(.1875, 4.5)+1651.12*(u(r, z))(.1875, 4.5)/r(.1875, 4.5) = 0, 1651.12*(diff(u(r, z), r))(r, 12)+8061.36*(diff(w(r, z), z))(r, 12)+1651.12*(u(r, z))(r, 12)/r(r, 12) = 0, w(r, 0) = 0}

(1)

``

NULL

sys3 := [(L+2*m)*(diff(u(r, z), r, r))+(L+m)*(diff(w(r, z), r, z))+(L+2*m)*(diff(u(r, z), r))/r-(L+2*m)*u(r, z)/r^2+m*(diff(u(r, z), z, z)) = 0, (L+m)*(diff(u(r, z), r, z))+m*(diff(w(r, z), r, r))+(L+2*m)*(diff(w(r, z), z, z))+(L+m)*(diff(u(r, z), z))/r+m*(diff(w(r, z), r))/r = 0]

pdsolve(sys3, BCS, numeric)

 

 

``

``


Download PDE_equation2.mw

Hi all,

I have the following PDE, is it solveable by Maple or not. Do I need a boundary condition and how many or I can get a general solution? I am new to Maple. Any help will be appreciated.

Thank you.

 

 

 

Hi everyone. This problem is driving me nuts. I'm pretty sure it's a glitch but I'm not sure how to solve it. I'm trying to do some data analysis with Maple:

(as a side note, even if I remove the for loop but don't execute the restart command the error remains, however if I get rid of the for loop and execute the restart command it is fine.)

Any help would be greatly appreciated. As it stands this is really driving me insane.

How can I quickly  convert a maple file ful of equations into MathML in Word, nt losing the upper and lower index structure - basically to be able to count each letter in MS Word 2013?

When I tried via Latex or MathML, I have lost the letter structure and got the conversion as an image.

 

Hello,

I have still some difficulties to conduct some specific trigonometric simplications but which are very common in mechanism study.

The equations are in the form :

sin(gamma0(t))*cos(beta0(t)) = -(sin(psi[1](t))*cos(theta[1](t))*cos(gamma[1](t))+sin(psi[1](t))*sin(theta[1](t))*sin(gamma[1](t))-cos(theta[1](t))*cos(psi[1](t))*sin(gamma[1](t))+cos(psi[1](t))*sin(theta[1](t))*cos(gamma[1](t)))*cos(beta[1](t))

I would like to obtain this equation after simplifications :

sin(gamma0(t))*cos(beta0(t)) = cos(beta[1](t))*sin(gamma[1](t)-theta[1](t)-psi[1](t))

I try to make a procedure to automatize the simplification of this kind of trigonometric equation.

Strangely, I noticed that the simplification is done only if there is a minus before the combine function. The simplification works but the result is wrong because i didn't obtain the good sign.

For you information, I try to make these simplifications with MMA and the FullSimplify function of MMA gives directly the expected result that is to say :

I'm sure that it shoud exist a good way to conduct this kind of simplications in Maple.

Can you help me to correct my procedure so to obtain the good result and be enough general, adaptative ? 

Code here and attached in this post :

Initialisation
restart:
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
with(MathML):
with(ListTools):
constants:= ({constants} minus {gamma})[]:
`evalf/gamma`:= proc() end proc:
`evalf/constant/gamma`:= proc() end proc:
unprotect(gamma);
Angular Constraint equations
eq_liaison:=sin(gamma0(t))*cos(beta0(t)) = -(sin(gamma[1](t))*sin(psi[1](t))*sin(theta[1](t))-sin(gamma[1](t))*cos(theta[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t))*cos(theta[1](t))+cos(gamma[1](t))*cos(psi[1](t))*sin(theta[1](t)))*cos(beta[1](t)); 
Traitement
TrigoTransform2:= proc(Eq)
local S,S1,tt,pp,Eq2,ListVariables,ListVariablesMod,Subs,size,rhsEq2,lhsEq2;
#Construit une liste à plat#
ListVariables:=indets(Eq, function(identical(t)));
ListVariables:=[op(ListVariables)];
ListVariablesMod:=map(f->cat(op(0,f),_),ListVariables);
Subs:=ListVariables=~ListVariablesMod;
#Variables Changement#
Eq2:=Eq:
print("Equation traitée=",Eq2): 
Eq2:=subs(Subs, Eq2);
print("Equation après subs=",Eq2): 
#Trigonometric transformations#
lhsEq2:=applyrule([
cos(u::anything)*cos(v::anything)-sin(u::anything)*sin(v::anything)=cos(u+v), 
cos(u::anything)*sin (v::anything)+sin(u::anything)*cos(v::anything)=sin(u+v), 
sin(u::anything)*sin(v::anything)-cos(u::anything)*cos(v::anything)=-cos(u+v), 
-sin(v::anything)*cos(u::anything)-sin(u::anything)*cos(v::anything)=-sin(u+v)], simplify(lhs(Eq2), size));
print("Equation lhsEq2 première analyse=",lhsEq2):
rhsEq2:=applyrule([
cos(u::anything)*cos(v::anything)-sin(u::anything)*sin(v::anything)=cos(u+v), 
cos(u::anything)*sin (v::anything)+sin(u::anything)*cos(v::anything)=sin(u+v), 
sin(u::anything)*sin(v::anything)-cos(u::anything)*cos(v::anything)=-cos(u+v), 
-sin(v::anything)*cos(u::anything)-sin(u::anything)*cos(v::anything)=-sin(u+v)], simplify(rhs(Eq2), size));
print("Equation rhsEq2 première analyse=",rhsEq2):
try
lhsEq2:=(trigsubs(2*combine(lhsEq2))[])/2;
print("Equation lhsEq2=",lhsEq2):
catch:
lhsEq2:=lhs(Eq2);
end try;
try
rhsEq2:=(trigsubs(-2*combine(rhsEq2))[])/2;
print("Equation rhsEq2=",rhsEq2):
catch:
rhsEq2:=rhs(Eq2);
end try;
Eq2:= lhsEq2=rhsEq2;
#Variables Changement#
Eq2:=subs(map(t->rhs(t)=lhs(t),Subs),Eq2) 
end proc:
TrigoTransform2(eq_liaison);

TrigoTransformEqAng2_anglais.mws

Thanks a lot for your help.

Hi all,

Please help to plot radial solution "U" in n-sphere of radius "R"   such that

R in [0,1] and "t" is a parameter varying in [-1,0[. I started with

restart; n:=3: Sn:=2*Pi^2:
R0:=(n+2)*sqrt(8*Pi/2*Sn); p:=-2*n/(n+2):
U := unapply(piecewise(R<R0, (-t)^p*(R0^2-R^2)/(n+2), 0), R);

Thanks in advance.

Hi all,

 

I have recentry constructed Fourier amplitude and Fouier Power graphs which are plotted against the frequency of the oscillations, like the picture below.

 

I would like to change the frequency scale along the x axis into a period scale in order to Fourier analyse future ODE systems in  terms of period rather than frequency.

But I unsure how to manipulate my code to do so.

 

Any help would be much apreciated, and the Maple file that I am using is attached.

 

Thanks in advance!

 

Fourier_with_Period.mw

 

 

First 168 169 170 171 172 173 174 Last Page 170 of 334