3
$\begingroup$

I have a problem for my work, I need to calculate this diff. equation I have,

r =\sqrt[ rinf + (ro - rinf)*E^((n*ϵ)/((1 - gm) (1 - rinf)) 
  (1 - z^(-3 (1 - gm))))*z^(-3 ((gm - gx)/(1 - rinf)))]

And

geff = (gm - gx - ϵ*n*z^(-3 (1 - gm)))*rinf/(1 - rinf) (2/(1 + r) - 1) + gx - n

And the diff. eq. is:

DSolve[{D[ρ[z], z] == -3/z ρ[z]*geff, ρ[1] == ρo}, ρ[z], z]

Mathematica can calculate without adding $gx-n$ to $geff$ ($gx -n$ are the last expressions in $geff$), but when I added $gx-n$ to $geff$ a problem happened and only gives me an integral result, Mathematica can not. Please, anybody?

$\endgroup$
0

1 Answer 1

4
$\begingroup$

It is surprising that DSolve cannot solve the ODE, because

int = Integrate[-3/z *geff, z]
(* -(1/(1 + rinf)) rinf (-((n z^(-3 + 3 gm) ϵ)/(-1 + gm)) + 
   3 (gm - gx) Log[z] + 2 Log[1 + rinf + E^((n (z^3 - z^(3 gm)) ϵ)/((-1 + gm) 
(-1 + rinf) z^3)) (-rinf + ro) z^((3 (gm - gx))/(-1 + rinf))]) *)

can be performed, and the solution of the ODE then is simply

s = ρo Exp[int]/Exp[int /. z -> 1]

which can be verified by

Simplify[{D[ρ[z], z] == -3/z ρ[z]*geff, ρ[1] == ρo} /. 
    ρ -> Function[z, Evaluate@s]]
(* {True, True} *)
$\endgroup$
6
  • 1
    $\begingroup$ Much more suprising: MMA can solve the generalized problem DSolve[{ \[Rho]'[z]/\[Rho][z] == f'[z] }, \[Rho][z], z] (*{{\[Rho][z] -> E^f[z] C[1]}}*) $\endgroup$ Commented Sep 12, 2018 at 15:24
  • $\begingroup$ Thank you so much @bbgodfrey ... But I apologize because I forgot to put the square root of " r " in the first equation. The correct expression is " r=\sqrt{.....} ". I'm so sorry, can you help me? $\endgroup$
    – will.al
    Commented Sep 14, 2018 at 2:02
  • $\begingroup$ @will.al I do not believe that ` r=\sqrt{.....}` is syntactically correct. Do you mean Sqrt[…..]? In any case, I shall see what I can do. $\endgroup$
    – bbgodfrey
    Commented Sep 14, 2018 at 2:09
  • $\begingroup$ Hi @bbgodfrey... It is correct, is Sqrt[...]. Thank you. $\endgroup$
    – will.al
    Commented Sep 14, 2018 at 2:12
  • $\begingroup$ @will.al I am not optimistic that -3/z *geff can be integrated in general. Do the parameters have any special values, for instance are some of them integers? $\endgroup$
    – bbgodfrey
    Commented Sep 14, 2018 at 2:36

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.