Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Joe Riel

I was more impressed that I was able to print the whole table in Yeti's format with a single fprintf statement.

I don't understand why `?()` works, or why `?[]` doesn't work. The latter was my first choice, but it gives the incomprehensible error message "`?[]` expects a list for its 2nd argument but received [1,1]". Everything that I've done to test it shows that the [1,1] that it is receiving is indeed a list.

Yeah, now that I see it, I like indx-> A[op(indx)] better also.

@brian bovril Yes, that's correct.

@AmusingYeti Here's a procedure for your formatted output:

InvertRtable:= (A::rtable)-> ListTools:-Classify(curry(`?()`, A), [indices(A)]):

YetiPrint:= proc(A::rtable, fp::{nonnegint, symbol, string})
local e, T:= sort([entries(InvertRtable(A), 'pairs')], key= (e-> rhs(e)[1]));
   fprintf(
      fp,
      cat("|", seq(cat("%a", "=%a" $ nops(rhs(e))-1, ", %a|"), e= T)),
      (op@rhs, lhs)~(T)[]
   )
end proc:

Example:
A:= LinearAlgebra:-RandomMatrix(9$2, generator= rand(0..9)):
YetiPrint(A, terminal);

|[1, 1]=[2, 6]=[3, 8]=[4, 1]=[4, 7]=[5, 5]=[6, 3]=[6, 6]=[6, 9]=[7, 2]=[8, 1]=[8, 3]=[9, 4], 3|[1, 2]=[3, 2]=[3, 5]=[4, 4]=[4, 6]=[6, 5]=[6, 8]=[8, 6]=[9, 3], 7|[1, 3]=[2, 8]=[4, 2]=[5, 1]=[8, 5], 8|[1, 4]=[1, 7]=[3, 3]=[3, 6]=[4, 5]=[4, 9]=[5, 6]=[5, 8], 5|[1, 5]=[1, 8]=[1, 9]=[2, 2]=[2, 7]=[3, 1]=[3, 4]=[3, 9]=[5, 2]=[6, 7]=[7, 7], 0|[1, 6]=[2, 3]=[5, 3]=[6, 1]=[6, 2], 6|[2, 1]=[5, 9]=[7, 6]=[7, 8]=[8, 8]=[9, 5]=[9, 8], 4|[2, 4]=[3, 7]=[4, 3]=[6, 4]=[7, 1]=[7, 5]=[8, 4]=[9, 1], 2|[2, 5]=[2, 9]=[4, 8]=[7, 4]=[7, 9]=[8, 2]=[8, 7]=[8, 9]=[9, 9], 1|[5, 4]=[5, 7]=[7, 3]=[9, 2]=[9, 6]=[9, 7], 9|

 

 

@vv To my mind, the purpose of the procedures is to classify those entries whose existence isn't determined by an indexing function. From a standpoint of information theory, these are the only entries that are really there.

@acer Your technique doesn't work the way that you expect it to. The 5 of the outer evalf supercedes the Digits used by the inner evalf, so the inner evalf is being done at 5-digits precision. Here's a test that shows this:

x:= 1+1e-6:  y:= 1+2e-6:
evalf[5](evalf(y-x));

                               0.
evalf(y-x):  evalf[5](%);
                            0.000001

So, evalf violates the usual rule that arguments are evaluated before being passed!

 

Your attempt to write Maple code doesn't shed much light on your problem. I think that you should take a step back, forget about Maple, and try to describe your problem mathematically. You're trying to solve a differential equation, right? ordinary or partial? numeric or symbolic solution? You mentioned Poincare's theorem (in an earlier version of this Question). You mentioned a change of variables. Now put it all together into a clear mathematical statement of the problem.

@gtbastos Do you want all 4x4 matrices of 0s and 1s of rank 3 or 4 over GF(3)? Or do you want all 4x4 matrices of rank 3 or 4 over GF(3)?

@Carl Love Your system contains no derivatives taken with respect to x. So it's a system of ODEs, not PDEs. So it should be solved numerically with dsolve, treating x as a parameter. Parameters in BVPs in Maple are handled by specifying one additional BC per parameter.

@Carl Love Your error is caused by your double use of square brackets on IBC. You have square brackets where you set the value of IBC, and you have them around IBC in the pdsolve command.

If you fix that problem, then you get an error because none of the IBCs set the value of x. That means that you'll need to rethink this problem. Also note that the trivial solution f(x,y) = 0 = g(x,y) is a solution to this problem. This is the only solution that a numerical solver will find.

@Kitonum Simpler: plot(<x | y>);

@karolin In order that all the intersections appeared neatly in the interior of the plot, I stretched the plot's viewing range of x and y a little on each side. The amount of stretch on each side is 1/3 the distance between the min and max. With the way that I did it, you should be able to reuse the plot command without change for other sets of curves.

@brian bovril The command that you need is

MM[MM[`+tour dists`] =~ min(MM[`+tour dists`])];

You say that you need "to find the area enclosed between the two". But two straight lines can't possibly enclose any area. There must be at least one more boundary curve. Often one of the boundaries is one of the coordinate axes. In this case, that could be the x-axis. But don't assume this! If the problem doesn't explicitly state this, the proper answer is to state that the problem is improperly posed.

You claim that you're using Maple 8, which is a very old version. The ability to solve delay differential equations was only recently added to Maple AFAIK.

The given Matlab code can't possibly do anything useful. Perhaps you should take a step back and describe your overall goal.

First 362 363 364 365 366 367 368 Last Page 364 of 709