Maple 2017 Questions and Posts

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

I initialized a variable name using another variable name and := . I thought that Maple would assign the value, but I soon learned by debug that the address was assigned. This led to temporary problems.

 

Where can I learn the rules that Maple follows for assignment by value or address ?? Do I always have to initialize with a real number, like 0, to be safe ??

Thanks.

Mike Graber

Hello (again)

I thought I won't need help with that type of question but I came across an example that says otherwise.  Here it is

vars:=[x,y,z];

model7 := [x*(-RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4)+y*alpha[1, 2]-33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), x*z*alpha[2, 6]+y*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561), x^2*(17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6])-17*x*y/alpha[2, 6]+2*z*x-z-(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6])]

then I issued the command 

map(w->coeffs(w,vars),model7);

to get 

 

[-33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), -RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4, alpha[1, 2], RootOf(64*_Z^3+80*_Z^2+1104*_Z+561), alpha[2, 6], -(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6]), -1, (17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6]), -17/alpha[2, 6], 2]

clearly the order does not follow model7's.  

I have also tried

[seq(coeffs(expand(model7[i]), indets(model7[i], suffixed({vars[]}))),i=1..nops(model7))];

Is there a solution to it?

Many thanks (again)

 

Ed

 

 

I would like to analyse the graph I made and I cannot seem to find any command that gives me the average path length of an unweighted graph, is it perhaps referred as a different command? As I have tried searching Mean path length, distance and other derivatives with no useful result.

Hello

I have the following set of coefficients 

coef7 := [-1, 2, alpha[1, 2], alpha[2, 6], (17*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)+17)/(alpha[1, 2]*alpha[2, 6]), -17/alpha[2, 6], -33/(32*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)), -(163/32+RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)^2+5*RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)*(1/4))/(alpha[1, 2]*alpha[2, 6]), -RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)-5/4, RootOf(64*_Z^3+80*_Z^2+1104*_Z+561)]

 

Considering that alpha[1,2] and alpha[2,6] are always real, how can I extract only the real solution from coef7?  

Many thanks.

 

Ed

Hello

I need to count and separate the nonlinear terms in a list.  Example:

w:=[[z, y, x, 1], [x*z, x*y, y, 1], [x*z, z, x*y]];

there are 4 nonlinear terms, x*z, x*y, x*z, and x*y.  

The terms can be any combination of the given variables, that is, x, y, and z.  

My solution to the problem of counting the nonlinear terms is 

aux1:=[seq([seq(nops(w[j,i]),i=1..nops(w[j]))],j=1..nops(w))];

aux2:=[seq(selectremove(x->x>1,aux1[i])[1],i=1..nops(aux1))]

res:=convert([seq(convert(nops(aux2[i]),`+`),i=1..nops(aux2))],`+`);

It works but I wonder whether there is a better solution that includes showing the nonlinear terms themselves.

Many thanks

Ed

My colleague and I are revising a paper which contains some 3dplots generated I think originally in Maple 2015 on macos as eps converted to pdf.  Originally they were around the 100 KB size.  When I generate them again in Maple 2017 they are more like 10 MB.  He is still running Maple 2015 and get the same 100 KB size.  Any idea what is going on here ?  

Thanks Michael

EDIT:  An example is 

with(plots);
plotsetup(postscript, plotoutput = `test.eps`, plotoptions = `color,portrait,height=350,width=350`);
plot3d(x^2+y^2+1, x = -1 .. 1, y = -1 .. 1, axes = boxed, grid = [200, 200]);

I get 7.6 MB my colleague with Maple 2015 gets 56 KB.  I tried it wtih Maple 2017 on a server I have access to also 7.6 MB.

my_euler := proc (func_y, x_value, y_value, n, h) 
local point_list, d_x, true_f, true_f_v; point_list := [10^(-n), 0, n]; 
true_f := unapply(func_y, x, y); 
d_x := abs(point_list[2]-point_list[3]); 
while d_x < point_list[1] do 
    true_f_v := true_f(x_value, y_value); 
    y_value := y_value+h*true_f_v; 
    x_value := x_value+h 
end do; 
return y_value 
end proc

I am using Maple to implement Euler's method, it requires 5 parameters:

  • func_y (The general form of ODE)
  • x_value
  • y_value
  • n (The accurate digits, I do not know how to control the accurate digits)
  • h (The step size)

So, I do not how to control accurate digits (4 accurate digits), can you teach me how to finish this part?

Hello.

I'd like to extract numerical data from the plot of a implicit function and write it to the txt file. But, unfortunately due to a strong oscillating function and as a consequence extremely dense meshgrid I got a message that [Length of output exceeds limit of 1000000]. How to resolve this problem? Below is my code

restart;
R0 := 1+w_c*(sum((2*(-1)^(n+1)*Pi^2/n*n)*t*sin(2*Pi*n*mu/w_c)*cos(Pi*n)*exp(-2*Pi*n*G/w_c)/(w_c*sinh(2*Pi^2*n*t/w_c)), n = 1 .. 3000))/Pi-mu;
with(plots, implicitplot);
G := 0.; t := 0.1e-2;
R1 := implicitplot(R0, w_c = 0 .. 5, mu = 0 .. 3, gridrefine = 10):
data := getdata(R1);

Thank you in advance.

Consider two polynomials p and q in t. For example, p(t)=t^2+2*t and q(t)=t^3*(t+2). I want to find Gcd(p,q). But before I find it, solve an inequality and obtain that t<>-2. After that when I evaluate Gcd(p,q), I dont want maple to return t*(t+2) as Gcd because t<>-2 and thus the factor (t+2) is an unwanted common divisor. Is there a way to tell maple that "find the Gcd over a spesific domain". Because, otherwise maple needlessly spend time for finding the gcd. Any help would be appreciated.

I have a bivariate polynomial in x,y,say P, and a parameter, say d, appears in P. I want to find d for which P has at least one non trivial factor. Is there  a fats way to do this in maple. Any help would be appreciated.

Hello everyone,

I have the following problem:

I have an array of data dataarray[i,j,k] whose elements are either 1 or -1. I also have three vectors x[i], y[j] and z[k] (the axis).  I want to represent the data of dataarray so I have two different volumes: A green volume such as dataarray(x,y,z)=1 and a red one with dataarray(x,y,z)=-1. Is that possible? In case that it is, how can I do that?

Thank you very much in advance

Hello

Although I am (remotely) running the following piece of code in a linux machine with 256 GB of ram, the error msg "Execution stopped: Stack limit reached" comes out 

 

kernelopts(stacklimit);
NestList:= proc(f, x, n::nonnegint)
local R:= rtable(0..n, [x]), k;
   for k to n do R[k]:= simplify(f(R[k-1])) od:
   [seq(R)]
end proc:
n:=34;
yreal:=NestList(y-> 4*y*(1-y),1/8,n):

I have tried to increase stacklimit issuing the command "kernelopts(stacklimit=256000)" but to no avail.  Is there anything else I can do?  A similar code run successfully in a mac with Mathematica. 

Many thanks 

Ed

 

PS. The default kernelopts(stacklimit) shows 8192 on the linux machine and  but 32736 on the mac pro.  I was expecting a higher number on the linux machine.  

 

Hello

I need to add a legend to a figure using dataplot (I am not even sure that is the right option).  In what follows I show what I did.

 

dataplot([28,28,28],[.6481496576, .648149657615473, .6512873548],style='point',colorscheme=["Blue","Orange","Red"],	
labels = ["k", "y(k)"], legend = ["10-digit precision", "15-digit precision", "Floating-point iteration"] ,legendstyle = [font = ["HELVETICA", 9], location = right]);

The outcome is

As can be seen some parts of the legend are missing.

 

How can I get this right? Do I have other ways to do the same thing?  

 

Many thanks

 

Ed

 

We can say that prime p is a partition prime of n if there is at least one prime partition of n having p as least part. Example 8=3+5 so 3 is a partition prime, but 5 is not.
 

Furthermore, say that p is a singular partition prime if there is one and only one partition of n with p as least part. I am trying to find numbers n for which the set Q(n) of singular partition primes is {phi}. That is to say, if we take any prime partition of n, then there are at least two partitions associated with its least member. I find so far only two examples: 63 and 161. Clearly no such n can be prime because then n is a singular partition prime of itself (Incidentally, primes having only themselves as singular partition primes are: 2,3,7,13,23,31,41,79,101,107,149..).

I am asking for a code to compute more terms for the case Q(n)={phi}. 

Thanks in advance

David. 

Error, (in PDEtools/NumerDenom) invalid input: `PDEtools/NumerDenom` expects its 1st argument, ee, to be of type algebraic, but received {[(s_j*e^sigma*b^m*`σ_m`*y_i-s_j*e^sigma*beta*`σ_i`+s_j*e^sigma*b_ilo+(1/2)*b^(m+2)*`σ_j`*e^sigma*`σ_m`*y_i-b^2*`σ_j`*e^sigma*beta*`σ_i`+(1/2)*b^2*`σ_j`*e^sigma*b_ilo-(1/2)*b^(2*m)*`σ_m`^2*b_j*e^sigma*y_i+(1/2)*b^m*`σ_m`*b_j*e^sigma*beta*`σ_i`-(1/2)*b^m*`σ_m`*b_j*e^sigma*b_ilo+b_j*(s_ilo+(1/2)*(b^2*`σ_i`-b^m*`σ_m`*beta)*_lo)+b_j*(s_jlo+(1/2)*(b^2*`σ_j`-b^m*`σ_m`*beta)*_lo)+s_i*e^sigma*b^m*`σ_m`*y_j-s_i*e^sigma*be... when I use simplify I have this error. please guide me Saberali
1 2 3 4 5 6 7 Last Page 2 of 37