dharr

Dr. David Harrington

8482 Reputation

22 Badges

21 years, 34 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

@DarkMath Your examples

f(h(r)) ==> int(h(r),r)
f(h(r+a)) ==> int(h(r+a),r)

require different code. The second one somehow has to know that "r" and "a" have different roles, otherwise you will get

int(h(r+a),r+a)

Your first one can be done as

f:=proc(g::function)
   int(g,op(1,g));
   end proc;

then f(h(y)) gives int(h(y),y)

But then you can't pass an expression to f, so not sure if this is exactly what you want.

Edit: For your second one, if it will always be "a", you can do

f:=proc(g::function)
   int(eval(g,op(1,g)=op(1,g)+a),op(1,g));
end proc;

Then f(h(y)) gives int(h(y+a),y)

I just downloaded the latest MaplePlayer (Windows 64 bit, 2020.1) and loaded a Maple Worksheet with a text area component, and was able to select the contents and use ctrl-C to copy. It pasted into a text file (empty notepad file) as I expected. So perhaps this is a version issue or you wanted to copy other types of content?

use 

infolevel[sum]:=5;

Then enter the sum (rather than Sum) and some information is given:

sum: process the input arguments
sum: definite sum
ClosedForm: try the front-end to compute simple definite sums
ClosedForm: simple definite summations
ClosedForm: try the method of integral representation
ClosedForm: try the method of first computing the indefinite sum
ClosedForm: infinite summation
Indefinite: process the input arguments
ClosedForm: try the method of converting the definite sum to hypergeometric functions
ClosedForm: definite summation using hypergeometric functions
ClosedForm: definite summation using hypergeometric functions

So Maple has some routine that does definite summation using hypergeometric functions, which is what you deduced already I believe. You can trace the actual calls and figure out more using "trace", but following the Maple code can be difficult.
 

dsolve directly gives the general solution in terms of unspecified constants _C1 etc. For each initial condition you specify there will be one fewer unknown constant. It's not clear to me exactly what else you want.

GeneralSolution.mw

Well, I don't think it should hang. On the other hand if you try it (Maple 2017) without assumptions then it gives GAMMA(n+1) (I didn't need method =MeijerG). And with an extra step you can get Maple to tell you what you need, a bit like Mathematica.

FunctionAdvisor(GAMMA); under definition shows that GAMMA(z) is defined for Re(z)>0, and under singularities shows:

Or(z::nonposint, z = infinity+infinity*I)

So this can be a guide to what assumptions would work. 

subs is more typically used for substituting an expresion into a variable, not the other way arround, although if the expression is directly part of your larger expression, you can sometimes be successful, and tricks are available, as the others have pointed out.

so for

f:=exp(-a)*(b + c)*1/k;

instead of subs(exp(a)=p,f) you can use

subs(a=ln(p),f);
simplify(%);

which gives (b+c)/(p*k), which I think is what you wanted

For the case of subs(exp(a)*k=p,f), you can likewise do

solve(exp(a)*k=p,a);
subs(a=%,f);
simplify(%);

which gives (b+c)/p.

algsubs can do some substitutions of the form expression=variable, but there are restrictions on the form of expression, so it is not that general and doesn't work for the exp() here.

@pik1432 if your convert all your floats to rationals and then try solve, it does it in terms of the roots of a quadratic. The (0,0) solution is not a solution to the original equations, since making the denominator zero leads to infinity (if you take the limit), so I think Maple knows that and removes it from consideration (if it does it by multiplying each side as you suggest).

The problem is with differentiation of the abs. Probably that term has already been processed from some form without the abs and it might be simpler to use dchange on that earlier PDE. But for the given form, moving to magnitude and phase form so there are no abs to differentiate and then using dchange leads to almost the desired answer, but there is still an exponential that doesn't disappear - not sure if there are some other assumptions that make that disappear or if the original problem is not well-formulated or if there is a small error in the worksheet.

transform3.mw

Edit: here I choose the theta to arbitrarily remove the exp, and derive the formula for v

transform4.mw

...but to answer your original question, one way is to make a function (proc) that takes a Vector, and use seq

seq.mw

Profiling the code shows nearly all of the time is spent on the solve line, so changing to map or eval won't help you. I'm guessing changing to fsolve or something from the RootFinding package is the next step

Roots_with_map.mw

As @Preben Alsholm and others have shown, you can get numerical values of sigma as a function of lambda, k and Q.

But you can get an explicit formula for lambda in terms of sigma, which enables plotting sigma vs lambda for fixed k and Q, and may be useful for further manipulations. A lot depends on what you what to do and what are expected ranges of lambda, sigma, k and Q

Real_root.mw

evalc converts to real and imaginary part: evalc(exp(I*x))

It can execute in about a minute on my machine for n=25 if you compile it. You need to set up the Vector outside the procedure and then it will be updated on exit. I didn't check the output or try to follow the algorithm, so hope it has worked correctly.

Mobius.mw

[Edit: I got it further down from about a minute to 20 seconds by redoing the algorithm - the worksheet runs through my logic and several rounds of improvements and compares with the Matrix. Possibly could be improved slightly more.

Hadamard_and_BooleMobius_Transforms.mw

I still got sporadic integer overflow errors - maybe a memory or garbage collection from too many 2^25 x 2^25 matrices.

]

 

Interesting. Trying DEtools:-dalembertsol(ode,y(x)); returns the empty set, suggesting Maple doesn't really think it is d'Alembert. However, for other equations that odeadvisor doesn't classify as dalembert, such as ode2:=diff(y(x),x)=y(x)^2, dalembertsol(ode2,y(x)) does return a parametric solution.

Since there might be lots of ways to transform to dalembert, I'm guessing that odeadvisor's result is more of a hint, and it doesn't try that hard to check it, but dalembertsol does.

seq(fracdiff(v(t), t,alpha),alpha=-1..1.5,0.5);

gives (1/2)*t^2, .7522527780*t^(3/2), 0., 1.128379167*t^(1/2), 0., 0.

So the ones that are zero are just running along the x-axis and are hard to see.

First 53 54 55 56 57 58 59 Last Page 55 of 83