I am trying to solve the following system of differential equations for survival functions

$\frac{d}{dx} S_{crude}^{(1)}(x) = C_1(S_{net}^{(1)}(x), S_{net}^{(2)}(x)) \times \frac{d}{dx} S_{net}^{(1)}(x)$ $\frac{d}{dx} S_{crude}^{(2)}(x) = C_2(S_{net}^{(1)}(x), S_{net}^{(2)}(x)) \times \frac{d}{dx} S_{net}^{(2)}(x)$

$C_i(u_1, \ldots, u_n)=\frac{\partial}{\partial u_i} C(u_1, \ldots, u_n)$.

Where $S_{crude}^{(1)}(x)$ and $S_{crude}^{(1)}(x)$ are known differentiable functions, $S_{net}^{(1)}(x)$ and $S_{net}^{(1)}(x)$ are the unknown functions and $C$ is the assumed copula function (e.g. Clayton copula). The system is solved under the initial conditions $S_{net}^{(1)}(0)=S_{net}^{(2)}(0)=1$.

I am executing the following commands to solve the system

Scrude1[x_] := 0.20395 + 0.011 x - 0.00153 x^2 + 0.00003 x^3
Scrude2[x_] := 0.79605 + 0.0936 x - 0.00215 x^2

tau = 0.35 (*Kendall's tau*)

a = 2 tau/(1 - tau)

Cc[a_] = CopulaDistribution[{"Clayton", 
    a}, {UniformDistribution[{0, 1}], UniformDistribution[{0, 1}]}];

NDSolve[{Scrude1'[x] == 
   D[CDF[Cc[a], {Snet1[x], Snet2[x]}], Snet1[x]]*Snet1'[x], 
  Scrude2'[x] == 
   D[CDF[Cc[a], {Snet1[x], Snet2[x]}], Snet2[x]]*Snet2'[x], 
  Snet1[0] == 1, Snet2[0] == 1}, {Snet1, Snet2}, {x, 0, 120}]

Then I get the error messages

Power::infy: Infinite expression 1/0 encountered.
NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 0.`.

Actually I get the same errors when trying to some use other copula functions, e.g. Gaussian or Gumbel. Thank you for your help.

  • $\begingroup$ you should declare the function Cc[a_]= as Cc[a_]:=, which is the way to declare functions in Mathematica. $\endgroup$ – Tugrul Temel Dec 9 '19 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.