Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 29 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@N00bstyle The interface setting displayprecision is completely separate from the computational engine. Indeed, your variables will be maintained internally at 15 digits. The setting only affects how they are displayed.

In my opinion, 15 is the best default value for Digits, rather than Maple's default of 10.

@N00bstyle The interface setting displayprecision is completely separate from the computational engine. Indeed, your variables will be maintained internally at 15 digits. The setting only affects how they are displayed.

In my opinion, 15 is the best default value for Digits, rather than Maple's default of 10.

@Kitonum 

The step length AD must be a multiple of primorial(n) where n is the progression length, except when the first prime in the progression is n itself, in which case AD must be a multiple of primorial(n-1).

Some other examples of the exceptional case are

2, 3  (AD = 1 = primorial(2-1))
3, 5, 7  (AD = 2 = primorial(3-1))
5, 11, 17, 23, 29  (AD = 6 = primorial(5-1))

@Kitonum 

The step length AD must be a multiple of primorial(n) where n is the progression length, except when the first prime in the progression is n itself, in which case AD must be a multiple of primorial(n-1).

Some other examples of the exceptional case are

2, 3  (AD = 1 = primorial(2-1))
3, 5, 7  (AD = 2 = primorial(3-1))
5, 11, 17, 23, 29  (AD = 6 = primorial(5-1))

@Kitonum See the Wikipedia article that I referenced above. The step length AD must be a multiple of primorial(n) where n is the progression length. Primorial(n) is the product of all primes less than or equal to n.

Primorial(7) = 210.

If AD were equal to 2, then every 3rd term would be divisible by 3, every 5th term divisible by 5, and every 7th term divisible by 7. So there could not be a sequence of primes of length 7.

@Kitonum See the Wikipedia article that I referenced above. The step length AD must be a multiple of primorial(n) where n is the progression length. Primorial(n) is the product of all primes less than or equal to n.

Primorial(7) = 210.

If AD were equal to 2, then every 3rd term would be divisible by 3, every 5th term divisible by 5, and every 7th term divisible by 7. So there could not be a sequence of primes of length 7.

Sorry, I had a typo which I've now corrected. I forgot to include the index variable before the range.

Sorry, I had a typo which I've now corrected. I forgot to include the index variable before the range.

@awass I would read the page ?use carefully before making a habit of using use. But I see no problem with using it at the top level the way you have above if you understand its severe limitation (of being resolved during automatic simplification). The limitation makes it very difficult to use inside a procedure.

Certainly assuming cannot be used in this situation. The two-argument form of eval is usually preferable to subs. For example,

eval('plot'(x^d, x= 0.1..a), [d=3, a=5]);

produces the plot directly, whereas

subs([d=3, a=5], 'plot'(x^d, x= 0.1..a));

does not.

@awass I would read the page ?use carefully before making a habit of using use. But I see no problem with using it at the top level the way you have above if you understand its severe limitation (of being resolved during automatic simplification). The limitation makes it very difficult to use inside a procedure.

Certainly assuming cannot be used in this situation. The two-argument form of eval is usually preferable to subs. For example,

eval('plot'(x^d, x= 0.1..a), [d=3, a=5]);

produces the plot directly, whereas

subs([d=3, a=5], 'plot'(x^d, x= 0.1..a));

does not.

@awass For documentation of backquote `` notation see ?name and ?emptysymbol . For documentation of its use with operators, see ?use and ?overload .

The issue of efficiency is not so simple. In the add / `+` case, if the sequence of summands is already created, then `+` is at least 2-3 times faster than add. If the sequence of summands has not been created, but it can be created with $, then using `+` and $ is likely faster than add.

In the mul / `*` case, it is more complicated. If the multiplication is purely symbolic, then the situation is pretty much the same as with add / `+`. If there is actual numeric multiplication happening (it doesn't matter whether it's exact, float, or hardware float), then mul is slightly faster than `*` regardless of whether the sequence of factors is or isn't already created.

 

@awass For documentation of backquote `` notation see ?name and ?emptysymbol . For documentation of its use with operators, see ?use and ?overload .

The issue of efficiency is not so simple. In the add / `+` case, if the sequence of summands is already created, then `+` is at least 2-3 times faster than add. If the sequence of summands has not been created, but it can be created with $, then using `+` and $ is likely faster than add.

In the mul / `*` case, it is more complicated. If the multiplication is purely symbolic, then the situation is pretty much the same as with add / `+`. If there is actual numeric multiplication happening (it doesn't matter whether it's exact, float, or hardware float), then mul is slightly faster than `*` regardless of whether the sequence of factors is or isn't already created.

 

@ThU Try this. Note that I do not load Vector:-Calculus for this because I don't want to see vectors in e[x], e[y], e[z] notation.

restart:
MyTangentLine:= (V, Pt::(name=algebraic))->
    ``(eval(V,Pt)) + op(1,Pt)*``(eval(VectorCalculus:-TangentVector(V),Pt))
:
MyTangentLine( < sin(t)-t*cos(t),cos(t)+t*sin(t),t^2 >, t= Pi/2 );

@ThU Try this. Note that I do not load Vector:-Calculus for this because I don't want to see vectors in e[x], e[y], e[z] notation.

restart:
MyTangentLine:= (V, Pt::(name=algebraic))->
    ``(eval(V,Pt)) + op(1,Pt)*``(eval(VectorCalculus:-TangentVector(V),Pt))
:
MyTangentLine( < sin(t)-t*cos(t),cos(t)+t*sin(t),t^2 >, t= Pi/2 );

@Markiyan Hirnyk Most good art is created for art's sake.

First 613 614 615 616 617 618 619 Last Page 615 of 709