Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Unstable numerical solution of diff. eq.' topicStudent Support Forum > General > Archives > "Unstable numerical solution of diff. eq."

Help | Reply To Topic
Author Comment/Response
Zaven Navoyan
09/27/12 08:37am

Hello, I'm trying to model real physical process of movement of a charged system in a liquid. As a result I get two equations for two regions [0,1) and [1,inf). These two equations are connected to each other by boundary conditions, so they must be solved together.
In some cases Mathematica is able to solve the system and plot results. The problem arises when I change coefficients - the result diverges. All coefficients (old and new ones) have physical meanings, so the system should have solution. Below are the equations. s1 completely diverges while s2 have solution (which accurately describe the process only in [0,3.5] interval). The BC of second equation (Psi2) states that at infinity the solution should be equal to zero. I tried to put infinity symbol, but got an error. Then I tried to put very big number with no success. In below sample I use point 100 instead of infinity. May be this can be source of the problem ? Can you please give an advice what can be problem?

s1 = NDSolve[{Subscript[\[Psi], 1]''[y] ==
50*Sinh[Subscript[\[Psi], 1][y]] - 8,
Subscript[\[Psi], 2]''[y] == 25*Sinh[Subscript[\[Psi], 2][y]],
Subscript[\[Psi], 1]'[0] == 0,
Subscript[\[Psi], 1]'[1] == 2*Subscript[\[Psi], 2]'[1],
Subscript[\[Psi], 2][100] == 0,
Subscript[\[Psi], 2][1] ==
Subscript[\[Psi], 1][1]}, {Subscript[\[Psi], 1][y],
Subscript[\[Psi], 2][y]}, {y, 0, 4}];

s2 = NDSolve[{Subscript[\[Psi], 1]''[y] ==
2*Sinh[Subscript[\[Psi], 1][y]] - .3,
Subscript[\[Psi], 2]''[y] == 1*Sinh[Subscript[\[Psi], 2][y]],
Subscript[\[Psi], 1]'[0] == 0,
Subscript[\[Psi], 1]'[1] == 2*Subscript[\[Psi], 2]'[1],
Subscript[\[Psi], 2][100] == 0,
Subscript[\[Psi], 2][1] ==
Subscript[\[Psi], 1][1]}, {Subscript[\[Psi], 1][y],
Subscript[\[Psi], 2][y]}, {y, 0, 4}];

p1 = Plot[
Which[0 < y < 1, Evaluate[Subscript[\[Psi], 1][y] /. s1], y >= 1,
Evaluate[Subscript[\[Psi], 2][y] /. s1]], {y, 0, 4}]

p2 = Plot[
Which[0 < y < 1, Evaluate[Subscript[\[Psi], 1][y] /. s2], y >= 1,
Evaluate[Subscript[\[Psi], 2][y] /. s2]], {y, 0, 4}]

Thanks,
Zaven



URL: ,
Help | Reply To Topic