Carl Love

Carl Love

28035 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

It is not necessary to transform it into a first-order system. The dsolve command does that automatically in the background (in a way that's transparent to the user). The transformation is unique in this case. If it weren't unique, you'd get an error message from dsolve.

Unfortunately, we also need to consider infinity as a parameter which is given a finite value. I'll guess that you're trying to duplicate numeric results from a paper where those results were obtained with RK4 and shooting. To exactly duplicate the results, you'll need to know what finite value the author used for infinity. I've seen some papers on boundary-layer problems (which this happens to be) where that detail unfortunately hasn't been included in the final paper. If that's the case, let me know, because that situation can still be handled.

Your handwriting is highly stylized but seems more suitable for artistic rather than mathematical work.

@ogunmiloro All 14 can be plotted with a single odeplot command like this:

plots:-odeplot(
    ans, 
    `[]`~(T, [indets(sys, typefunc(identical(T), Not(mathfunc)))[]]), 
    T= 0..12, 
    color= [seq]([red, blue, black, purple][1+irem(k,4)], k= 1..14)
);

 

A slightly more sophisticated approach, just as efficient, is as follows:

get:= module()
local 
    ST:= table((parse@lhs=rhs)~(S)),
    ModuleApply:= (index, field::name)-> ST[index][field]
;
end module
:
get(206, mu);
                                508.001018040

In all three methods that I've presented:

  1. The table is only created once, yet can be accessed multiple times.
  2. If a Record is changed, that change will be automatically reflected in the table. This is due to the mutability of Records; it's not a feature that I explicitly added.
  3. Unlike Search, lookup times are not proportional to the number of records; the lookup times are *much* less than that.
  4. The quotation marks are not needed.
  5. There's no need to ever be aware of the position within the list of a particular record.

I don't understand what you don't like about my solution. Would you like it better if it were named get rather than ST?

get:= table((parse@lhs=rhs)~(S)):
get[206]:-mu, get[206]:-sigma;
                       508.001018040, 125.002863204708

Note that the above eliminates the need to use the quotation marks. That's what the parse does.

The repeated use of ListTools:-Search on the same list is very inefficient compared to creating a table. If you only wanted to look up one or two records (which seems unlikely), then Search might be worthwhile.

@Carl Love My final simplification above is superfluous. It says nothing more than h''(x) < 0. 

@brian bovril Don't associate my name with this ridiculous piece of crap:

  • rhs(ST[ListTools:-Search(2, lhs~(ST))]):-mu;
                   ^^^^^^^^^^^^^

There's no point in using Search together with a table.

@Kitonum The first year has an atypically low growth rate. The growth factor for the second and all subsequent years, to the nearest integer, is round((3/2)^12) = 130.

This remains true if we start with any number of females greater than 2 and round down any fractional results, as in

u:= rsolve(
    {u(k)= u(k-1) + trunc(3/4*u(k-2)), u(-1)=0, u(0)=3}, u(k),
    makeproc
):
evalf(u(24)/u(12));

 

@schzan Your only example only used multiplication and exponentiation. My code does not "fail"; it intentionally reports the presence of unexpected input. So, how complicated can these expressions be? Would there ever be division by an indexed variable? Would a function such as abs or sin ever be used applied to an indexed variable? Would exponents other than positive integers ever be used? Should x*u[2] + y*u[2] count as two 2s? Or should it be one 2 because that's the same thing as (x+y)*u[2]. Is it only one base name (such as u) in each expression that can be indexed? Can other non-name expressions be indexed (note that Maple allows almost anything to be indexed, such as (x+y)[3]7[2], etc.)? Can the indices themselves contain further indexed names, such as u[1, u[1,2]]? Are the expressions always algebraic, or might they also contain lists, sets, vectors, etc.? It was you who "failed" to provide these necessary details. 

Note that mmcdara's code will ignore multiple occurences of the same indexed variable within an expression. Is that what you want?

To answer that, we need to know at least the following:

  1. the average litter size
  2. the average proportion of females
  3. The average time interval between litters for a female
  4. the average lifespan, which may be different for males and females
  5. the average age at which a female first gives birth

Thanks for bringing some humor to MaplePrimes. And a Vote Up for a visually impressive and aesthetically pleasing graphic (especially the colors). I haven't read the code yet, but I suspect that there's not much technical complexity to it.

@vv Would you please provide more details about your statement 2? Surely you didn't mean to say "f has values arbitrarily close to 0" because that's a triviality. Did you mean to say that f has zeros arbitrarily close to z=0 (which would be true by Casorati-Weierstrass; however, I don't think that it can be invoked here).

Is z=0 an essential singularity? It doesn't seem so to me. Indeed, is entire. Isn't an essential singularity needed to use Casorati-Weierstrass?

Are you trying to say that there are zeros with arbitrarily small real parts and arbitrarily large imaginary parts due the essential singularity at z=I*infinity?

@Carl Love The last line above can be improved to avoid the mathematically dubious symbolic. Indeed, no assumptions at all are needed:

simplify(exp((lhs-rhs)(sol))) = 1;
                                         2    
                             2 (-x + y(x))     
                             -------------- = 1
                                          3    
                             (-2 x + y(x))     

 

It would be great if simplify (or convert) had a mode specific to equations, treating the equation as a whole. (For those who are unaware, when simplify is applied to an equation, it simplifies the two sides independently (which is certainly consistent with the usage of the word simplify in high-school algebra).) Does anyone here have any thoughts about the feasibility of that? What if it were specific to cases (such as this one) where all transcendental functions can be removed, revealing an underlying polynomial or rational-function equation? What about if transcendental constants were acceptable, but we wanted to remove, if possible, all transcendental functions with variable arguments? Does something like this already exist in the vast convert network described at ?convert,to_special_function?

There's a small mistake in your final solution. If you apply exp to lhs-rhs of any equation, you should put 1, not 0, as the new right side.

@Carl Love Here's a major simplification of the above procedure:

Count:= (C::{thistype, `*`}({name, name^posint}))->
    (Statistics:-Tally @ op~ @ select)(
        type, 
        subsindets([`if`](C::`*`, op, x->x)(C), `^`, `$`@op),
        indexed
    )
:

 

@Carl Love Here's another way to remove the duplicates, which is more direct than Classify:

[entries](table((O-> O:-sol=O)~(SOL)), nolist);

First 114 115 116 117 118 119 120 Last Page 116 of 708