Solving a BVP with an algebraic equation

Esteemed FreeFEM community,

I have been very much interested in solving BVPs with extra algebraic equations. For your convenience, I am attaching a brief note that describes the system of interest here (it is a simple 1D system of ODEs):

mn_nls.pdf (168.7 KB)

This simple ODE has self-similar blow-up solutions when \sigma>2 that correspond to a nonzero value of the parameter G (it is called the blow-up rate).

I have tried to approach this problem in FreeFEM, and my (hopefully readable) code is attached here too:

test_orthogon_1D.edp (6.2 KB)

that uses Newton’s method. I should mention that I have developed another code too that finds traveling wave solutions, but in that case G=0 and the orthogonality condition is not used. That code works fantastically so I am expecting my variational formulation of the ODE part in the present code to be correct.

Perhaps, the way the orthogonality condition is imposed is not correct because the code always diverges, and there may be another way to do it. I would appreciate any help and insight on this matter.

Thank you very much for your consideration and help in advance,

Stathis.