I have the following set of equations:

$$ x(t) = x_0 \psi, \qquad y(t) = \kappa \ln \psi - x_0 \psi +1,\qquad z(t) =-\kappa\ln \psi,$$


$$ t- t_0 = \int ^\psi_{\psi_0} \frac{d\eta}{\eta(1+\kappa\ln \eta + x_0 \eta)}. $$ Here $t$ represents time. I would like to plot these equations in Python for the time range $t\in[0,1000]$. Of course, plotting $x,y$ or $z$ should no problem.

However I am struggling to generate this plot. I am not looking of anyone to actually do this for me, but can I get a pointer on how to approach this? In particular, how should I generate the required $\psi$ for this problem given $\psi_0, x_0$ and $\kappa$?


It is always easier to solve a differential equation rather than an integral equation.

You can easily differentiate your last equation w.r.t the time variable $t$, and set the initial condition $\psi(0) = \psi_0$ for the following differential equation: $$\frac{d\psi}{dt}=\psi(1+\kappa \ln{(\psi)}+x_0\psi).$$

Once you have the solution for the above, substitute it in your trajectories of $x, y$ and $z$

  • $\begingroup$ Why would anyone even write this set of equations in the convoluted form given in the original question? $\endgroup$ – Wolfgang Bangerth Sep 25 '17 at 17:22
  • 1
    $\begingroup$ Yes... It's a little bit weird... @WolfgangBangerth $\endgroup$ – HBR Sep 25 '17 at 18:13

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.