acer

32612 Reputation

29 Badges

20 years, 42 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Sorry, Carl. That was me. Unfortunately there's no way at present for me to toggle the Product entry to a specific Maple version without Mapleprimes considering the Question as being edited. I figured that if I did them in a block it might be more clear that it was a series of no-ops. I try not to do that sort of edit often.

@Melvin Brown You're welcome, Marvin.

@waseem What do you want to combine? With respect to what do you want to collect? Why are you not being clear?

Perhaps you are looking for something like this form?

restart:

with(DETools):
H:=proc(ee)
     local temp;
     temp:=sort([op(indets(ee,And(polynom(integer,r),
                                  satisfies(u->degree(u,r)>0))))],
                (a,b)->degree(a,r)>degree(b,r) and length(a)>length(b));
     subs(map(u->u=freeze(u),temp),ee);
end proc:

P[o](z):=C[o]*exp(lambda*z)+D[o]*exp(-lambda*z):
u[o](r,z):=(1-r^2)*diff(P[o](z),z):
v[o](r,z):=(2*r-r^3)*diff(P[o](z),z,z):

A1:=P[o](z)*u[o](r,z):
A2:=lambda^2*P[o](z)*(1+r^2)+v[o](r,z):

v[1](r,z):=(gamma1^2/16)*diff(P[o](z),z,z)*(2*r-r^3):

u[1](r,z):=G*lambda*(C1^2*exp(2*lambda*z)-D1^2*exp(-2*lambda*z))*(((1-r^4)/16)-((1-r^6)/72))+(lambda/2)*(C1*exp(lambda*z)-D1*exp(-lambda*z))*(1-r^4)-A1*(1-r^2)/4:

gamma1:=4/lambda:
P1:=gamma1^2*diff(u[o](r,z),z,z)+diff(u[1](r,z),r,r)+(1/r)*diff(u[1](r,z),r)-G*(gamma1^2*u[o](r,z)*diff(u[o](r,z),z)+v[1](r,z)*diff(u[o](r,z),r)):

P2:=int(P1,z);

((1/12)*G*lambda*(r^5-3*r^3)*((1/2)*C1^2*exp(2*lambda*z)/lambda+(1/2)*D1^2*exp(-2*lambda*z)/lambda)+(-r^2+1)*r*((1/2)*(exp(lambda*z))^2*C[o]^2+(1/2)*D[o]^2/(exp(lambda*z))^2)-2*lambda*r^3*(C1*exp(lambda*z)/lambda+D1*exp(-lambda*z)/lambda))/r+(-r^2+1)*((1/2)*(exp(lambda*z))^2*C[o]^2+(1/2)*D[o]^2/(exp(lambda*z))^2)+(1/12)*G*lambda*(5*r^4-9*r^2)*((1/2)*C1^2*exp(2*lambda*z)/lambda+(1/2)*D1^2*exp(-2*lambda*z)/lambda)-2*G*(8*(-r^2+1)^2*((1/2)*C[o]^2*lambda^2*(exp(lambda*z))^2+(1/2)*D[o]^2*lambda^2/(exp(lambda*z))^2)/lambda^2-(-r^3+2*r)*r*((1/2)*C[o]^2*lambda^2*(exp(lambda*z))^2+(1/2)*D[o]^2*lambda^2/(exp(lambda*z))^2)/lambda^2)+16*(-r^2+1)*(C[o]*lambda^2*exp(lambda*z)+D[o]*lambda^2*exp(-lambda*z))/lambda^2-6*lambda*r^2*(C1*exp(lambda*z)/lambda+D1*exp(-lambda*z)/lambda)-2*r^2*((1/2)*(exp(lambda*z))^2*C[o]^2+(1/2)*D[o]^2/(exp(lambda*z))^2)

#P[1](z):=simplify(P2);

#ans2:=thaw(factor(combine(expand(H(P2)))));

temp3:=indets(P2,And(polynom(anything,{C1,C[o]}),`+`,satisfies(u->not has(u,r)))):
Rule3:=map(u->u=(uu->K(freeze(numer(uu)))/denom(uu))(factor(combine(expand(u)))),temp3):
ans3:=thaw(eval(collect(subs(Rule3,P2),K,simplify),[K=(()->args)]));

(-2*r^2+1)*(exp(2*lambda*z)*C[o]^2+D[o]^2*exp(-2*lambda*z))-8*r^2*(C1*exp(lambda*z)+D1*exp(-lambda*z))+(1/4)*G*r^2*(r^2-2)*(C1^2*exp(2*lambda*z)+D1^2*exp(-2*lambda*z))+(-16*r^2+16)*(C[o]*exp(lambda*z)+D[o]*exp(-lambda*z))-G*(9*r^4-18*r^2+8)*(exp(2*lambda*z)*C[o]^2+D[o]^2*exp(-2*lambda*z))

simplify(P2-ans3);

0

 

Download waseem_2.mw

If this was your actual goal then why didn't you say so in your original question?

@Carl Love I didn't have a particularly strong reason, except as a single sanity check. (I'm sometimes a little hesitant for trig integrals over a symmetric range about zero, slightly more so when I see the multiple of Pi on the argument.)

I see that Rouben found the same thing, while I was working on it and submitting.

Yet another (much slower) approach that works here is to change variables to make the inner integral range from a=1..infinity, and then do purely numeric integration. Mariusz's nice workaround also serves as another corroboration.

restart;
with(IntegrationTools):
H:=Int(exp(-a^2-b^2-c^2),
       [a=b^2/(4*c)..infinity, b=-infinity..infinity, c=0..infinity]):
