Dr. David Harrington

2403 Reputation

15 Badges

17 years, 146 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 professor of chemistry at the University of Victoria, BC, Canada, where 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

Maple has not found a solution, but has partly solved the problem (in the second solution with the _a and _b(_a)) by reducing the system of two ODEs down to one. Where you go from here depends on whether you are OK with a particular solution or not, or if you expect a solution in a particular form (e.g. a polynomial). You also have an unknown _C1 which you can eliminate by providing an initial/boundary condition (which might also simplifiy things).. To build a solution from the partial one, you can use buildsol in the DEtools package - see its help page.

As you probably know, you should be able to get a numerical solution even if you can't get an analytical one using dsolve(...,numeric)

LibraryTools:-ConvertVersion converts between .lib and .mla - see the help page.

Maple doesn't seem to know it is separable in my version (2017), but the steps you suggested can be carried out and Maple can solve the ODE.


Allthough there are no explicit solutions, you can still use allvalues to plot them (only first two are real) or process them further


The procedure exits through the return statement (giving the 0.5 output), so code after that is not executed.

ps. array should be Array for moderm Maple.

@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


Your first one can be done as

   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

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?



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.


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


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


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.


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


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


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


5 6 7 8 9 10 11 Last Page 7 of 35