Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

There was no file attached to your post.

I couldn't read the screen, but I linked to the GIF file. That problem/bug looks very weird. It looks like the Matrix returned by MatrixAdd has memory overlapping with another Matrix. Could you upload the entire worksheet so that we can investigate further?

Also, what do you get from the simple M+K?

But your example, in the red ellipse, does show yellow rectangles around the matching brackets. Can you show the example where it does not work?

@Markiyan Hirnyk So, as I continue to work on the original problem, I'd like to know if you intended a uniform distribution? Sorry if that wasn't clear from my last post. It doesn't really change the problem, but the average computational effort required will be different for many algorithms. I'd guess that an algorithm tailored to the logarithmic distribution would have a much better average time when the intervals were drawn from that distribution.

I'm working on a O(n~ +  h) algorithm, where n is the number of intervals and h is the number of pairs of intervals that "hook" together.

Note that the default for RandomTools:-Generate(float(range= a..b)) is a logarithmic distribution. If one of the endpoints is 0, then there is an extreme bias towards values close to 0. I don't think that that is what you intended. You can override the default thus: RandomTools:-Generate(float(range= a..b, method= uniform)). See ?RandomTools,flavor,float.

@kswong89 The minus sign in front is because 1/I = -I, assuming that by I you meant sqrt(-1), which is the default in Maple. If you just meant for I to be a variable, then we need to change that default, which is not difficult to do.

@kswong89 The minus sign in front is because 1/I = -I, assuming that by I you meant sqrt(-1), which is the default in Maple. If you just meant for I to be a variable, then we need to change that default, which is not difficult to do.

@Karla How does Markiyan's solution differ from what you "would like to have as an answer"?

@Karla How does Markiyan's solution differ from what you "would like to have as an answer"?

This is not a comment on the piecewise aspect of the question. I just want to point out that the trivial type of list flattening done in Adri's answer can be accomplished much more simply by appending [] (empty square brackets). Also, the digits=2 needs to be inside the parentheses of float(...) in order to be effective. With these changes, Adri's code becomes

N := 5:
Y := [seq( randpoly(x,degree=2), i=1..N )]:
X := sort( [seq(RandomTools:-Generate(float(range=1..10.0, digits=2)), i=1..N)] ):
H := seq( [x<=X[i],Y[i]][], i=1..N ):
yp := piecewise( x<=0, 0, H, 0 );

This is not a comment on the piecewise aspect of the question. I just want to point out that the trivial type of list flattening done in Adri's answer can be accomplished much more simply by appending [] (empty square brackets). Also, the digits=2 needs to be inside the parentheses of float(...) in order to be effective. With these changes, Adri's code becomes

N := 5:
Y := [seq( randpoly(x,degree=2), i=1..N )]:
X := sort( [seq(RandomTools:-Generate(float(range=1..10.0, digits=2)), i=1..N)] ):
H := seq( [x<=X[i],Y[i]][], i=1..N ):
yp := piecewise( x<=0, 0, H, 0 );

@kswong89 I wrote w(x,y) = .... You changed it to w(x,y):= ....

@kswong89 I wrote w(x,y) = .... You changed it to w(x,y):= ....

@dhonkabulo I don't know why it doesn't work, but it has nothing to do with the a[0] or with the convert(a, `local`). The plot shows up on your screen, right? with the a[0], right? Your original question was how to get the a[0] on the plot, right?

Does saving the plot to postscript work without a[0], or with "a[0]", as you originally had it?

@dhonkabulo I don't know why it doesn't work, but it has nothing to do with the a[0] or with the convert(a, `local`). The plot shows up on your screen, right? with the a[0], right? Your original question was how to get the a[0] on the plot, right?

Does saving the plot to postscript work without a[0], or with "a[0]", as you originally had it?

First 664 665 666 667 668 669 670 Last Page 666 of 708