T:=ExpandMultiple(H):
T1:=Change(op([1,1],T),a=s*(b^2/(4*c)),[s])
    assuming c>0, b::real:
new:=CollapseNested(Int(Int(T1,op([1,2],T)),op(2..,T))):
evalf(op(0,new)(op(new),epsilon=1e-5));
                          0.9786008269

@waseem The purpose of procedure H is to temporarily freeze the factors that are nontrivially polynomial in r, so that they don't get expanded.

A simpler procedure than I had above is just this:

H:=proc(ee)
  subsindets(ee,And(polynom(numeric,r),`+`),freeze);
end proc:

somesimplification2.mw

@gal Please upload a short Worksheet or Document that demonstrates the problem and attach it to a Reply/Comment.

You can use the green up-arrow in the Mapleprimes editor to upload an attachment.

@Ronan In the unix world it is an old convention to give subdirectories 3-letter names like bin, doc, lib, src, tmp, etc.

The name "src" stood for source.

But it's rather arbitrary.

My point was that perhaps it's not best to store your .mpl plaintext alongside any .mla archives, if only because it (slightly) confuses the special relationship the directory might have to libname and the .mla files. Not a huge deal.

@bliengme You don't need to figure out the scaling factor like 100 yourself, to convert between units of similar dimension (eg, length).

restart;

kernelopts(version);

`Maple 2018.0, X86 64 LINUX, Mar 9 2018, Build ID 1298750`

Diam := 6.1e7 * Unit(nm);

0.61e8*Units:-Unit(nm)

combine(Diam, units);  # default SI unit for length is meter

0.6100000000e-1*Units:-Unit(m)

simplify(Diam); # also turn it into default unit for length

0.6100000000e-1*Units:-Unit(m)

convert(Diam, units, cm); # we can always force a particular conversion

6.100000000*Units:-Unit(cm)

with(Units:-Standard): # top-arithmetic with units will now resolve

Diam + 3.1 * Unit(mm);

0.6410000000e-1*Units:-Unit(m)

restart;

Units:-UseUnit(cm): # make cm the default unit for length

Diam := 6.1e7 * Unit(nm);

0.61e8*Units:-Unit(nm)

combine(Diam, units);  # default length unit is now cm

6.100000000*Units:-Unit(cm)

simplify(Diam);

6.100000000*Units:-Unit(cm)

with(Units:-Standard):

Diam + 3.1 * Unit(mm);

6.410000000*Units:-Unit(cm)

 

Download unitsbasics.mw

@brian bovril You can utilize UseUnit to specify more than one mixed dimension in the same session. So you can call it several times, to force kWh/day as well as USD/day.

restart;

expr := 4.9*Unit(kW)*3.5*Unit(h/day)*0.27265*Unit(USD/kWh);

4.6759475*Units:-Unit(kW)*Units:-Unit(h/d)*Units:-Unit(USD/kWh)

convert(expr, units, USD/d);

4.6759475*Units:-Unit(USD/d)

restart;

Units:-UseUnit(USD/d):

expr := 4.9*Unit(kW)*3.5*Unit(h/day)*0.27265*Unit(USD/kWh);

4.6759475*Units:-Unit(kW)*Units:-Unit(h/d)*Units:-Unit(USD/kWh)

combine(expr, units);

4.6759475*Units:-Unit(USD/d)

 

Download moreuseunit.mw

Could you please supply a simple (single, scalar) expression that illustrates your point?  Showing the expected result would also help.

restart;

kernelopts(version);

`Maple 2015.2, X86 64 LINUX, Dec 20 2015, Build ID 1097895`

expr := %surd(a*%surd(a*'`^`'(a,b),2),c):

InertForm:-Display(eval(expr,1), inert=true);

%surd(a*%surd(a*a^b, 2), c)

new := subs([a=2,b=6,c=4], eval(expr,1)):

InertForm:-Display(eval(new,1), inert=true);

%surd(2*%surd(2*2^6, 2), 4)

value(new);

2*2^(1/8)

 

Download inertsurdmaple2015.mw

(The above produces the same 2D Output in Maple 2018.0 I believe.)

@student_md Please do not post duplicates of this Question.

Please add the details of additional examples in this thread instead.

Please do not inline .pdf copies of papers for which you do not own the copyright. Use the link (URL) button in the editor instead.

I have previously sent you a message about this.

@mmcdara 

As Carl noted in the Post, "Maple's dsolve(..., numeric) allows symbolic input parameters for IVPs but not BVPs." For BVPs, separate calls to dsolve are needed to handle separate sets of parameter values. That may still leave the possibility of using Grid on separate dsolve BVP calls, depending on the goal.

(Slightly related to your comments on using dsolve with parameters for efficiency, in case you're interested: an old post about making animations of IVP solutions.)

@mmcdara If you're interested in details: Statistics is going through ExprectedValue to Moment. In Maple 2017.3 this worked:

c := (exp(1.2*t) - exp(.9*t))/t/.3:
coeftayl(c, t=0, 1);
                     1.050000000

But in Maple 2018.0 that fails.

c := (exp(1.2*t) - exp(.9*t))/t/.3:
coeftayl(c, t=0, 1);
Error, (in coeftayl) the expression does not have a taylor expansion at t = 0

That comes from calling normal on the derivative, and then failing in taking the limit.

c := (exp(1.2*t) - exp(.9*t))/t/.3:
cd := diff(c, t):
limit(cd, t=0);
                   1.050000000

cdn := normal(cd):
limit(cdn, t=0);
                 Float(undefined)

The issue with coeftayl could be fixed. But Statistics might even avoid that altogether by recognizing the special case.

First 245 246 247 248 249 250 251 Last Page 247 of 596