cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Solve non linear second order differential equation with initial and boundary condition

Re: Solve non linear second order differential equation with initial and boundary condition

Hi Luc,

               It is giving me a different error now. "Matrix is not valid because boundary condition is not valid". This is the same boundary condition used in pdesolve. Also rhs has 5 different parameters in it. Would that not affect it?

 

Regards

Re: Solve non linear second order differential equation with initial and boundary condition

I bet Prime doesn't like the way you set up your init() and bc() functions, using a programming bar.

Anyway. I experimented a little with numol in Mathcad 11, and got this:

LM_20190302_NonLinearPDEsolve.png

Note that I used the very same values as for pdesolve, a few days ago.

What struck me is the fact that phi goes negative here, which I attributed to the fact that your boundary conditions aren't exactly included (notice how bc_func only specifies 0's). I guessed they should be better added as a form of PAE (see help description) but so far have been unlucky in using numol with a PAE construct. And I'm not the only one. I searched this forum, and found no successful examples.

Then I experimented with more spatial resolution: changed nx from 25 to 250. The result is that the pdesolve solution now goes negative like the numol result shown above, but the numol result with that same spatial resolution stays mostly positive.

I hope you can port the implementation to Prime and make it work there. My Mathcad 11 file with pdesolve and numol is attached.

 

Success!
Luc