dharr

Dr. David Harrington

838 Reputation

13 Badges

14 years, 325 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 1992.

MaplePrimes Activity


These are replies submitted by dharr

@one pound A lot depends on what you want to do. The sin-cos form with only positive frequencies is equivalent to the exp form with positive and negative frequencies. I usually work with the series with regular Maple commands such as integration to find the coefficients for a given periodic function.

Download Fourier.mw

@Carl Love Isn't the whole process called "changing variables" :)

@Nadeem_Malik Perhaps our responses got out of sequence, but you still haven't assigned the result of Infinitesimals to a variable and then used it for InfinitesimalGenerator. See worksheet Wsheet3.mw in my earlier response.

@Nadeem_Malik You didn't assign the infinitesimal output to the variable infies before using it. Here there is only one output so you don't need indexing. But this gives a new technical error, which I don't understand because I don't know much about Lie Algebra.

Wsheet3.mw

@Nadeem_Malik use variables or ctrl-L

 

restart;

with(PDEtools):

declare(u(x,t));
U:=diff_table(u(x,t));

u(x, t)*`will now be displayed as`*u

 

table( [(  ) = u(x, t) ] )

(1)

PDE := U[x,x]-U[t];

diff(diff(u(x, t), x), x)-(diff(u(x, t), t))

(2)

infies:=Infinitesimals(PDE);  #put the sequence of answers in a variable

[_xi[x](x, t, u) = 0, _xi[t](x, t, u) = 1, _eta[u](x, t, u) = 0], [_xi[x](x, t, u) = 1, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = 0], [_xi[x](x, t, u) = 0, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = u], [_xi[x](x, t, u) = (1/2)*x, _xi[t](x, t, u) = t, _eta[u](x, t, u) = 0], [_xi[x](x, t, u) = -2*t, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = x*u], [_xi[x](x, t, u) = 0, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = exp(_c[1]*t)*exp(_c[1]^(1/2)*x)], [_xi[x](x, t, u) = 0, _xi[t](x, t, u) = 0, _eta[u](x, t, u) = exp(_c[1]*t)/exp(_c[1]^(1/2)*x)], [_xi[x](x, t, u) = (1/2)*t*x, _xi[t](x, t, u) = (1/2)*t^2, _eta[u](x, t, u) = -(1/8)*x^2*u-(1/4)*u*t]

(3)

infies[-1];  #the last one

[_xi[x](x, t, u) = (1/2)*t*x, _xi[t](x, t, u) = (1/2)*t^2, _eta[u](x, t, u) = -(1/8)*x^2*u-(1/4)*u*t]

(4)

InfinitesimalGenerator(infies[-1],u(x,t)); # use it

proc (f) options operator, arrow; (1/2)*t*x*(diff(f, x))+(1/2)*t^2*(diff(f, t))+(-(1/8)*x^2*u-(1/4)*u*t)*(diff(f, u)) end proc

(5)

InfinitesimalGenerator((3)[-1],u(x,t)); # or use ctrl-L to get the equation number

proc (f) options operator, arrow; (1/2)*t*x*(diff(f, x))+(1/2)*t^2*(diff(f, t))+(-(1/8)*x^2*u-(1/4)*u*t)*(diff(f, u)) end proc

(6)

 


 

Download Infinitesimals2.mw

 

@ahmadtalaei  These cannot be converted to LegendreP because the first two arguments are not in the form [-a,a+1] for any a, as required for LegendreP. So these hypergeometric functions come from a differential equation that is not equivalent to the LegnedreP one.

restart

sol[1] := hypergeom([3/4+(1/4)*sqrt(1+4*_c[1]), 3/4-(1/4)*sqrt(1+4*_c[1])], [1/2], cos(phi)^2)+hypergeom([5/4+(1/4)*sqrt(1+4*_c[1]), 5/4-(1/4)*sqrt(1+4*_c[1])], [3/2], cos(phi)^2)

hypergeom([3/4+(1/4)*(1+4*_c[1])^(1/2), 3/4-(1/4)*(1+4*_c[1])^(1/2)], [1/2], cos(phi)^2)+hypergeom([5/4+(1/4)*(1+4*_c[1])^(1/2), 5/4-(1/4)*(1+4*_c[1])^(1/2)], [3/2], cos(phi)^2)

X1 := op(op(1, sol[1]))[1]; Equate(%, [-a, a+1]); solve(%, allsolutions)

[3/4+(1/4)*(1+4*_c[1])^(1/2), 3/4-(1/4)*(1+4*_c[1])^(1/2)]

[3/4+(1/4)*(1+4*_c[1])^(1/2) = -a, 3/4-(1/4)*(1+4*_c[1])^(1/2) = a+1]

X2 := op(op(2, sol[1]))[1]; Equate(%, [-a, a+1]); solve(%, allsolutions)

[5/4+(1/4)*(1+4*_c[1])^(1/2), 5/4-(1/4)*(1+4*_c[1])^(1/2)]

[5/4+(1/4)*(1+4*_c[1])^(1/2) = -a, 5/4-(1/4)*(1+4*_c[1])^(1/2) = a+1]

FunctionAdvisor(definition, LegendreP)

[LegendreP(a, z) = hypergeom([-a, a+1], [1], 1/2-(1/2)*z), MathematicalFunctions:-`with no restrictions on `(a, z)], [LegendreP(a, b, z) = (z+1)^((1/2)*b)*hypergeom([-a, a+1], [1-b], 1/2-(1/2)*z)/((z-1)^((1/2)*b)*GAMMA(1-b)), (1-b)::(Not(nonposint))]

 


 

Download nosolutions.mw

@ahmadtalaei  Your last expression can be converted back to LegendreP in version 2017.3 using convert(expr,LegendreP)

convert-Legendre-v2.mw

You need to upload your worksheet using the green up-arrow. At the moment, I can't reproduce the solution of the differential equation shown in the link, and odeadvisor doesn't suggest Legendre. So maybe there is a typing error, which is why the others are suggesting you definitely need to be clear about what expression you want converted. In principle, convert(expr,StandardFunctions) with assumptions on n should do what you want.

You have numpoints 100000 for the plots, which is probably why I had upload issues. This is only for making more points in the plots to make it look nice, so surely you don't need more that about 200, and probably the default 49 is OK.

Use the green up arrow to load your worksheet

@Preben Alsholm If you open a new worksheet, create code and then run, currentdir() still points to mapledir. But if you save the worksheet and then reopen it, it will point to the same directory as the worksheet, worksheetdir. I guess I have the habit of keeping/creating files where the worksheet is.

Of course the OP can replace the whole filename with whatever they want.

If you upload your worksheet with the green up arrow, then someone can take a look at it without clicking on a strange website.

Note that D has special meaning in Maple, use "local D;" to redefine it as just a variable or (better) use a different name.

But on the face of it the solution looks OK - what makes you think it is wrong?

please upload your worksheet using the fat green up arrow, then someone can check it. 

@zia I haven't heard about that method but it sounds like that is outside the scope of a Maple question unless you have started a Maple worksheet you need assistance with.

@acer  Fair enough. It just seemed to me that the effort to work out many terms of the sequence exceeded the work to figure out the (mixed) recurrence, which somehow was a more logical way to approach the problem.

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