55 Reputation

5 Badges

4 years, 181 days

MaplePrimes Activity

These are replies submitted by bogo

After posting I have noticed that Venkat already replied to Alex. 



@Axel Vogt As far as I understand, Venkat is using the upper limit as a parameter to define a ODE for my YFD(x) in terms of this new parameter he introduced.  The YDF limit is reached setting xi->infinity and setting the parameter x to whatever value we want to evaluate the YDF function at. The IC y(xi=x)=0 comes from the integral definition where the upper and lower limits are the same. Here is an worksheet that hopefully clarifes this. 

F := proc (x, t) options operator, arrow; sqrt(t^2-x^2)*t/(Pi^2*(exp(t)+1)) end proc

proc (x, t) options operator, arrow; sqrt(t^2-x^2)*t/(Pi^2*(exp(t)+1)) end proc


YFD := proc (x) options operator, arrow; Int(F(x, t), t = x .. infinity) end proc

proc (x) options operator, arrow; Int(F(x, t), t = x .. infinity) end proc



YFDParam := proc (xi) options operator, arrow; int(F(x, t), t = x .. xi) end proc

proc (xi) options operator, arrow; int(F(x, t), t = x .. xi) end proc


diff(YFDParam(xi), xi)



ode := diff(y(xi), xi) = diff(YFDParam(xi), xi)

diff(y(xi), xi) = (xi^2-x^2)^(1/2)*xi/(Pi^2*(exp(xi)+1))


IC := y(x) = 0

y(x) = 0





sol := dsolve({IC, ode}, type = numeric, 'parameters' = [x], compile = true, abserr = 0.1e-14, relerr = 0.1e-13)

Warning, relerr increased from .1e-13 to 5.00001e-013


sol('parameters' = [4])

[x = 4.]



[xi = 45., y(xi) = HFloat(0.028061299227548585)]








sol('parameters' = [100])

[x = 100.]



[xi = 150., y(xi) = HFloat(4.848818334864125e-42)]












@ Venkat


Thanks so much for the optimization using the differential reprezentation to solve the integral. That really makes things faster! 


There is one problem I have noticed however. If you want to evaluate sol2 at high arguments. Certainly it is not well defined for x>100 as it stands right now, since in the parametric representation the upper limit of the integral was taken 100. However I have trouble estimating sol2 even at points much lower than this. 

@ Venkat, could you please also explain the role of:  if not type(evalf(x),'numeric') then
      'procname'(x) in your procedural definition of YFD. If that part is ommited we get back to the original error about xi. So what is the role of that line of code and how shold I interpret it? Thanks so much!


For your contributions!

@ Also, I dont really understand how to use initial x value as unknown parameter in the procedure output. Can u sketch a line of maple code of how to do that?

Indeed it works if I set Digits:=20 for stiff=true or rosenbrock so I can now use range and store the values. One question. I will extend this system to many more coupled ODEs. Say about 10000. However, I am interested in plotting only the first few, or combinations of the first few f[n,l]s, such as here f[0,0] and f[1,0]. In other words I wont need stored all the solutions for f[n,l] with arbitrary n and l in the range xini to xmax. With the option range the solution is stored, at least that is my understanding (all the f[n,l]s are computed and stored, so I might reach a problem with memory). So, how to I keep most of the dsolve solutions as procedures that are estimated once we need a their values for a certain x and only a few of them stored in memory for fast accessing when needed, such as the f[0,0](x), f[0,1](x) in the example above. 

@Preben Alsholm Yes, I am generating the ODEs using  two for nested loops, after n and after l. My functions are labeled f[n,l](x) and in each ODE the coefficients are mild functions of n or l (~linearly) but some of them have a very strong dependence on 1/x, such as 1/x^7. And i initialize at x=0.1, which I belive is the reason why I run into trouble with all the other methods. 

@Carl Love Thanks for the clarification.

@Carl Love Thanks, was not aware of this function. Yes, my question was actually related to the previous questions I have asked, since I have noticed Maple was keeping track of solutions that were as small as 10^-87, which for all intents and purposes were irrelevant. 

For all of your imput and help!


You are the best!


Also, I have noticed that in your baseident you isolate the recurrsion relation you will be using. Is there a way to keep things general and just force Maple to use all identities available in FunctionAdviser when manipulating such expressions? Thanks!

Yes, I was thinking about your answer. However my level of Maple syntax is not that sophisticated yet, so I could not fully follow your example. Ill put here the expression that i need to simplify and perhaps you can help me with it?




I can do this myself using the recurrsion relations, but I wanted Maple's help... How do i get Maple to use the FunctionAdviser in simplifying expressions?

And they are not assumed to obey l>0 and |m|≤l (as imposed by solving the Sturm-Liouville eigenvalue problem for the laplace operator on the unit sphere) when maple defines SphericalY. I believe that is the key to why my answer, already made good progress by working with the converted function:


Ylm := convert(SphericalY(lambda, mu, theta, phi), LegendreP) assuming lambda::posint, mu::integer, abs(mu) <= lambda


However even if i can factor out now the l(l+1) eigenvalue, there is a trigonometric expresion of theta that does not simplify to 1. 


After some attempts the expression in question does simplify to 1 if one assumes we are not at the poles on the sphere, where laplace operator is ill defined. However would be nice if maple would just recognize the Laplace on Ylm and spit out -l(l+1)Ylm/r2 without the need for manipulations. 


Page 1 of 1