Carl Love

Carl Love

28110 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@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.

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

To prevent cut-and-pasted sections of code and Maple 2D output from looking weird, select "Preformatted" from the pull-down list in MaplePrimes while your cursor is at the place where you want to paste.

@Alex Joannou Yes, it should work with any structure, even those as yet undefined.

@Alex Joannou Yes, it should work with any structure, even those as yet undefined.

@Alex Joannou I made your most recent Reply into a separate Question, and I answered it.

@Alex Joannou I made your most recent Reply into a separate Question, and I answered it.

@conn96 Well, I don't see the image either. Putting it in your avatar makes it too small to read. Put the image in the body of your message.

@J Rod I agree with you: It's an absurd change.

First 614 615 616 617 618 619 620 Last Page 616 of 710