Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-07-10 Thread 'Stéphane Laurent' via julia-users
Hello Sheehan, I get a failure with the following example, do you have an idea about the why ?: *# solves u = phi²*sinh(u)-2u'/(x+gamma) , u'(a)=-xi, u'(R)=0* *a= 3.514457e-07* *R= 7.60773e-07* *x=Fun(identity, Interval(a,R))* *d=x.domain* *B=neumann(d)* *D=diff(d)* *# Solves Lu + g(u) == 0*

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-07-10 Thread Sheehan Olver
Hi Stephane, It's a problem of accurate initial guess. I got a good initial guess by doing a homotopy down from phi=1000.The solution should be

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-22 Thread 'Stéphane Laurent' via julia-users
Thank you for the explanations. Reading your papers is on my LOTTD. Some pub for you here http://stats.stackexchange.com/a/104290/8402 ;)

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Hello, I'd like to solve this equation with Neumann boundary conditions. My code below does not work. Am I doing something bad or is it a failure of the Newton algorithm ? *# solves u = (exp(u)-exp(-u))-2u'/(x+1) , u'(0)=-1, u(1)=0* *x=Fun(identity, Interval(0.,1.))* *d=x.domain*

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
Hi, You didn’t quite get the Newton iteration right: if you want to solve B u + [1,0] = 0 L u + g(u) = 0 then Newton iteration becomes u = u - [B, L + g’(u)]\[B u + [1,0], L u + g(u)] i.e., your bc right hand side is not right. Below is the corrected

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Ok, I understand. It works and it is really awesome. Thank you ! Le samedi 21 juin 2014 12:17:22 UTC+2, Sheehan Olver a écrit : Hi, You didn’t quite get the Newton iteration right: if you want to solve B u + [1,0] = 0 L u + g(u) = 0 then Newton iteration becomes u = u - [B, L +

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
Thanks! I'm interested to know if the ultraspherical spectral approach has any clear advantages over spectral collocation for nonlinear odes. (For linear odes the advantages are clear.) So if you find the code better than expected please let me know. It's a bit buggy and unoptimized, so

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread 'Stéphane Laurent' via julia-users
Sorry but I really don't understand you first sentence. About the code, I will possibly experiment it during the next days or weeks, and I'll send you some feedback. Thank you again for this library and your help. - Stéphane Le samedi 21 juin 2014 14:24:03 UTC+2, Sheehan Olver a écrit :

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
Sorry for the confusion, the numerics for linear ode solving in ApproxFun is built on the ultra spherical spectral method by myself and Alex Townsend: A fast and well-conditioned spectral method, SIAM Review, 55: 462–489 http://epubs.siam.org/doi/abs/10.1137/120865458 It's different from

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-21 Thread Sheehan Olver
Btw I fixed a bug so now norm((exp(u)-exp(-u))-2diff(u)./(x+1)-diff(u,2)) returns 0.0 (not sure why not machine eps…) On 21 Jun 2014, at 10:58 pm, 'Stéphane Laurent' via julia-users julia-users@googlegroups.com wrote: Sorry but I really don't understand you first

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-20 Thread 'Stéphane Laurent' via julia-users
Thank you, it works !! NB: I'm Stéphane and not Stéphanie :-) Le vendredi 20 juin 2014 00:13:08 UTC+2, Sheehan Olver a écrit : Hi Stephanie, Are you on the latest GitHub version? You can get on it with Pkg.checkout(ApproxFun) Sent from my iPad On 20 Jun 2014, at 3:19 am, 'Stéphane

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-20 Thread Sheehan Olver
Cool! Let me know if you want any functionality added to make it useful. Sent from my iPhone On Jun 20, 2014, at 11:11 PM, 'Stéphane Laurent' via julia-users julia-users@googlegroups.com wrote: Thank you, it works !! NB: I'm Stéphane and not Stéphanie :-) Le vendredi 20 juin 2014

Re: Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-19 Thread 'Stéphane Laurent' via julia-users
Hello Sheehan, I get this error when I run your code: julia for k=1:5 u=u-[B,L+gp(u)]\[0.,0.,L*u+g(u)-1.]; end ERROR: Reducing over an empty array is not allowed. in _mapreduce at reduce.jl:151 in mapreduce at reduce.jl:173 in old_addentries! at

Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-19 Thread Sheehan Olver
Hi Stephanie, Are you on the latest GitHub version? You can get on it with Pkg.checkout(ApproxFun) Sent from my iPad On 20 Jun 2014, at 3:19 am, 'Stéphane Laurent' via julia-users julia-users@googlegroups.com wrote: Hello Sheehan, I get this error when I run your code: julia for

Re: Re: [julia-users] ApproxFun v0.0.1 with ODE solving

2014-06-11 Thread Sheehan Olver
Hi Stèphane, Nonlinear is not built in, but it’s easy enough to do by hand with Newton iteration in function space. Let me know if there is any confusion with the code below. I suppose I could just add a “nonlinsolve” routine that bundles this up. (I am on the latest

[julia-users] ApproxFun v0.0.1 with ODE solving

2014-03-23 Thread Sheehan Olver
I tagged a new release for ApproxFun (https://github.com/dlfivefifty/ApproxFun) with major new features that might interest people. Below are ODE solving and random number sampling examples, find more in ApproxFun/examples. The code is meant as alpha quality, so don't expect too much beyond