tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are replies submitted by tomleslie

@Rouben Rostamian  

if you remove the output from the Maple worksheet - the problem goes away - always

The ComputationalGeometry[PointInPolygon] command was introduced in Maple 2020.

OP is using Maple 2018 - so required command will not exist!.

use the big green up-arrow in the Mapleprimes toolbar to upload your worksheet, so that we can actually see which functions are causing a problem for the invlaplace() command

@hexsol 

What does interface(showassumed=0): do?

If one makes assumptions on variables in Maple, then (by default) Maple will display these variables with a trailing '~' character, so for example, one would see a~ rather than a in Maple output. I think that this just clutters the output, making it more difficult to read. Setting interface(showassumed=0), just tells Maple not to bother displaying the annoying '~' character.

Did you deduce that the mu and lambda had to be larger than zero becuase of the given answer or because of your knowledge of the exponential distribution?

I just read the answer you had already obtained which contained a limit

limit(-lambda*exp(-lambda*x-mu*y)+lambda*exp(-lambda*x-mu*x), y = infinity)

(3)

 

and concluded that this didn't make much sense unless mu>0, (which would also imply that lambda>0). Then I checked the definition of the exponential distribution in the Maple help which confirmed that lambda, mu>0. As a general rule , when integrals have an infinite range, it is a good idea to ensure that Maple "knows" that the integrand  is bounded as the integration variable tends to infininity

@janhardo 

Your original question just asked for a procedure implementing the Sieve of Eratosthenes  - you have received a few possibilities

None of these would be a realistc way to go looking for really BIG Mersenne primes.

Maple's inbuilt siprime() command is quite adequate for generating all Mersenne primes with less than ~1000 digits, although for larger numbers it starts to slow down (a lot!). The code

CodeTools:-Usage([seq( `if`( isprime(2^j-1),j, NULL), j=2..3400)]);
2^3217-1;
length(%)

produces the list

[2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217]

in about 3sec on my machine. The largest of these primes (ie 23217-1) is 969 digits long

@acer 

You are correct

The convert(expr, unit_free) command does not work as I would expect if expr contains a mixture of units - scaling may be ignored!

Hence you need to simplify() first, as in the attached

  restart;
  P:= [ 7.291666667*10^10*sin(2.154234962*10^(-11)*M*Unit('J')/(Unit('Pa')*Unit('mm')^3))*Unit('Pa')*Unit('m')*Unit('mm')^3/(M*Unit(J)),
       -7.291666667*10^10*(-1 + cos(2.154234962*10^(-11)*M*Unit('J')/(Unit('Pa')*Unit('mm')^3)))*Unit('Pa')*Unit('m')*Unit('mm')^3/(M*Unit('J')),
        M = 0..72
      ];
  plot([map(convert, simplify~(P[1..2]), unit_free)[], P[3]]);

[0.7291666667e11*sin(0.2154234962e-10*M*Units:-Unit(J)/(Units:-Unit(Pa)*Units:-Unit(mm)^3))*Units:-Unit(Pa)*Units:-Unit(m)*Units:-Unit(mm)^3/(M*Units:-Unit(J)), -0.7291666667e11*(-1+cos(0.2154234962e-10*M*Units:-Unit(J)/(Units:-Unit(Pa)*Units:-Unit(mm)^3)))*Units:-Unit(Pa)*Units:-Unit(m)*Units:-Unit(mm)^3/(M*Units:-Unit(J)), M = 0 .. 72]

 

 

 

 

 

 

Download unitPlot2.mw

@hieudeptrai 

The method shown in the attached provides what you require?

  with(DEtools):
  with(plots):
  ODE:= diff(y(x),x)=k*(A-y(x)):
  A:= 80:
  k:= 0.05:
  B:= [y(0)=10, y(0)=60, y(0)=120]:
  p1:= DEplot(ODE, y(x), x=0..100, y=0..125):
  p2:= plot( [seq( rhs(dsolve( [ODE, B[j]])), j=1..3)],
             x=0..100,
             color=[cyan, blue, green],
             legend=[ y(0)=10, y(0)=60, y(0)=120]
           ):
  plots:-display([p1,p2]);

 

 

 

Download NL2.mw

@hieudeptrai 

you are muissing a "multiplication" symbol in the definition of HAMSO. Yoou can either enter this symbol explicitly between 'k' and (A-y(x)), or (if you insist on using 2D math input) you can enter a space.

I prefer to use 1-D input, just to avoid problems like intrepreting a space as "implied multiplication

You may also want to let it run for longer - x=0...100 on the plot

See the attached

  with(DEtools):
  ODE:=diff(y(x),x)=k*(A-y(x));
  A:=80;
  k:=0.05;
  B:=[y(0)=10, y(0)=60, y(0)=120]:
  DEplot(ODE, y(x), x=0..100, y=0..125, B);

diff(y(x), x) = 4.00-0.5e-1*y(x)

 

80

 

0.5e-1

 

 

 

Download NL.mw

@JAMET 

what length are BC and BD meant to be?

I notice that if the argument to the procedure Fig() is Pi/2 or 3*Pi/2, then both BC and BD are sqrt(18709). Is this the length BC and BD are meant to be for all arguments to Fig()?

use the big green up-arrow in the Mapleprimes toolbar to upload a worksheet illustrating your problem

USe the big green up-arrow in the Mapleprimes toolbar to upload the worksheet which illustrates your problem.

You can use the op() command to examine the structure of the table (other possibiities are available)

In general table entries can be accessed using square brackets [] - but this does require that you know what the "indices" actually are - and they could be integers, names, almost anything.

You can find what the indices of your table actually are by using the indices() command

see the "toy example" below for some possibilities

  restart:
  S := table([fred=45,bill=61]);
  op(1,S);
  indices(S);
  entries(S);
  S[bill];

table( [( bill ) = 61, ( fred ) = 45 ] )

 

table( [( bill ) = 61, ( fred ) = 45 ] )

 

[bill], [fred]

 

[61], [45]

 

61

(1)

 

Download tab.mw

the code you have written will always produce the image whihc Maple shows

What justification do you have that the iterativeprocess/coloring scheme should produce the image you desire - textbook/website/whatever

I have tried running a reverse picture search on the image you desire, but I caan't find anything

@mmcdara 

and I (maybe) should have realised! The help pages suggest that one can specify a parabola using the pairs

focus, vertex

focus, directrix

Rather obviously, one can pick any two from [focus, vertex, directrix] to specify the parabola - the Maple help didn't list the [directrix vertex] option so I didn't even try. I *assumed* tha if one wanted to do do it this way, then some preliminary calculations would be necessary - so that is what I did

@Preben Alsholm 

In my original response I stated that I could not reproduce this issue. I always got the 'simpler' form of the desired answer. I have just tried various tests (restarts, shutdowns etc, etc) and could not make it fail. I was using a somewhat "older" version of Physics (1069)

I updated to the latest Physics version (ie 1112) and now I do get the same intermittent problem. When both trials work, I get the 'simpler' form of the answer. When one of the trials fails, the other always(?) seems to produce the 'longer' form of the answer.

I'm confused!!

First 26 27 28 29 30 31 32 Last Page 28 of 207