Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Christian Wolinski I'd like to know how you segregated the branches by color in your first plot is this subthread (this Answer). Did you divide the solution points into equivalence classes based on distance? If so, did you measure the distance across all eight dimensions or only the three visible dimensions?

You say that you have a system of "equations". I see that f8, f9, and f10 are inequalities. That's fine. What about f1, ..., f7? I see no equals signs. Are they meant to be set equal to 0?

@AmirHosein Sadeghimanesh 

The "catch string" is the part after the procedure name in the error message. So, you just need to change your catch to

catch "no feasible solution found":

@Samuel Hollis 

Some (all?) expressions have a "zeroeth" operand, which is either the operator or a type specification of the expression (sometimes it's both). This zeroeth operand needs to be extracted separately, as you can see in my code for OpList. In the example, the `+`, `*`, `^`, and sin are all zeroeth operands.

@Bendesarts 

Psi isn't a constant. All that you need to redefine it is

local Psi;

@MUKUNDS 

For a basic (which is what you have) implicitplot, plottools:-getdata returns a sequence of lists, each of which is a piece of the curve. The string "curve" is the first item in each list, and a two-column matrix is the last. All of the data points of your implicitplot can be put into a single two-column matrix like this:

M:= <seq(`if`(a[1]="curve", a[-1], [][]), a= plottools:-getdata(E))>;

For me, this produces an 1197 x 2 matrix. I suppose that there may be a slight variation in the number of points in different versions of Maple.

@Vrbatim Well, if you're printing at 600 dpi or more, then your plot can accomodate millions of squares. But a relevant question is Can Maple print a plot at a higher resolution than is used on screen? I'm sure that someone here will know the answer to that.

Since a standard HD screen has only about three million pixels on the whole screen, what's the "point" of plotting millions of squares?

@tomleslie Like the title says, the OP wants to determine if and where two line segments intersect. Finding the intersection of the lines containing those segments is only about a third of the problem. You also have to determine whether that point is on the first segment and whether it's on the second segment.

I changed your title from "Intersection of intervals" to "Intersection of line segments." I think that that is clearer in English.

Checking the help at ?geometry and ?geom3d, I see that they don't have the functionality. They each have an intersection command, and they both have a segment command, but the commands don't interact.

@MathyMaple 

No! Maple sets reorder everything, not just numbers.

If you want sublinear search times, use a table, (not an rtable). Later today/tonight, I'll post something showing how to use tables and making a time comparison.

A numeric dsolve can handle piecewise functions just fine. You need to post your code that gives you the error message.

@Declan 

I was emulating your code, which wasn't entirely correct in its random number generation because it allowed 0 and 1. The call rand(N) returns a procedure which when called will generate a random integer from 0 to N-1. The extra () is to perform the call to that procedure. The &^ isn't connected to the (); it's the operator for modular exponentiation by repeated squaring.

Here's a Miller-Rabin procedure with corrected random number generation. I also improved the efficiency of factoring out the power of 2.

MilRab:= proc(n::And(posint, odd, satisfies(n-> n > 3)))
local N:= n-1, C:= N, k, q;
     for k while irem(C, 2, 'q') = 0 do C:= q end do;
     C:= RandomTools:-MersenneTwister:-GenerateInteger(range= 2..N-1) &^ C mod n;
     if C = 1 or C = N then return true end if;
     to k-2 do C:= C^2 mod n; if C = 1 then return false fi; if C = N then return true fi od;
     false
end proc;

@Honigmelone 

What you've discovered isn't a special property of tables; rather, it's an obscure (although intentional) property of the way that Vectors (and other rtables) containing variables are evaluated. You can read a little about it at ?rtable_eval, although it may be years before you can understand that page.

When you use assign with a table entry containing a variable, you should do

assign(eval(at[1], 1), 3);

This'll work for both the first and subsequent uses of assign.

@Christian Wolinski Why do you suggest that the OP try something that doesn't work?

First 435 436 437 438 439 440 441 Last Page 437 of 709