Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

I would guess that deleted material is stored somewhere; however, the Moderators who delete it have no access to it nor any knowledge of where it's stored.

@nm Okay, I thought that your main issue was timelimit not working since you've written about that many times before, and it is the point most emphasized in your Question.

If you add assuming x > 0 to the dsolve command, it returns the explicit solution in half a second. For x < 0, I guess that there are a countable infinity of branched solutions, and this may be confusing dsolve.

@janhardo There is no log10 in formal abstract calculus, where log (no subscript) means the natural logarithm and can also be denoted ln.

@janhardo If I post a plaintext transcription of a Maple session, the red text is the input and the blue text is the output. You generally can't copy-and-paste the output for reuse as input, which is what you did with my last line exp(x t).

If you differentiate an indefinite integral (both operations being performed with respect to the same variable), you get back the integrand not the integral. The integrand is exp(x t).

Try this:

restart; 	
J:= Int(exp(t*x), x);
J1:= subs((SUB:= t= alpha+beta*I), J);
J2:= evalc([Re,Im](J1));
J3:= J2 =~ simplify(value(J2));
print~(J3):
 
#reversion to original integrand:
simplify(
    convert(diff(evalc(Complex(rhs~(J3)[])), x), exp),
    {rhs=lhs}(SUB)
);
                            exp(t x)

 The output of print~(J3): should be exactly the integral formulas that you're looking for.

@mmcdara The Iterator package (I think it's from Maple 2016) is for high-speed, low-memory generation of combinatorial objects; it's not for arithmetic and can't help with this. The above computation can be speeded up substantially with evalhf, which I'm thinking about now.

@jennierubyjane You can include fixedparameter in the eval call in the dsolve call by replacing Pr= L[k] with

{Pr= L[k], fixedparameter[]}

But you can't use Nb=0 because Nb is a denominator in one of the ODEs.

Here's an interesting fractalish plot:

A:= Iterate(x-> 3.7*x*(1-x), 0.23, 10^7): #using same Iterate defined above
T:= Statistics:-TallyInto(A, 0..1, bins= 1000):
PlotIt:= proc(T::list(range(realcons)= nonnegint))
local r:= op~(1,T), L:= lhs~(r), R:= rhs~(r), F:= op~(2,T);
    plot(
        `[]`~(`[]`~(L,0), `[]`~(L,F), `[]`~(R,F), `[]`~(R,0)),
        color= black, thickness= 0
    )
end proc
:
PlotIt(T);

@janhardo After differentiating the evaluated integral, you can get back to the original integrand like this:

J:= Int(exp(t*x), x);
J1:= subs(t= a+b*I, J);
evalc(J1);
value(%);
simplify(convert(diff(%, x), exp), {a+b*I= t});
                            exp(x t)

The order of applying evalc and value doesn't matter.

@janhardo When you use the notation x+I*y, you're likely assuming, perhaps subconsciously, that x and are real; however, Maple doesn't automatically assume this. It assumes that all variables are complex unless told otherwise, and regardless of the presence of I. The command evalc will temporarily assume that variables are real so that expressions can be separated into their real and imaginary parts. So, compare Re(x+I*y) with evalc(Re(x+I*y)).

It's not needed to explicitly have an I for complex operations to be used. They're simply used by default. For example, the derivative of sin(x) is cos(x) regardless of whether is real. Unless told otherwise Maple is not assuming that it's real.

@Pepini The code that you showed doesn't actually use TallyInto; it uses Histogram instead. That's a fine alternative if you don't need programmatic access to the actual counts for some future purpose.

Here's complete code for your problem:

Iterate:= proc(f, x0::complexcons, N::posint)
local A:= Array(1..N, [x0], datatype= hfloat);
    evalhf(
        proc(f, A, N)
            for local k from 2 to N do
                A[k]:= f(A[k-1])
            od
        end proc
        (f, A, N)
    );
    A
end proc
:
A:= CodeTools:-Usage(Iterate(x-> 3.7*x*(1-x), 0.2, 10^7)):
memory used=76.30MiB, alloc change=76.30MiB, 
cpu time=2.83s, real time=2.85s, gc time=0ns

T:= Statistics:-TallyInto(A, 0..1, bins= 40);
PlotIt:= proc(T::list(range(realcons)= nonnegint))
local x;
    plot(
        [seq]([
            [op([1,1],x),0], [op([1,1],x),op(2,x)], 
            [op([1,2],x),op(2,x)], [op([1,2],x),0]
        ], x= T
        ), color= black, thickness= 0
    )
end proc
:
PlotIt(T);

It takes about 3 seconds to generate the 10 million points. The time for the tallying and plotting is too small to even measure.

@nm Please let me know if you find any cases where the identity method doesn't work, either false positive or false negative. I'd be surprised if there was a false positive (an incorrect p value returned), but not surprised at a false negative (no p found when the function is indeed isobaric). For any false negative, I wonder if any other general technique can find the p.

The documentation for solve(identity(...)) says that the syntax allows for the declaration of one free variable. I chose a to be the declared free variable, but x and y are also free. Thus, my confidence in this technique is not as high as it could be.  

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.

First 106 107 108 109 110 111 112 Last Page 108 of 708