0
$\begingroup$

The equation is $p'(t)=k_1s_0{e}^{-k_1t}-k_2p(t)$

The solution with Mathematica

DSolve[p'[t] == k1*s0*E^(-k1*t) - k2*p[t], p[t], t]

$p(t) = -(k_1/(k_1-k_2)) s_0 (e^{-k_1t}) + p(0) e^{-k_2t}$

but when I applied Laplace transform the result is

$p(t) = (k_1/(k_1-k_2)) s_0 (e^{-k_1t}–e ^{-k_2t}) + p(0) e^{-k_2t}$

I followed this Laplace transform mentioned in the appendix from this paper: enter link description here

I am wondering where is the mistake.

Thanks a lot!

$\endgroup$
  • 1
    $\begingroup$ Please, always post the code that produced the results (please, in copyable form). Otherwise, we cannot tell what went wrong. $\endgroup$ – Henrik Schumacher Jul 25 at 17:52
  • $\begingroup$ The code from Mathematica is DSolve[p'[t] == k1*s0*E^(-k1*t) - k2*p[t], p[t], t] I am wondering could that solution be wrong? $\endgroup$ – Ксения Цочева Jul 25 at 17:54
  • $\begingroup$ Please post the original code in correct markdown (not in $\LaTeX$!) and put that into your original post. Moreover, the code for the result from the Laplace transform is still missing. $\endgroup$ – Henrik Schumacher Jul 25 at 17:58
2
$\begingroup$

Possible typo/initial value not given in DSolve? (note the $c_1$ returned by DSolve may not necessarily be p[0]). The two agree for me:

eqn = p'[t] == k1*s0*E^(-k1*t) - k2*p[t]
dsol = DSolve[{eqn, p[0] == p0}, p[t], t]
leqn = ApplySides[LaplaceTransform[#, t, s] &, eqn]
lsol = Solve[leqn, LaplaceTransform[p[t], t, s]]
ilsol = InverseLaplaceTransform[
   LaplaceTransform[p[t], t, s] /. lsol[[1]], s, t] // FullSimplify
s1 = p[t] /. {dsol[[1, 1]]} /. {p0 -> p[0]}
s1 == ilsol // FullSimplify

Returns True

$\endgroup$
  • 1
    $\begingroup$ I expected something the like. Good job! (+1) $\endgroup$ – Henrik Schumacher Jul 25 at 18:37
  • $\begingroup$ So @egwene sedai do you mean that the second solution is correct? And why simple DSolve doesn't solve the equation? Thanks. $\endgroup$ – Ксения Цочева Jul 25 at 18:50
  • $\begingroup$ @Ксения Цочева Your call of DSolve did solve the ODE, but the general one with one integration constant that does not coincide with $p(0)$. Note that the ODE has infinitely many solutions when you do not specify its initial condition. $\endgroup$ – Henrik Schumacher Jul 25 at 18:55
  • $\begingroup$ Thanks a lot! I understood the problem. $\endgroup$ – Ксения Цочева Jul 25 at 19:02

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.