4

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.

sajid ali
  • 43
  • 3
  • 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. – nicoguaro Jul 31 '21 at 16:46
  • 1
    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. – nicoguaro Jul 31 '21 at 16:47
  • 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. – sajid ali Jul 31 '21 at 17:06
  • 2
    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? – nicoguaro Aug 01 '21 at 02:22
  • I assume this is an initial value problem since you are trying to use odeint? What are the initial conditions? – Bill Greene Aug 01 '21 at 10:48
  • 2
    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. – Steven Roberts Aug 01 '21 at 15:24

1 Answers1

5

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.

Laurent90
  • 1,808
  • 4
  • 9