dharr

Dr. David Harrington

9339 Reputation

22 Badges

21 years, 334 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 replies submitted by dharr

@C_R The weights are chosen so that exact solutions would be obtained for solutions that were polynomial in the space "x" coordinate of degree up to n-1. This gives you freedom to choose the x node locations. (I assume this is what you mean by elastic; that's new terminology for me.) (The method of lines uses finite differences in the x direction instead; neither of them are FEM) Of course intuitively you will do better if they are more closely spaced near where the solution is changing most rapidly. Just as in regular integration, you can do better if you choose the node locations optimally (gaussian quadrature) - then you get agreement to polynomials with twice the degree. 

The following paper doi: 10.1016/0098-1354(89)85051-3 has a nice discussion of some of the tradeoffs. Of course anything can be improved but at some point someone (or at least for me) becomes too involved in the numerical method development rather than the problem solving; and there are often good routines existing out there.

@Aliocha So it seems you are interested in the definite integral? Mariusz's answer can be modified to show the definite integral is n*Pi. I used simplify(...,symbolic), which isn't optimum. There are probably some series of smaller simplifications/conversions with assumptions that might get there instead of simplify/symbolic.

restart

with(IntegrationTools)

[Change, CollapseNested, Combine, Expand, ExpandMultiple, Flip, GetIntegrand, GetOptions, GetParts, GetRange, GetVariable, Parts, Split, StripOptions, Utils]

R := Int(factor(convert((1-cos(x*n))/(1-cos(x)), exp)), x)

R1 := `assuming`([simplify(value(Change(R, exp(I*x*n) = t, t)))], [n::posint])

R2 := `assuming`([value(simplify(eval(R1, t = exp(I*x*n))))], [n::posint])

(-I*exp(-I*x*n)*n*((exp(I*x*n))^(1/n)-1)*(LerchPhi(1/(exp(I*x*n))^(1/n), 1, n)+exp(I*x*n)*ln(1-1/(exp(I*x*n))^(1/n))-1/n)+I*n*((exp(I*x*n))^(1/n)-1)*ln(-(exp(I*x*n))^(1/n)+1)+I*exp(I*x*n)*n*((exp(I*x*n))^(1/n)-1)*LerchPhi((exp(I*x*n))^(1/n), 1, n)+(Pi*n-I*ln(exp(I*x*n)))*(exp(I*x*n))^(1/n)+I*exp(-I*x*n)+I*exp(I*x*n)+I*ln(exp(I*x*n))-Pi*n-2*I)/((exp(I*x*n))^(1/n)-1)

Definite integral

D2 := `assuming`([eval(R2, x = Pi)-(limit(R2, x = 0))], [n::posint])

(-I*(-1)^(-n)*n*(((-1)^n)^(1/n)-1)*(LerchPhi(1/((-1)^n)^(1/n), 1, n)+(-1)^n*ln(1-1/((-1)^n)^(1/n))-1/n)+I*n*(((-1)^n)^(1/n)-1)*ln(-((-1)^n)^(1/n)+1)+I*(-1)^n*n*(((-1)^n)^(1/n)-1)*LerchPhi(((-1)^n)^(1/n), 1, n)+(Pi*n-I*ln((-1)^n))*((-1)^n)^(1/n)+I*(-1)^(-n)+I*(-1)^n+I*ln((-1)^n)-Pi*n-2*I)/(((-1)^n)^(1/n)-1)-Pi*n-I

Check it is n*Pi

`assuming`([simplify(-Pi*n+D2, symbolic)], [n::posint])

0

Or f(n+1) - f(n)

`assuming`([simplify(eval(D2, n = n+1)-D2, symbolic)], [n::posint])

Pi

``

Download definite_integral.mw

 

@Rouben Rostamian  This runs identically in 2026.1

@sreilly17 Sorry, that's all I know, and going to the page you mentioned just gets a firewall error message (a common random problem on maplesoft's web pages). I can only suggest you contact customer support.

@Mariusz Iwaniuk Nice, vote up. You could do R3 := value(R2) assuming n::posint; to evaluate the summation.

Maplesim is a separate product from Maple, and is not included with the full version of Maple. So I doubt it is included in the student version. If you have some reason to think otherwise, you could contact customer support via the Maplesoft website.

@C_R As you probably know, BC4 is part of the mathematical specification of the problem and is necessary. The general solution to Bessel's DE is a linear combination of BesselJ and BesselY. But BesselY becomes infinite at r=0, so we need BesselJ, which already has its derivative zero at r=0 (except for BesselJ(0,r)). So by choosing BesselJ (as @Rouben Rostamian did), BC4 is automatically satisfied.

@bashar27 Your explanation was in the title and cut off; we just got "mainly i need to collect independent term after...". So please upload your worksheet and put your explanation in the body of the post.

I think the point about a "time" variable is that the the associated conditions are "initial" conditions, so if it isn't actually time it can be treated as time if the conditions only specify one end of its domain, in contrast to a spatial variable where boundary conditions are specified at both ends of the domain. See the description of the "time" option. "These options are typically needed only for first order non-periodic problems where only one of the end points appears in the condition." So it looks to see if there are conditions at one or both ends of the domain.

If you specify your rod problem in more detail it might be easier to answer, but I'm guessing you have conditions at both ends of the rod, and at both ends of the radius (r=0 and r=rod_radius), so no.

If collect(equ,tanh) doesn't do what you want, then you will need to explain exactly what you want to do. Your tanh's are inside JacobiSN etc, so probably you can only simplify the arguments of JacobiSN etc in some way. But what way? You also have sech, sinh, cosh; do you want to convert them all to tanh? Does convert(equ,tanh) help?

As far as I know, Maple can't directly solve 2-d recurrences, but it does have various tools to help you find a solution. If p was a known integer, then this probably could be done by first making generating functions in one of the variables, solving the 1-d recurrence in the generating functions, then finding the coefficients by Laplace inversion. I'm less certain if p is unspecified. So what are the restrictions on p?

But in any case, what is P(0,0)? You have P(0,m) = 1 but P(n,0)=0. Mariusz's solution gives P(0,0)=0 - is this correct?

@Rouben Rostamian  Yes, this also works in Windows (relative to currentdir(), which is usually the same as worksheetdir)

@C_R On Windows 11 and Maple 2026.1, print with Adobe or with "Microsoft print to pdf" give visually identical results - no strange characters. There are 3 t's on the second page before "new page". If there was supposed to be a page break in the .mw file I do not see it.

@janhardo In a document, ctrl-J inserts an execution group, but if you then type commands they are 2D if 2D is your global setting, or 1D if that is your global setting (i.e. the setting under File - options - display - input display.). ctrl-m/ctrl-r change to 1D/2D mode whether you are in an execution group or a document block.

Maple's help page ?DEtools,singularities uses "ordinary point" rather than "regular point" in the nonsingular case as does the DLMF, whiich I tend to use as an authoritative source. So I agree that ordinary point is probably better than the regular point used in the YouTube video, especially to avoid confusion with a regular singular point.

1 2 3 4 5 6 7 Last Page 1 of 105