Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@mmcdara Yeah, I think that PartialSums is misplaced in ListTools. It's more of a mathematical command than a list-manipulation command.

@ravenHound You are confusing the extremal values of N with the values of t at which those extrema are attained. If you plug those t back into N, you'll get the other two values.

To get both the values of N and t for the extrema directly from the plot, do

P:= plot(N, 0..20):
A:= op([1,1], P): #The plot's point matrix
A[[(min[index],max[index])(A[.., 2])], ..];

Of course, these values that are taken directly from the plot are just approximations because a plot is just a finite set of points (213 points in this case). However, the plot command does usually increase the point density a little bit near the extrema.

@ravenHound Your analyses are totally correct, and I'm convinced that you understand the underlying math.

Regarding the Maple: Yes, the graph will theoretically be a straight line with slope 2/3. But in reality, using actual data and doing the log-log transformation, you'll get a not-quite-straight (at best) line with slope approximately 2/3. To find the line that best fits that data, you use Maple command Statistics:-PowerFit.

The professor's instruction to "experiment with the graphing calculator to see how the value of a affects the graph" is silly to my mind: It's probably obvious to you how a multiplied constant affects a graph.

@mmcdara I think that your interpretation is the correct one, but I don't understand why/how dsolve solved it. There's more than one independent variable with respect to which derivatives are taken, so I'd expect only pdsolve to work.

@LustForLife You probably realize that your procedure redoes the sums and products of the initial segments many times. This can be easily avoided by using more elementwise operations:

BigProc:= (H::list, T::list)-> 
   (P-> (1 +~ ListTools:-PartialSums(P)) /~ (1 +~ ListTools:-PartialSums(1/~P)))
      (H*~T)
:

 

@Carl Love Here's an update that detects limit cycles of any length. Unlike Tom's, this one doesn't require a linear search of all of the previous values to detect a repeat. However, it does require that each value be stored twice.

KaprekarSeq:= proc(x::posint, b::posint:= 10)
local j, r:= Vector(1, [x]), kx:= Kaprekar(x), J:= table([x=1]);
   for j from 2 while not assigned(J[kx]) do
      J[kx]:= j;
      r(j):= kx; 
      kx:= Kaprekar(kx, b)
   end do;
   convert(r, list), convert(r[J[kx]..], list)
end proc:

Kaprekar:= proc(x::posint, b::posint:= 10)
local X:= convert(x, base, b), N:= b^nops(X), S:= sort(X);
   convert(S, base, b, N)[] - convert(ListTools:-Reverse(S), base, b, N)[]
end proc:

Example usage:

KaprekarSeq(12345);

      [12345, 41976, 82962, 75933, 63954, 61974], [82962, 75933, 63954, 61974]

The first returned list is the entire sequence; the second is the limit cycle.

@tomleslie Yes, that was intentional; I mentioned it in my introduction. However, inspired by you, I've improved my code to detect any cycle, and I'll post that update in a few minutes.

All differential equations have dependent functions.

@Rouben Rostamian  I took it to be not an equation---a statement of equality---but that the left side (in particular, a) was being (incorrectly) defined to be the right side.

Some of your "points" in L have more than two coordinates. What do you mean by that?

You're confusing a plot, which is 2D, with a plot3d. For a plot of a curve, the second column of the data matrix contains the y-values (the vertical coordinates). That's not true for a plot3d. For the most-basic form of plot3d, the GRID form (which is what you have), the entire matrix is z-values. Preben's Answer uses this fact.

@CGForbes You have three curves, although they are given by only two formulas, so you need three matrices. Change (M1,M2) to (M1,M2,M3).

 

@CGForbes Please show me the result of just plottools:-getdata(P). Perhaps you have a version of Maple with a different version this command. If so, it'll still be easy to extract the data matrices. So, please also show me the result of indets(P, Matrix).

I think that the best treatment for such an expression (an algebraic number in radical form) is evala(S). The mathematical nature of the set of expressions that can be output by simplify (without optional arguments) isn't clearly documented. I wouldn't be surprised if that set wasn't even fully understood by Maple developers.

If Acer's Answer solves your problem, great. If not, tell me the size of your worksheet (the saved .mw file) in bytes.

First 343 344 345 346 347 348 349 Last Page 345 of 709