Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

Basic facts from vector calculus: The derivative of each dancer's position vector is their direction vector. A direction vector can be expressed as B-A where A is the dancer's current position and B is any point toward which they are heading. A point toward which a dancer is heading is the position of the next dancer (clockwise).

@Markiyan Hirnyk Dancer 0 moves towards dancer 1, 1 moves towards 2, 2 moves towards 3, and 3 moves towards 0. This can be compactly described as "moves towards irem(k+1,4) for k= 0..3." The magnitude of the velocity of the motion is irrelevant so long as it is the same for all. We only need to account for the direction of the velocity. Hence, the x component of 0's velocity is described by

diff(x0(t), t) = x1(t) - x0(t).

Likewise for the y component, and likewise for all four dancers. Is that sufficient explanation?

@Mac Dude The file generated by setting kernelopt(profile=true) is not meant to read by a human! You're supposed to let the commands exprofile and excallgraph read it. Follow the example given at ?profile.

@Markiyan Hirnyk The vast majority of the problems that Brian posts are ones that can be fairly easily solved with Maple with some thought but are difficult to solve without symbolic computation. I find them quite interesting, and I think that they are great material for MaplePrimes.

Regarding the Maple code to form the required equations, see my solution below. Especially note how seq and cat are used to form the required equations.

@sidra If you want step-wise education in Maple and you already know 40%, here's a first exercise. Complete the following procedure, which finds and returns the minimal element of a numeric list, set, or rtable (Vector, Matrix, etc.). Fill in the ... on the second line, and then write the rest of the procedure. 

Min:= proc(V::{list,rtable,set}(numeric))
local v, Min:= ...;
     for v in V 

Note that Maple makes no significance of the procedure having the same name as one of its locals. That's simply my stylistic choice.

Oh, this is just my mathematical curiosity and has no relevance to the Maple programming: Could you provide a reference to the "direct methods of linear algebra" that you're using? I'd be suprised if there were some method that used the maximal entry in a column rather the the entry with the maximal absolute value.

@Markiyan Hirnyk Yes, you're right, these days. I've used the compound verb "cut-and-paste" since long before such was possible on a computer---from when pieces were literally cut with scissors or X-acto Knife from one document and pasted with glue or rubber cement onto another document. But I will endeavor to say "copy-and-paste" from now on.

@Kitonum I think that it would improve that readability of your Answers (all of your Answers), especially for the inexperienced users, if you would put each of Maple's responses directly under the command that generated it. So, the correct output would go directly under the correct command, and the erroneous output would go directly under the erroneous command. Having written over 2000 Answers on this system, I can certainly sympathize that this is extra work given this atrocious MaplePrimes editor.

How much data do you have (in Excel)? Do you need to perform this fit repeatedly, so that the process should be automated? Datasets of upto several hundred points can be easily cut-and-pasted directly from Excel into a Maple worksheet. So, if you only need to do this a few times, that might be the way to go for the data transfer.

@Preben Alsholm I have a hunch that this is a GUI error. The two things that lead me to think that are that the error comes from Typeset:-Tdisplay and that you (Preben) did not get the error.

@sidra I just assumed that you wanted to select the entry with maximal absolute value, not the literal maximal entry. What purpose is there in selecting the literal maximal entry? What if the maximal entry is 0? What if you have complex values?

If you really don't want the absolute value, it just requires a trivial change:

MaxWithIndex:= proc(M::Matrix(numeric), col::posint)
# Returns the entry with maximal value in column col
# and its row index.
local
     Max:= -infinity, i, MaxI, v,
     Rows:= proc(M) option inline; op([1,1],M) end proc
;
     for i to Rows(M) do
          v:= M[i,col];
          if v > Max then
               Max:= v;
               MaxI:= i
         end if
     end do;
     (Max, MaxI)
end proc:

Pivot:= proc(M::Matrix(numeric), row::posint, col::posint)
uses RO= LinearAlgebra:-RowOperation;
local Max, MaxI;
     (Max,MaxI):= MaxWithIndex(M, col);
     RO(RO(M, [row,MaxI], _rest), row, 1/Max, _rest)
end proc:

If you want tutorial guidance, I need to know where you're starting from. Do you have any experience with another computer language? Do you have any book to work from?

How is the integral that you wrote different from int(x*ln(x), x)?

@morrisonkathy Two million is not a lot. I can call it that many times in under 8 seconds.

@morrisonkathy 

I was only able to make it a little bit faster, as this:

`&<`:= proc(x,y)
local i::posint;
     for i to 8 while x[i] = y[i] do end do;
     i > 8 or not (i::even xor x[i] > y[i])
end proc;

I can't make this any faster with the usual tricks of compiling or evalhf.

You wrote:

@Carl Love would you like to visit this link http://www.mapleprimes.com/questions/204724-How-Do-I-Plot-Multiple-Ode-Numerical ? thank you :)

Tom Leslie already Answered your Question. What do you want me to do?

And please don't point out current MaplePrimes threads to me. I read them all anyway.

@maple fan There is no universal method to judge the accuracy. But you should try different methods. If you get different results, then some results are wrong, obviously. There are 29 methods available for IVP systems, 4 for BVP systems (the BVP methods can be used for IVPs by using a range specification), and 4 for DAE IVPs. The help page ?dsolve,numeric,taylorseries claims that method= taylorseries[series] is a high accuracy but relatively slow method. To read about the different methods, start at ?dsolve,numeric in the first paragraph of Description.

First 472 473 474 475 476 477 478 Last Page 474 of 709