Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 361 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Mac Dude Here's a substitute for eval[recurse] for use in your earlier Maple:

eval_recurse:= proc(e, s::{equation, {set,list}(equation)})
local r:= eval(e,s), newr;
     try newr:= eval(r,s) catch: return r end try;
     `if`(newr=r, r, thisproc(newr,s))
end proc:

If the seq works, it'll be faster.

 

I have often changed the tickmarks on Maple plots to achieve the shortest possible representation. This is especially important for horizontal axes, where the printing of all the tickmarks on a single horizontal line tends to make them crowded. A plot with tickmarks similar to the OP's can be achieved as

plot(
     2e8*x, x= 0..1e-8,
     xtickmarks= (x-> x=sprintf("%dE%d", op(x)))~([k*1e-9 $ k= 1..9]),
     axesfont= [TIMES,ROMAN,9]
);

@Markiyan Hirnyk 

Your example is irrelevant because 4 is in fact equal to 4.+10^(-20) under floating-point arithmetic at 10 digits. This is well accepted as a nuance of floating-point computation. In other words, if we allow your example to stop us from using member in the way that I described, it's akin to discarding a 50+ year history of scientific computation. After all, is(4 = 4.+10^(-20)) returns true also.

Maple-wise, the solution to the problem is well known: If you want exact computation, don't use decimal points. You know that, but you are compelled to criticize anyway.

 

What exactly do you mean by "the Library"?

Try this Google search:

"simple beam" ("maple (code|file|worksheet|document)" | "maple * (mws|code|file|worksheet|document|mw)")

(It sucks that the Google search operator * seems to stand for "one or more intervening words" rather than "zero or more intervening words." I think that's a recent undocumented change.)

When you find a worksheet, if you need help understanding it, don't hestitate to ask.

@Markiyan Hirnyk Thus ScientificErrorAnalysis can't be used as a substitute for Tolerances, which does do range or interval arithmetic (but doesn't handle complex values very well).

@Markiyan Hirnyk No, that is not the point of my remark. My point is that the correct answer is the interval 0..4. If a and b are in 0..2, then a+b could be anywhere in 0..4. The interval 2-sqrt(2)..2+sqrt(2) is not wide enough.

@Markiyan Hirnyk Note that ScientificErrorAnalysis, in particular combine(..., errors), doesn't do range or interval arithmetic. Compare

with(ScientificErrorAnalysis):
a:= Quantity(1,1):  b:= Quantity(1,1):
combine(a+b, errors);

with

a:= shake(1,1):  b:= shake(1,1):
evalr(a+b);

 

@nm Yes all intervals should be specified with two endpoints. There are other commands in Maple that take complex intervals as a+b*I..c+d*I. There's no good reason that INTERVAL should be any different.

@nm Please reread my Answer because I just expanded it with information about how to handle complex ranges, which are necessary to handle your original example. Note that I changed your b interval for my evalr example to ensure that the solutions were real.

If a=4, b=1, and c=2, then I'm sure that you can solve by hand, or with Maple, and see that the solutions are not real. I don't know the Tolerances package, but my guess is that it is only showing you the intervals for the real parts of the solutions.

But your equation doesn't necessarily have real solutions under the given conditions. Consider a=b=c=1/2.

@tomleslie That's not what I meant by "Don't use map."

@tomleslie By "decimal numbers" I meant numbers with decimal points---but you were right to correct my terminology----yes, they are floating point.

Regarding inert functions and modmod is all about the inert functions (see ?mod): There are 45 predefined inert functions that work with mod (including Det), and it's very easy to write your own.

 

What kind of answer did you expect? Let's ignore the issue of determinants for the moment. What do you expect as the result of applying modular arithmetic to decimal numbers?

@brian bovril Your problem is in the initial conditions ics. You have dancer 0 at [-2,-2], dancer 1 at [0,0], and dancer 2 at [2,2]. Thus they start out on a straight line, not the vertices of a triangle. And, of course, if they start on a straight line, then they'll stay on a straight line.

If you want an equilateral triangle with edge length 4, then use the following as the initial points:

Init_Pts:= 4/sqrt(3)*~[cos,sin](-2*Pi*k/3) $ k= 1..3;

Under these conditions, the exact length of one spiral is 8/3.

First 471 472 473 474 475 476 477 Last Page 473 of 709