4
$\begingroup$

enter image description here

enter image description here

enter image description here

I am trying to solve this with odeint module. But the first equation is function of second equation. If i ignore dw/dz in first equation and second equation is function of first one. I can solve it simply using odeint. I can solve these equation through fsolve through forward differential. But is it possible i can use Odeint with fsolve? and solve first two equation simultaneously to find.

$\endgroup$
6
  • $\begingroup$ As it is right now, your question is not clear enough and it looks like you want that somebody else solve your problem for you. I suggest that you edit your question adding what specific problem are you having with the solution in Python. $\endgroup$
    – nicoguaro
    Jul 31 at 16:46
  • 1
    $\begingroup$ If your question is about how to solve these problems in Python, the answer is by using a numerical solver. You could take a look at SciPy's integrator. $\endgroup$
    – nicoguaro
    Jul 31 at 16:47
  • $\begingroup$ I am trying to solve this with odeint module. But the first equation is function of second equation. If i ignore dw/dz in first equation and second equation is function of first one. I can solve it simply using odeint. I can solve these equation through fsolve through forward differential. But is it possible i can use Odeint with fsolve? and solve first two equation simultaneously to find. $\endgroup$
    – sajid ali
    Jul 31 at 17:06
  • 2
    $\begingroup$ The way the equations are normally presented are with the derivative in the left hand side. Did you try solving for the 3 derivatives to rearrange your system? $\endgroup$
    – nicoguaro
    Aug 1 at 2:22
  • 2
    $\begingroup$ Must you use Odeint? A scan through the documentation seems to indicate it doesn't support implicitly-defined ODEs. A python wrapper for SUNDIALS IDA might work. $\endgroup$ Aug 1 at 15:24
5
$\begingroup$

I would simply replace $\dfrac{d\omega}{dz}$ in the first equation by its expression as given in the second equation, and then regroup on the left-hand side all the terms involving $\dfrac{dT_a}{dz}$.

Then, knowing the values of your overall state vector $X=(T_a,\omega,T_s)$, you have an explicit formulation of $\dfrac{dX}{dz}$.

If this manipulation is not possible by hand, then you may need to use implicit solvers that can handle such a case (see the comment by Steven Roberts for instance), but I don't know much about these.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.