4
$\begingroup$

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,$$

with

$$ 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$?

$\endgroup$

1 Answer 1

6
$\begingroup$

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$

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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