Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

These are some constants:

b1b = 0.9;
b3b = .8;
a1b = 0.1;
a3b = 0.2;
eps = 0.1;
G = (1/eps^2)*b1b ; a1 = (1/eps^2)*a1b; a3 = (1/eps^2)*a3b;
xc = Sqrt[a1/a3];
Uc = a1*xc^2/2 - a3*xc^4/4

I have the following constraint for my system --> this was to find exit time:

const[x_, y_] := And[10^-8 <= y <= 10^-3, 0.9*(Uc) <= a1*x^2 - a3*x^4/4 <= 1.1*(Uc)]

Define the process (thanks to b.gatessucks):

x0 =    (* starting point for x[t] *)
y0 =    (* starting point for y[t] *)

proc = ItoProcess[
 {\[DifferentialD]x[t] == y[t] \[DifferentialD]t, 
  \[DifferentialD]y[t] == (-G*y[t] - (a1*x[t] + a3*x[t]^3) - eps*b3b*y[t]^3) \[DifferentialD]t + Sqrt[2*eps*G] \[DifferentialD]w[t]}, 
  {t, x[t], y[t], Boole[const[x[t], y[t]]]}, 
  {{x, y}, {x0, y0}}, {t, 0}, w \[Distributed] WienerProcess[]]

Find exit time (output as {t, x[t], y[t], Boole[const[x[t], y[t]]]} ):

sim = RandomFunction[proc, {0, 1, 0.001}];
First@Select[sim[[2, 1, 1]], #[[4]] == 0 &]

I need help on how to choose the initial conditions: (x0,y0) so that I can find exit times that are non-zero. I need to find about 100 of these for every eps. eps is varying.

Also, can someone kindly explain as to what:

sim = RandomFunction[proc, {0, 1, 0.001}];
First@Select[sim[[2, 1, 1]], #[[4]] == 0 &]

mean? Finally, the const[x_, y_] function need not be defined if there is some other way (algorithms) as to how I can find exit time for my dynamical system. If an answer is hard to come by then I would sincerely appreciate any leads or thoughts on this matter. Thanks!

share|improve this question
This appears to be a follow-up question to this one – Jacob Akkerboom Mar 3 '14 at 16:02
SeedRandom is used to let functions that depend on randomness to behave the same way each time. RandomFunction is the function you use to sample a process like ItoProcess. The code using Select is used to find when Boole[const[x[t], y[t]]] equals 0, which is when the constraint const does not hold. Is this problem still relevant to you? – Jacob Akkerboom Mar 3 '14 at 16:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.