Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have tried to compile a simple program looking for counterexamples to a conjecture by Goldbach that every odd number is a sum of a prime and twice a square. Stern gave the counterexamples 5777 and 5993 a long time ago, so this is mainly for instruction purposes.

My program

othergoldbachFCi:=proc(sieve::Array(1..10000,datatype=integer[4]))
   local i,j,M; 
   M:=10000;
   for i from 1 to M do
      if(sieve[i] mod 2=0) then 
         for j from 1 to iquo(M-i,2*i+1) do 
            sieve[i+j*(2*i+1)]:=2*iquo(sieve[i+j*(2*i+1)],2)+1;
         end do; 
         for j from 1 to floor(sqrt(M-i)) do 
            sieve[i+j*j]:=2+sieve[i+j*j] mod 2;  
         end do;
      else 
         if(sieve[i]<2) then 
            printf("%d is a counterexample\n",2*i+1); 
         end if; 
      end if; 
   end do; 
end proc;

works fine and compiles without problems. (I have to pass the array for the sieve because compiled program cannot declare memory, and it has to be 4 bytes even though I only need to use the lower 2 bit).  But the compiled version breaks with

   Error, (in compiledOGi) array index out of bounds

 

already in the first instance of the for loop. After a lot of trial and error I found out that if I replaced the line 

   sieve[i+j*j]:=2+sieve[i+j*j] mod 2;  

by

   temp:=iquo(sieve[i+j*j],2);
   sieve[i+j*j]:=2+(sieve[i+j*j]-2*temp);  

 

then the problem goes away and the compiled version works beautifully. It is not enough to do the mod 2 computation in temp, and not enough to replace mod by iquo in one line. 

This makes very little sense to me. Can anybody explain? I'm still using Maple 2016 and do not know if the issue has been resolved in Maple 2017.

 

Best,

Soren

 

 

The equation
                     -sqrt(k x) = sqrt(k x)
 is solved correctly by Maple:

solve(-sqrt(k*x) = sqrt(k*x));
                 {k = k, x = 0}, {k = 0, x = x}

However, the equation
                 -sqrt(k x) = sqrt(k x + k - 1)
 is apparently not solved correctly:

solve(-sqrt(k*x) = sqrt(k*x+k-1));

                         {k = 1, x = x}
The variable
                               x
 can not be arbitrary since this equation reduces to the former equation
-sqrt(k*x) = sqrt(k*x);
 when  k = 1
.

Maple should return something similar to (4) below.

eval(-sqrt(k*x), k = 1) = eval(sqrt(k*x+k-1), k = 1);
                          (1/2)    (1/2)
                        -x      = x    
solve({-x^(1/2) = x^(1/2)});
                            {x = 0}

Can this be explained in some way, or is this a bug?

Hi everybody,

I am presently developing a MAPLE-based application and I need to trace its evolutions through a “version control process”.
For codes written in other languages I use to use GIT (it acts with text files and it has syntactic coloring for different languages).

I suspect the development teams routinely face this version control issue.
Could you advise me,  on the versioning tools you use ?

Great thanks in advance

Let be the number z so that |z+3-2*I| + |z-3-8*I| = 6*sqrt(2). Find min and max of the modulus of z. How can I find min and max of modulus of z with Maple.

Thank for your help!

Hi every body,

I have a function "p(v,T)" which I evaluated its critical point. after calculating when I want to plot diagram of "p-v" for some values of "T" around critical value of "T" I expect the shape of diagram for "T" bigger and smaller than critical value of "T" be different. but it not happened. Are here anyone can help me? The function "p(v,T)" is in the file. if you want calculate critical point and check I am right or wrong. Thanks criticalpoint.mw


 

restart

eq := diff(y(t), t, t)+9*y(t) = Dirac(t)

diff(diff(y(t), t), t)+9*y(t) = Dirac(t)

(1)

with(inttrans):

icon := y(0) = 0, (D(y))(0) = 0;

y(0) = 0, (D(y))(0) = 0

(2)

dsolve({eq, icon}, y(t), method = laplace);

y(t) = (1/3)*sin(3*t)

(3)

dsolve({eq, icon}, y(t));

y(t) = (1/3)*(Heaviside(t)-1/2)*sin(3*t)

(4)

``


 

Download Dirac_for_Primes.mw

Hi,

I want to know is maple helpful to find a cjange coordinate to transform an old coordinate to a new coordinate? details are attached to the file:

changecoor.mw

Thanks guyz

Hi everyone,

I have a functional "L" which I want to solve Euler-Lagrange for it and then extermise that functionalexfun.mw by its equation of motions. I know the result must be same to a function like "A" but I cant obtain that. "a", "b" and "s" are constants and not important, I insist more on the shape of "A"

 

Thanks a lot

i am new user in maple .i want to calculate eigenvalues of a symmetrix matrix to find max or min value but i usually face a error code ' (in simpl/max) complex argument to max/min'

i know that a symmetrix matrix have real eigenvalues.

for example:
restart:with(LinearAlgebra):with(GraphTheory):interface(rtablesize=infinity):
SeidelMatrix:=proc(G::Graph) local J,B,A,S;
J:=Matrix(1..NumberOfVertices(G),1..NumberOfVertices(G),shape=constant[1]):
B:=IdentityMatrix(NumberOfVertices(G)):
A:=AdjacencyMatrix(G):
S:=J-B-MatrixScalarMultiply(A,2):
convert(S,Matrix,shape=symmetric,datatype=float):
return S:
end proc:
E:=sort(eval(Eigenvalues(SeidelMatrix(CycleGraph(7)),output='list'))):
(min,max)(E);
Error, (in simpl/min) complex argument to max/min: (1/3)*(-28+(84*I)*3^(1/2))^(1/3)+(28/3)/(-28+(84*I)*3^(1/2))^(1/3)-1/3
 

 

I am trying to evaluate the following summation which gives the result 0. But I think answer is not correct.
 

restart; x := 0; evalf(Sum(Sum(x^(q-p), p = 0 .. q), q = 0 .. 10))

0.

(1)

``


 

Download zero.mw

is it possible to change ODE to PDE?

the ODE has diff(a(t),t) and diff(b(t),t)

how to convert to diff(t, a), diff(t, b) ?

Is there a built-in function in Maple 2015 that identifies and prints prime numbers in a specified integer range?

I've developed a framework in Maple for playing with cyclic division algebras. I have methods for multiplication and passing to and from:

The standard basis over the base field in terms of x^i*y^j and:
The standard matrix basis for the central simple algebra when taking coefficients in the splitting field.

I have it done in the case of degree 7, but could generalise it to any prime degree if this is of use to anyone.

Hi

How can I write and solve a dirac_delta function in maple, for example in below equations:

F[0]:=0;
F[1]:=a;
F[2]:=b;

eq1:=sum((k-m+2)*(k-m+1)*F[k-m+2]*Dirac[m-1], m = 0 .. k);

eq2:=(k+1)*F[k+1]-Dirac[k];

for k from 0 to 10 do
F[k+3]:=solve(F[k+3]=(eq1+eq2)/((k+3)*(k+2)*(k+1)),F[k+3]);
end do;

Hi everybody,

I'm kind of new to Maple and i'm trying to solve a system of trigonometric equations inequality as follow:

f:= {((2*a*sin(S)*cos(S)^(2)))/(1-sin(S)^(3))<1,90> S>-90,a>1};

solve(f,{a,S});
Error, (in PiecewiseTools:-Convert) unable to convert

 

How can I solve the system?

Thanks a lot.

First 954 955 956 957 958 959 960 Last Page 956 of 2224