Carl Love

Carl Love

28070 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@fairuzalwani 

I'm sorry, but your attempt to describe the working of your program is mostly gibberish and nonsense to my English-reading mind. I was hoping that instead you could describe mathematically what you're trying to do, without reference to specific computer code. I understand that you expect that your procedure will form a partition of the integers from 0 to N.

At no point in the code do you ever assign false to a Boolean variable. That means that all Boolean variables are always true. That's obviously incorrect.

Your procedure makes no sense to me. For one thing, you never assign anything false, so they all must be true, right? How do you suppose that the Boolean arrays are initialized? It looks like you're trying to initialize them to true, right?

You should provide the code for F and Finv, a clear definition for the category MinPts, and why you think that there's no intersection of the categories Escape and Capture.

@perr7 You asked:

My original question was if the black circle in the xy-plane can be visible everywhere, also where the 3D probability density hides the circle. Do you know if that is possible?

Other than the options mentioned by Acer (such as transparency), I think that it may be possible in Maple's Classic GUI interface. If I recall correctly (it's been many years since I've used it), there was a nuisance feature such that lines always appeared on top of surfaces. I think that's exactly what you want in this case.

When the time "t" in the animation is increased, one needs to increase the number of of frames as well. Then it starts to take some time for Maple to do the calculations. It just takes long time, or should the code be written differently?

Changing 'sign(-x)' to signum(-x) will substantially reduce the time taken by each plot3d command because sign prevents them from running in the high-speed evalhf numeric environment. The command sign is strictly for symbolic polynomial algebra, and it has no place in numeric computation. 

My final goal is to make a short video, maybe 10 sec, of the animation. My strategy is to export the file as a GIF-file and then a find a online converter that converts the GIF-file to a video-file. Is that the right way to do it?

No, don't convert it to a video file---that'll substantially reduce the quality. The animation will play fine as a GIF file.

@sunflower 

No, they're not the same. The first one has an extra space. Look at them lined up:

printf ("*");
printf("*");

See? The first one is longer because it has an extra space. That extra space is illegal in Maple's 2D input.

@perr7 

The message "Length of output exceeds limit if 1000000" is NOT an error message. It's an indication that the computation has been sucessfully completed but the results are too long to show on screen. When you assign a plot or an animation to a variable, there's usually no need to see the algebraic form of the plot structure. Just end the command with a colon to suppress the output.

If you need further help, you'll probably need to post the full code so that we can execute it.

@Christopher2222 

Your procedure needs adjustment for the cases when the exponent (the second operand of the float) is nonnegative and for the special weird case of negative zero (which is a separate float in Maple). Here's my procedure that handles those cases:

`convert/floatsymbol`:= (a::coerce(float, (a::realcons)-> evalf(a)))->
     (e->
          nprintf(
               cat(
                   `if`(CopySign(1,a) < 0, "-", ""),
                   "%.",
                   max(-e,0),
                   "f",
                   `if`(e < 0, "", ".")
               ),
               abs(a)
          )
     )(op(2,a))
:

Usage:

convert(.006, floatsymbol);
convert(-1000., floatsymbol);
convert(-0., floatsymbol);

@Athar Shahabinejad 

The number that you got means the same as 5.275440947*10^6 or 5275440.947 or 5.275440947E6. The number format is called scientific notation.

@ 

In my experience, when it's applied to univariate polynomials, fsolve is totally reliable and very easy to use. Do you have an example where it's not?

 

@J4James The purpose of the seq is to specify which contours to plot. In this case, there are 21 evenly spaced from 1 to 3.

@Preben Alsholm 

I find the 14 + (-1) particularly odd. That should be covered by automatic simplification.

It's also odd that (x^2-1) got changed to (x^2+(-1)).

In some ways it seems as if -1 is being treated as a symbol.

@Carl Love 

And here's my Radau procedure:

LegP:= (n::posint, x::name)-> diff((x^2-1)^n, x$n)/2^n/n!:

Radau:= proc(f::algebraic, R::name=range(realcons), n::posint)
local
     x:= lhs(R), a, b,
     Pn:= LegP(n,x), Pnm1:= LegP(n-1,x),
     F, oldDigits, r
;
     oldDigits:= Digits;
     Digits:= Digits+1+ilog2(Digits)+iroot(n,3)^2;
     (a,b):= op(evalf(rhs(R)));
     F:= unapply(eval((b-a)/2*f, x= (b-a)/2*x + (a+b)/2)*(1-x)/n^2/Pnm1^2, x);
     r:= (b-a)*eval(f, x= a)/n^2 + add(F(x), x= [fsolve(Pn+Pnm1)][2..]);
     evalf[oldDigits](r)
end proc:

Digits:= 15:

Radau(sin(sin(x)), x= 0..Pi, 13);

     1.78648748195005

So, the Radau can do this integrand with one less evaluation than the Lobatto required.

 

@H-R There is only one orientation where the color sequence goes green, then yellow, then blue.

@CapnSwing So, you have reference solutions. Perchance are they complex?

@Markiyan Hirnyk 

I was aware of that, but I didn't mention it because it doesn't work for `^`. I wanted consistent techniques.

@tomleslie 

DirectSearch:-SolveEquations will almost always return some sort of least-squares solution, i.e., a "solution" with a relatively minimal value of the sum of the squares of the residuals, even if that sum is very far from 0. These are not what would ordinarily be called solutions.

PS: This information about the residuals and the sum of their squares is returned as the first two items in the list returned by SolveEquations, so there's no need for you to check the residuals yourself.

First 442 443 444 445 446 447 448 Last Page 444 of 709