Skip to main content
added 268 characters in body
Source Link

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-t^2}$$$$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-(t-t_0)^2}- e^{-(t_0)^2}\\ E_p(0,z)=0 $$

Any ideas?

EDIT: I modified the boundary conditions for $E_p$ as suggested in the comments. (Previously I only had E_p(t,0)=e^{-(t-t_0)^2}, and now I have added an initial condition and modified the previous B.c. to make it consistent.).

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-t^2}$$

Any ideas?

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-(t-t_0)^2}- e^{-(t_0)^2}\\ E_p(0,z)=0 $$

Any ideas?

EDIT: I modified the boundary conditions for $E_p$ as suggested in the comments. (Previously I only had E_p(t,0)=e^{-(t-t_0)^2}, and now I have added an initial condition and modified the previous B.c. to make it consistent.).

deleted 1391 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ \text{Ep}(t,0)=e^{-t^2}$$$$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-t^2}$$

NDSolve[{
\!\(\*SuperscriptBox[\(p11\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p11][t, 
    z] == -(1/2) I Ep[t, z] (p13[t, z] - p31[t, z]), 
\!\(\*SuperscriptBox[\(p12\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p12][t, z] == 
      1/2 I (-10 p13[t, z] + Ep[t, z] p32[t, z]), 
\!\(\*SuperscriptBox[\(p13\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p13][t, z] == -(1/2) p13[t, z] - 
        1/2 I (10 p12[t, z] + Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p21\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p21][t, z] == -(1/2) p21[t, z] - 
        1/2 I (Ep[t, z] p23[t, z] - 10 p31[t, z]), 
\!\(\*SuperscriptBox[\(p22\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p22][t, z] == -5 I (p23[t, z] - p32[t, z]), 
\!\(\*SuperscriptBox[\(p23\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p23][t, 
    z] == -(1/2)
          I (Ep[t, z] p21[t, z] + 10 p22[t, z] - I p23[t, z] - 
            10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p31\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p31][t, z] == 
      1/2 I (10 p21[t, z] + I p31[t, z] + 
            Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p32\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p32][t, z] == 
      1/2 I (Ep[t, z] p12[t, z] + 10 p22[t, z] + I p32[t, z] - 
            10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p33\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][p33][t, z] == 
      1/2 I (10 p23[t, z] + Ep[t, z] (p13[t, z] - p31[t, z]) - 
            10 p32[t, z] + 2 I p33[t, z]), 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}]Derivative[0, ")"}],
Derivative],
MultilineFunction->None]\)[t1][Ep][t, z] + 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}]Derivative[1, ")"}],
Derivative],
MultilineFunction->None]\)[t0][Ep][t, z] == 1/2 I p12[t, z], p11[0, z] == 1, 
    p12[0, z] == 0, p13[0, z] == 0, p21[0, z] == 0, p22[0, z] == 0, 
    p23[0, z] == 0, p31[0, z] == 0, p32[0, z] == 0, p33[0, z] == 0, 
    Ep[t, 0] == E^-t^2}, {\[Rho]11[tρ11[t, z], \[Rho]12[tρ12[t, z], \[Rho]13[tρ13[t, 
      z], \[Rho]21[tρ21[t, z], \[Rho]22[tρ22[t, z], \[Rho]23[tρ23[t, z], \[Rho]31[tρ31[t, 
      z], \[Rho]32[tρ32[t, z], \[Rho]33[tρ33[t, z], Ep[t, z]}, {z, 0, 1}, {t, 0, 
    1}]

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ \text{Ep}(t,0)=e^{-t^2}$$

NDSolve[{
\!\(\*SuperscriptBox[\(p11\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, 
    z] == -(1/2) I Ep[t, z] (p13[t, z] - p31[t, z]), 
\!\(\*SuperscriptBox[\(p12\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (-10 p13[t, z] + Ep[t, z] p32[t, z]), 
\!\(\*SuperscriptBox[\(p13\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -(1/2) p13[t, z] - 
    1/2 I (10 p12[t, z] + Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p21\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -(1/2) p21[t, z] - 
    1/2 I (Ep[t, z] p23[t, z] - 10 p31[t, z]), 
\!\(\*SuperscriptBox[\(p22\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -5 I (p23[t, z] - p32[t, z]), 
\!\(\*SuperscriptBox[\(p23\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, 
    z] == -(1/2)
      I (Ep[t, z] p21[t, z] + 10 p22[t, z] - I p23[t, z] - 
      10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p31\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (10 p21[t, z] + I p31[t, z] + 
      Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p32\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (Ep[t, z] p12[t, z] + 10 p22[t, z] + I p32[t, z] - 
      10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p33\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (10 p23[t, z] + Ep[t, z] (p13[t, z] - p31[t, z]) - 
      10 p32[t, z] + 2 I p33[t, z]), 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] + 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 1/2 I p12[t, z], p11[0, z] == 1, 
  p12[0, z] == 0, p13[0, z] == 0, p21[0, z] == 0, p22[0, z] == 0, 
  p23[0, z] == 0, p31[0, z] == 0, p32[0, z] == 0, p33[0, z] == 0, 
  Ep[t, 0] == E^-t^2}, {\[Rho]11[t, z], \[Rho]12[t, z], \[Rho]13[t, 
   z], \[Rho]21[t, z], \[Rho]22[t, z], \[Rho]23[t, z], \[Rho]31[t, 
   z], \[Rho]32[t, z], \[Rho]33[t, z], Ep[t, z]}, {z, 0, 1}, {t, 0, 
  1}]

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ E_p(t,0)=e^{-t^2}$$

NDSolve[{
  Derivative[1, 0][p11][t, z] == -(1/2) I Ep[t, z] (p13[t, z] - p31[t, z]), 
  Derivative[1, 0][p12][t, z] == 
      1/2 I (-10 p13[t, z] + Ep[t, z] p32[t, z]), 
  Derivative[1, 0][p13][t, z] == -(1/2) p13[t, z] - 
        1/2 I (10 p12[t, z] + Ep[t, z] (p11[t, z] - p33[t, z])), 
  Derivative[1, 0][p21][t, z] == -(1/2) p21[t, z] - 
        1/2 I (Ep[t, z] p23[t, z] - 10 p31[t, z]), 
  Derivative[1, 0][p22][t, z] == -5 I (p23[t, z] - p32[t, z]), 
  Derivative[1, 0][p23][t, z] == -(1/2)
          I (Ep[t, z] p21[t, z] + 10 p22[t, z] - I p23[t, z] - 
            10 p33[t, z]), 
  Derivative[1, 0][p31][t, z] == 
      1/2 I (10 p21[t, z] + I p31[t, z] + 
            Ep[t, z] (p11[t, z] - p33[t, z])), 
  Derivative[1, 0][p32][t, z] == 
      1/2 I (Ep[t, z] p12[t, z] + 10 p22[t, z] + I p32[t, z] - 
            10 p33[t, z]), 
  Derivative[1, 0][p33][t, z] == 
      1/2 I (10 p23[t, z] + Ep[t, z] (p13[t, z] - p31[t, z]) - 
            10 p32[t, z] + 2 I p33[t, z]), 
  Derivative[0, 1][Ep][t, z] + 
    Derivative[1, 0][Ep][t, z] == 1/2 I p12[t, z], p11[0, z] == 1, 
    p12[0, z] == 0, p13[0, z] == 0, p21[0, z] == 0, p22[0, z] == 0, 
    p23[0, z] == 0, p31[0, z] == 0, p32[0, z] == 0, p33[0, z] == 0, 
    Ep[t, 0] == E^-t^2}, {ρ11[t, z], ρ12[t, z], ρ13[t, 
      z], ρ21[t, z], ρ22[t, z], ρ23[t, z], ρ31[t, 
      z], ρ32[t, z], ρ33[t, z], Ep[t, z]}, {z, 0, 1}, {t, 0, 
    1}]
Source Link

System of nonlinearly coupled PDEs

Similar to the question I asked on the Math Stackexchange (in this question), I am interested in solving a nonlinearly coupled system of PDEs.

The system of PDEs look like this: $$\begin{align*}\partial_t p_{11} &= E_p p_{13} - E_p p_{31} \\ \partial_t p_{12} &= E_p p_{13} - E_p p_{32} - p_{12} (\Delta_{31}-\Delta_{32}) \\ \partial_t p_{13} &= E_p p_{11} + E_c p_{12} - E_p p_{33} + p_{13} \Delta_{31} \\ \partial_t p_{21} &= E_p p_{23} - E_c p_{31} + p_{21}(-\Delta_{31} + \Delta_{32}) \\ \partial_t p_{22} &= E_c p_{23} - E_c p_{32} \\ \partial_t p_{23} &= E_p p_{21} + E_c p_{22} - E_c p_{33} + p_{23} \Delta_{31} + p_{23} (-\Delta_{31} + \Delta_{32}) \\ \partial_t p_{31} &= - E_p p_{11} - E_c p_{21} + E_p p_{33} - p_{31} \Delta_{31} \\ \partial_t p_{32} &= - E_p p_{21} - E_c p_{22} - E_c p_{33} + p_{23} \Delta_{31} + p_{23} (-\Delta_{31} + \Delta_{32}) \\ \partial_t p_{33} &= E_p p_{13} - E_c p_{23} + E_p p_{31} + E_c p_{32} \end{align*}$$

$$ \frac{\partial E_p}{\partial z } + \frac{1}{c} \frac{\partial E_p}{\partial t } = i k p_{13}(t, z) $$

Each of these p's ($p_{11}, p_{12}, ..., p_{33}$) are a function of t and z. Additionally $E_p$ is a function of t and z. And $\Delta_{31, 32, 33}$ are just numerical constants.

I'm trying with the boundary conditions: $$\text{p11}(0,z)=1,\\ \text{p12}(0,z)=\text{p13}(0,z)=\text{p21}(0,z)= \text{p22}(0,z)=\text{p23}(0,z)=\text{p31}(0,z)= \text{p32}(0,z)= \text{p33}(0,z)=0,\\ \text{Ep}(t,0)=e^{-t^2}$$

Is there a way that I can solve this numerically in Mathematica?

When I try the following code:

NDSolve[{
\!\(\*SuperscriptBox[\(p11\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, 
    z] == -(1/2) I Ep[t, z] (p13[t, z] - p31[t, z]), 
\!\(\*SuperscriptBox[\(p12\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (-10 p13[t, z] + Ep[t, z] p32[t, z]), 
\!\(\*SuperscriptBox[\(p13\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -(1/2) p13[t, z] - 
    1/2 I (10 p12[t, z] + Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p21\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -(1/2) p21[t, z] - 
    1/2 I (Ep[t, z] p23[t, z] - 10 p31[t, z]), 
\!\(\*SuperscriptBox[\(p22\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == -5 I (p23[t, z] - p32[t, z]), 
\!\(\*SuperscriptBox[\(p23\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, 
    z] == -(1/2)
      I (Ep[t, z] p21[t, z] + 10 p22[t, z] - I p23[t, z] - 
      10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p31\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (10 p21[t, z] + I p31[t, z] + 
      Ep[t, z] (p11[t, z] - p33[t, z])), 
\!\(\*SuperscriptBox[\(p32\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (Ep[t, z] p12[t, z] + 10 p22[t, z] + I p32[t, z] - 
      10 p33[t, z]), 
\!\(\*SuperscriptBox[\(p33\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 
   1/2 I (10 p23[t, z] + Ep[t, z] (p13[t, z] - p31[t, z]) - 
      10 p32[t, z] + 2 I p33[t, z]), 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] + 
\!\(\*SuperscriptBox[\(Ep\), 
TagBox[
RowBox[{"(", 
RowBox[{"1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, z] == 1/2 I p12[t, z], p11[0, z] == 1, 
  p12[0, z] == 0, p13[0, z] == 0, p21[0, z] == 0, p22[0, z] == 0, 
  p23[0, z] == 0, p31[0, z] == 0, p32[0, z] == 0, p33[0, z] == 0, 
  Ep[t, 0] == E^-t^2}, {\[Rho]11[t, z], \[Rho]12[t, z], \[Rho]13[t, 
   z], \[Rho]21[t, z], \[Rho]22[t, z], \[Rho]23[t, z], \[Rho]31[t, 
   z], \[Rho]32[t, z], \[Rho]33[t, z], Ep[t, z]}, {z, 0, 1}, {t, 0, 
  1}]

Which looks like this: enter image description here

Mathematica returns the error message: NDSolve::femnonlinear: Nonlinear coefficients are not supported in this version of NDSolve.

Any ideas?