I'm trying to solve a second order nonlinear differential equation by using central difference. In this case, I obtain a system of nonlinear equations where T denotes time. First I create a vector of symbolic variables, by using these variables I create another vector where I put my nonlinear functions, and then by using
I convert my nonlinear functions into a single function handle. Finally, I try to solve this system by fsolve using the code;
where and f is the function handle I mentioned before. My code is working properly for , and , but when I try to take fsolve runs for a couple of minutes and then stops after giving nowhere near the actual values and this respond:
Equation solved, inaccuracy possible.
The vector of function values is near zero, as measured by the selected value
of the function tolerance. However, the last step was ineffective.
<stopping criteria details>
I tried to take,
as initial values but none of them solve this issue, only
gave better results among the others. I solved this differential equation by another numerical method and by forward difference. In the case where I use forward difference, I used fsolve again and it worked perfectly fine. I also checked the similar discussions, but none of them helped. I'll be grateful for any help. Thanks in advance.