Message Boards Message Boards

How to solve this differential equation groups

Posted 9 years ago

enter image description here enter image description here enter image description here

and when I calculate the second equation group, the error appear? How can I solve this problem?

(*Population equations*)
Clear["Global`*"];
\[Epsilon] = 10;                (* \[Epsilon] *)
\[Gamma]10 = 1;             (* \[Gamma]10 *)
a = 0.108;       (* a *)
pump[t_, \[Epsilon]_, a_] := \[Epsilon]*\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(100\)]
\*SuperscriptBox[\(E\), \(-\((Abs[t - 12.5  i]/a)\)^2\)]\);
\[CapitalDelta] = 0; NDSolve[{r11'[
    t] == -(1/2) I*
     pump[t, \[Epsilon], a]*(r01[t] - r10[t]) - \[Gamma]10*r11[t], 
  r00'[t] == 
   1/2 I*pump[t, \[Epsilon], a]*(r01[t] - r10[t]) + \[Gamma]10*r11[t],
   r10'[t] == -I*\[CapitalDelta]*r10[t] - 
    1/2 I*pump[t, \[Epsilon], a]*r00[t] + 
    1/2 I*pump[t, \[Epsilon], a]*r11[t] - 1/2 \[Gamma]10*r10[t],
  r01'[t] == 
   I*\[CapitalDelta]*r10[t] + 1/2 I*pump[t, \[Epsilon], a]*r00[t] - 
    1/2 I*pump[t, \[Epsilon], a]*r11[t] - 1/2 \[Gamma]10*r10[t], 
  r00 [0] == 1, r11 [0] == 0, r10 [0] == 0, r01 [0] == 0}, {r11, r00, 
  r10, r01}, {t, 0, 500}];
r11 = r11 /. %[[1]];
\[Rho]11[t_] := Re[(r11[t])];
Plot[\[Rho]11[t], {t, 0, 45}, PlotRange -> {0, 1}]
(*Second-correlation equations*)
NDSolveValue[{\!\(
\*SubscriptBox[\(\[PartialD]\), \(\[Tau]\)]\(x11[t, \[Tau]]\)\) == 
   1/2 I*pump[
      t + \[Tau], \[Alpha], \[Eta]]*(x01[t, \[Tau]] - 
       x10[t, \[Tau]]) - \[Gamma]10*x11[t, \[Tau]], \!\(
\*SubscriptBox[\(\[PartialD]\), \(\[Tau]\)]\(x00[
     t, \[Tau]]\)\) == -(1/2) I*
     pump[t + \[Tau], \[Alpha], \[Eta]]*(x01[t, \[Tau]] - 
       x10[t, \[Tau]]) + \[Gamma]10*x11[t, \[Tau]], \!\(
\*SubscriptBox[\(\[PartialD]\), \(\[Tau]\)]\(x10[t, \[Tau]]\)\) == 
   I*\[CapitalDelta]*x10[t, \[Tau]] + 
    1/2 I*pump[t + \[Tau], \[Alpha], \[Eta]]*x00[t, \[Tau]] - 
    1/2 I*pump[t + \[Tau], \[Alpha], \[Eta]]*x11[t, \[Tau]] - 
    1/2 \[Gamma]10*x10[t, \[Tau]],
  \!\(
\*SubscriptBox[\(\[PartialD]\), \(\[Tau]\)]\(x01[
     t, \[Tau]]\)\) == -I*\[CapitalDelta]*x10[t, \[Tau]] - 
    1/2 I*pump[t + \[Tau], \[Alpha], \[Eta]]*x00[t, \[Tau]] + 
    1/2 I*pump[t + \[Tau], \[Alpha], \[Eta]]*x11[t, \[Tau]] - 
    1/2 \[Gamma]10*x10[t, \[Tau]], x00 [t, 0] == \[Rho]11[t], 
  x11 [t, 0] == 0, x10 [t, 0] == 0, x01 [t, 0] == 0}, {x11, x00, x10, 
  x01}, {t, 0, 500}, {\[Tau], -30, 30}]
G[\[Tau]_] := NIntegrate[x00[t, \[Tau]], {t, 0, 450}]
Plot[G[\[Tau]], {\[Tau], -20, 20}, PlotRange -> All]
Attachments:
POSTED BY: YU SHANG
5 Replies
Posted 9 years ago

I save your calculated x11,x00,x10,x01 interpolating functions in y11,y00,y10,y01 by doing this

(*Second-correlation equations*)
...
{y11, y00, y10, y01} = NDSolveValue[...];

And then I am able to plot your function by doing this

Plot[NIntegrate[y11[t, \[Tau]], {t, 0, 450}], {\[Tau], 0, 20}, PlotRange->All]

and get the value at a point t,tau by doing this

In[15]:= y11[13, 5]

Out[15]= 0.000462099 + 0. I
POSTED BY: Bill Simpson
Posted 9 years ago

Thank you very much !

POSTED BY: YU SHANG
Posted 9 years ago

Before your second NDSolve you have not assigned constant numeric values to \[Eta] or \[Alpha].

Unfortunately Mathematica does not instantly put up a message explaining exactly that, which would immediately lead you to what you need to fix, and instead puts up a message about some derivative being zero at some value of \[Tau].

If you insert

 \[Eta] = 11;\[Alpha] = 13;

or something similar prior to your second NDSolve then it appears that your error messages go away.

POSTED BY: Bill Simpson
Posted 9 years ago

Thank you very much Mr. Simpson. I modify my program and the second NDSolve seems worked! However, there still some problems. After the NDSolve, I can't get the number about x11[t,tau], and when I do NIntegrate for x11[t,tau], error appear again, says: NIntegrate::inumr: "The integrand x11[t,0.000408571] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,450}}." and con not put the picture at last.

I am quite hope could get you help, thanks again.

Attachments:
POSTED BY: YU SHANG
Posted 9 years ago

and how to do such a partial integration here

POSTED BY: YU SHANG
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract