acer

32470 Reputation

29 Badges

20 years, 4 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Regnar Andersen No, it's not enough to support the operating system. The executables also need to be compiled with the ARM CPU as target. That might well involve considerable effort.

Anyway... I'd be far more interested in Maple's kernel on ARM chromebooks and phones than I would be about it on the Pi.

(I'm also waiting for the world's infatuation with thin clients and the cloud to end.)

@David Sycamore He means that if you made the retro-edit for the ++ syntax, and if you also actually include and execute the code for procedure PP, then his P and PPrime procedures produce that output in Maple 2017.

If you forget to include and execute the code for PP then PPrime will not return false as desired, and all you'll get from P(50) are the primes from to 2 to 47.

restart;

kernelopts(version);

`Maple 2017.2, X86 64 LINUX, Jul 19 2017, Build ID 1247392`

PP:=proc(n::posint, kmin::posint, L::list(prime), nSolMax::posint)
# Prime partitions with elements >= kmin, starting with L
local Sol:=table(), nSol:=0, E;

E:=proc(L)
local p,sL:=add(L);
if L<>[] then p:=L[-1] else p:=nextprime(kmin-1) fi;
while p+sL<=n and nSol<=nSolMax do
  if p+sL=n and nSol<nSolMax then nSol:=nSol+1; Sol[nSol]:=[L[],p] fi;
  if nSol>=nSolMax then return fi;  
  E([L[],p]);
  p:=nextprime(p);
od;
end:

if L<>[] and add(L)=n then nSol:=nSol+1; Sol[nSol]:=L fi;   
E(L);
entries(Sol,nolist);
end:

SingPrime:=proc(p::prime,n::posint)  
# there exist only 1 PP starting with p
evalb(nops([PP(n,p,[p],2)])=1)
end:

Q := proc(n)    # list of SingPrime's
local p, P:=select(isprime, [seq(1..n)]);
select(SingPrime, P, n)
end:

PPrime:=proc(p::prime,n::posint)  
evalb(nops([PP(n,p,[p],1)])=1)
end:

P := proc(n)
local p, P:=select(isprime, [seq(1..n)]);
select(PPrime, P, n)
end:

P(50);

[2, 3, 5, 7, 11, 13, 19]

 

Download vv_PP.mw

 

Show the solutions to the equations, which you obtained.

You can use the green up-arrow in the Mapleprimes editor to upload and attach a .mw worksheet.

With which part of that question are you having difficulty?

Could you simply not be bothered to type it in?

You only need to type 7 characters into Maple, and it takes less than a millisecond to compute.

(16 characters are adequate if you want something that scales efficiently with the size of the problem).

@bnpndxtrwp The procedure ContoursWithLabels expects an expression, for which you may pass an unevaluated call to your procedure11.

Note the use of unevalution quotes, ie, single right-quotes.

contour_plot_issue_BP_Mapleprimes_ac.mw

@shahri Why, oh why, would you wait until your fourth message in this thread (Question, and then third Reply) to include an extra equation which must be satisfied by a solution to the system?

@shahri Your statement that (dependent name) "k is neither variable not parameter" strikes me as being nonsense.

@Lali_miani You have not addressed all the queries and points which I mentioned and which I consider to be central in order to be able to make a proper start on your problem.

@shahri On what grounds should that single solution be preferred over the others?

If you cannot specify that precisely then your request does not make good sense.

@shahri Your reply is nonsense because the system depends also on the name x, but you don't include that name in either the variables or the parameters.

The main problem is that you haven't explained what solve_pde does.

It's exceedingly awkward to recover the input from you're pasted output.

Please attach a worksheet that contains the input explictly, or paste in the lprint of the system.

@mmcdara Suppose that we'd been able to give you a magic command which you could apply to the a[i] so that its aliased value were attained, even when `i` were programmatically replaced.

That mightn't be much better than redirection through, say, a table lookup. Eg, T[a[i]] or Value[a[i]] if you wanted it understandable to a general reader. And you could easily construct that table, instead of calling `alias`.

@Carl Love I believe that the plotting command automatically scales the hue data to the 0..1 range.

ColoredTubeplot_ac.mw

@Rouben Rostamian  I dug around the vault and tried to adjust the following to your example.

You may wish to check that my normalization of the data (to get range 0..1 for color components) is ok.

You could also utilize the Torsion. And you could use both Curvature and Torsion, in HSV or RGB components, as you wish.

I was originally working with various knots, and my old code did not automatically normalize.

restart:

with(LinearAlgebra):

 

SC:=proc( T::list, trng::name=range(realcons),
          {numpoints::posint:=3, colorfunc::procedure:=NULL} )

  local M, C, t, a, b, i;

  t := lhs(trng);

  a,b := op(evalf(rhs(trng)));

  M := [seq(eval(T,t=a+i*(b-a)/(numpoints-1)),i=0..numpoints-1)];

  if colorfunc=NULL then

    C := NULL;

  else

    #C := ':-COLOUR'(':-RGB',
    #                Array([seq(colorfunc(a+(i-1)*(b-a)/(numpoints-1)),
    #                           i=1..numpoints)],
    #                      ':-datatype'='float[8]',':-order'=':-C_order'));

    C := :-COLOUR(':-RGB',
                  hfarray([seq(colorfunc(a+(i-1)*(b-a)/(numpoints-1)),
                               i=1..numpoints)]));

  end if;

  :-PLOT3D(:-CURVES(M,C),':-THICKNESS'(5));

end proc:

 

C := <cos(t), 2*sin(t), t^2/20>;
C1, C2 := diff(C,t), diff(C,t,t);

Vector(3, {(1) = cos(t), (2) = 2*sin(t), (3) = (1/20)*t^2})

Vector[column](%id = 18446884189768133798), Vector[column](%id = 18446884189768133918)

Kappa:=simplify(VectorCalculus:-Curvature(C,t));
kappa := Norm(CrossProduct(C1,C2),2) / Norm(C1,2)^3;
plot([kappa,Kappa],t=0..2*Pi,style=[line,point],
     adaptive=false,numpoints=50,size=[600,200]);
(kmin,kmax):=[min,max](op([1,1],%)[..,2])[];

100*((6*sin(t)*cos(t)*t+(-3*t^2+3)*cos(t)^2+4*t^2+401)/(300*cos(t)^2+t^2+100)^2)^(1/2)/(300*cos(t)^2+t^2+100)^(1/2)

100*(4*abs(cos(t)+sin(t)*t)^2+abs(-sin(t)+cos(t)*t)^2+400*abs(sin(t)^2+cos(t)^2)^2)^(1/2)/(100*abs(sin(t))^2+400*abs(cos(t))^2+abs(t)^2)^(3/2)

HFloat(0.22857562522275804), HFloat(1.9482867151552743)

cur:=unapply(kappa,t):

#tor:=unapply(simplify(VectorCalculus:-Torsion(C,t)),t):
#plot(tor,0..2*Pi,size=[600,200]);

cfunc:=proc(tt)

        local L;

        L := [ (evalf[30](cur(tt))-kmin)/(kmax-kmin), 1, 1 ];

        ColorTools:-Color("RGB",ColorTools:-Color("HSV",L))[];

      end proc:

#plot([y->cfunc(y)[1],y->cfunc(y)[2],y->cfunc(y)[3]],0..2*Pi,
#     color=[red,green,blue],numpoints=150,adaptive=false,
#     size=[600,200]);

SC( convert(C,list), t= 0..2*Pi, numpoints=100, colorfunc=cfunc );

 

Download spacecurve_curvature.mw

You might also look at Carl's idea of using a coloring function (expression) directly within tubeplot. That makes some aspects very simple. For example,

restart:

with(plots):

C := <cos(t), 2*sin(t), t^2/20>:

tubeplot(convert(C,list), t=0..2*Pi, radius= .03, numpoints=500,
         color= COLOR(HUE, simplify(VectorCalculus:-Curvature(C,t))),
         style= surface, lightmodel=none);

 

Download tubeplot_curvature_hue.mw

[edited] By using the approach of constructing the replacement COLOR plot substructure (in the code above, for the spacecurve), there is full control over the colorspace components, including normalization of the hue values. So, if you do not like full wrapping in HSV back to red at the upper end of the Hue component, you can scale the Hue. Here I use the Hue value 0.833 (Magenta) as a cap. Capping the Hue at 0.75 also looks good.

spacecurve_curvature_hue_adjusted.mw

Similarly, the hue-shaded tubeplot can also be adjusted:

tubeplot_curvature_adjusted_hue.mw

I notice that some of these plots (eg. the tubeplot) look more vivid when re-executed than they do when the worksheet is closed and re-opened. In my 64bit Linux Maple 2019.2 at least.

First 192 193 194 195 196 197 198 Last Page 194 of 594