Carl Love

Carl Love

28150 Reputation

25 Badges

13 years, 350 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Yes, the sentence that you mentioned should be "Define new dependent variable u(t)."

I'm using a QHD display (3200 x 1800) with the Zoom factor in the Windows settings set to the recommended value of 250%. This is independent of Maple's own Zoom factor.

@Christopher2222 Yes, when it happens for me, it affects all open documents and worksheets.

@dharr Thanks, I didn't know that convert(..., FormalPowerSeries) allowed an expansion point as an optional 3rd argument. 

@The function Yeah, "Pochhammer" definitely sounds like a heavy-metal band's name. But it's a fairly simple function similar to factorial.

@salauayobami Do you mean that you'd like to see a shooting method solution using RKF45 as the underlying IVP method? Or do you mean that you'd like some way of verifying that FDM is being used? 

@janhardo There's an entire textbook on Maple programming built right into Maple's help system. Just search "ProgrammingGuide" in the help browser. There are 20 such help "pages" (each chapter length). It includes much information on procedures and modules.

This is what I meant by the "bad programming practice" of returning values through the parameters, which is used by the procedures maxmin and optimize that you showed. To give a simpler example, let's say that I want a procedure that squares its input. Here is the bad way:

BadSqr:= proc(x, sqr::evaln)
    sqr:= x^2;
    return
end proc
:
BadSqr(3, s);
#Executing this line produces no output.
s;
                               9

And here are two normal and acceptable ways of doing it:

BetterSqr:= proc(x)
    return x^2
end proc
:
BetterSqr(3);

                               9

Sqr:= x-> x^2:
Sqr(3);

                               9

The way that I call the bad way was considered bad long before 2002 (when that book was written).

@janhardo I don't know what you mean by this:

  • I see that the input parameters from the second procedure as local variables are declared in the main procedure.
    Indeed the sub procedure is treated like a local variable.

Tom's procedure does not use maxmin at all, neither as an external procedure nor as a subprocedure of optimize. His local variables maxv and maxv could've been named anything. There is no connection to the procedure maxmin that you posted.

@salauayobami Maple's dsolve's numeric BVP solvers are all FDM. RKF45 is a method for IVPs. Occasionally an IVP solver (could be any) is used iteratively as part of a BVP solver in something called the "shooting method". Those are coded ad hoc by users.

Good job, @janhardo ! Vote up. Glad to see that you've learned some modern Maple coding.

@brian bovril There is nothing wrong with Tom Leslie's Answer. However, I'd like to point out that my Answer, while brief, both corrects the one and only error in your worksheet and gives a bit of background information regarding the source of the error, which is understandable given the likelihood of mixing up G and g. So don't you think that it deserves a vote up also?

If my Answer had been posted after Tom's, then indeed it would seem somewhat superfluous. But it wasn't; I posted it 6 hours before Tom's, less than an hour after you posted the Question.

@dharr Your correction of the boundary condition D(f)(0)^2 to (D@@2)(f)(0) is sufficient to correct the "matrix is singular" error, even after the multiplication after delta is used.

@dharr In ODE1, delta appears as a function symbol, but it was intended to be a coefficient. It needs to be followed by a multiplication.

This will lead to a "matrix is singular" error from dsolve. My first try for dealing with that would be to pertube the parameters a little.

I'm not sure, but I think that "too many levels of recursion" is a form of stack overflow, one of the stated types of untrappable error.

@janhardo There are two differences between those two versions of Gradient:

1. Return type: The 1st returns a procedure that returns a list; the 2nd returns a list of procedures. The 2nd is slightly more convenient when calling fieldplot.

2. Arity: The 1st is limited to functions of two variabes; the 2nd works for any number of variables and defaults to 2. (The number of variables of a function is called its arity.)

First 109 110 111 112 113 114 115 Last Page 111 of 711