[Python] Implicit solve_ivp cuts down the number of points I want solution for

Discussão em 'Python' iniciado por Stack, Janeiro 26, 2025.

  1. Stack

    Stack Membro Participativo

    I tried using both explicit and implicit methods, where my t_eval is array of size 55. The explicit (default method) outputs an array of size (1x55) which is what I expected.

    [​IMG]

    Where as when I try the implicit 'BDF' method I see only the first two values are stored in my solution:

    [​IMG]

    Not sure if it is related to the events thing or something else. The problem I am solving seems stiff so implicit method might help me. I tried changing the step size by using scipy.integrate.BDF directly but it still did not work. This is the code sample I use for both instances:

    sol = solve_ivp(F, [0.1, 1.1], [c_p - h_p[0]], t_eval=h_p)

    sol = solve_ivp(F, [0.1, 1.1], [c_p - h_p[0]], t_eval=h_p,
    method='BDF', jac=jac)

    Continue reading...

Compartilhe esta Página