\[CapitalOmega] = ImplicitRegion[True, {{z, 0, 200}}];
\[CapitalGamma]1 = NeumannValue[0 , z == 0 || z == 200];
TraditionalForm[\[CapitalGamma]1]
{nO, pO} = NDSolveValue[
{
D[n[t, z], t] ==
D[n[t, z], {z, 2}]
+ \[Tau]/
nb \[Alpha] (1 -
R) Pdensity/(Sqrt[2 \[Pi] ] \[Tau]L hv ) gauss[t,
0, \[Tau]L/\[Tau]] Exp[-\[Alpha] Ldi z]
+ Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (0 + eF0O[z]) D[
n[t, z] , z] +
Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (p0[z] - n0[z] + 1 -
E^(-2 u) + p[t, z] - n[t, z]) n[t, z] + \[CapitalGamma]1,
D[p[t, z], t] ==
0.1 D[p[t, z], {z, 2}]
+ \[Tau]/
nb \[Alpha] (1 -
R) Pdensity/(Sqrt[2 \[Pi] ] \[Tau]L hv ) gauss[t,
0, \[Tau]L/\[Tau]] Exp[-\[Alpha] Ldi z]
- 0.1 Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (0 +
eF0O[z]) D[p[t, z] , z] -
0.1 Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (p0[z] -
n0[z] + 1 - E^(-2 u) + p[t, z] - n[t, z]) p[t,
z] + \[CapitalGamma]1,
n[-10 \[Tau]L/\[Tau], z] == 0,
p[-10 \[Tau]L/\[Tau], z] == 0},
{n, p},
{t, -10 \[Tau]L/\[Tau], 5},
{z} \[Element] \[CapitalOmega],
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {MaxCellMeasure -> 0.1}}}}]
Manipulate[
Plot[QuantityMagnitude[nb, "Centimeters^-3"] nO[t0/n\[Tau],
z0/nLdi], {z0, 0, 200 nLdi}, PlotRange -> All], {t0, -10 n\[Tau]L,
5 n\[Tau]}]
以上是源代码,我想求解的方程包含两个偏微分方程的耦合, 分别是n[t,z]和p[t,z],想要分别设置诺伊曼边界条件
dn/dx==0,x==0||x==200,dp/dx==0,x==0||x==200,请问格式要怎么写?我按照图中的写法,运算一直卡住算不出来。
另外如果希望设置参数是随时间变化的话要怎么写?比如把eF0[z]从一个已知的函数换成一个由n[t,z]和p[t,z]决定的函数,比如eF[t,z]满足
d eF[t,z]/dz=p[t,z]-n[t,z]
eF[t,0]==0
我试过直接把这些加紧NDSolve函数里面,但是会是别成三个偏微分方程。
\[CapitalGamma]1 = NeumannValue[0 , z == 0 || z == 200];
TraditionalForm[\[CapitalGamma]1]
{nO, pO} = NDSolveValue[
{
D[n[t, z], t] ==
D[n[t, z], {z, 2}]
+ \[Tau]/
nb \[Alpha] (1 -
R) Pdensity/(Sqrt[2 \[Pi] ] \[Tau]L hv ) gauss[t,
0, \[Tau]L/\[Tau]] Exp[-\[Alpha] Ldi z]
+ Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (0 + eF0O[z]) D[
n[t, z] , z] +
Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (p0[z] - n0[z] + 1 -
E^(-2 u) + p[t, z] - n[t, z]) n[t, z] + \[CapitalGamma]1,
D[p[t, z], t] ==
0.1 D[p[t, z], {z, 2}]
+ \[Tau]/
nb \[Alpha] (1 -
R) Pdensity/(Sqrt[2 \[Pi] ] \[Tau]L hv ) gauss[t,
0, \[Tau]L/\[Tau]] Exp[-\[Alpha] Ldi z]
- 0.1 Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (0 +
eF0O[z]) D[p[t, z] , z] -
0.1 Ldi e^2 nb Ldi/(k T \[Epsilon] \[Epsilon]b) (p0[z] -
n0[z] + 1 - E^(-2 u) + p[t, z] - n[t, z]) p[t,
z] + \[CapitalGamma]1,
n[-10 \[Tau]L/\[Tau], z] == 0,
p[-10 \[Tau]L/\[Tau], z] == 0},
{n, p},
{t, -10 \[Tau]L/\[Tau], 5},
{z} \[Element] \[CapitalOmega],
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {MaxCellMeasure -> 0.1}}}}]
Manipulate[
Plot[QuantityMagnitude[nb, "Centimeters^-3"] nO[t0/n\[Tau],
z0/nLdi], {z0, 0, 200 nLdi}, PlotRange -> All], {t0, -10 n\[Tau]L,
5 n\[Tau]}]
以上是源代码,我想求解的方程包含两个偏微分方程的耦合, 分别是n[t,z]和p[t,z],想要分别设置诺伊曼边界条件
dn/dx==0,x==0||x==200,dp/dx==0,x==0||x==200,请问格式要怎么写?我按照图中的写法,运算一直卡住算不出来。
另外如果希望设置参数是随时间变化的话要怎么写?比如把eF0[z]从一个已知的函数换成一个由n[t,z]和p[t,z]决定的函数,比如eF[t,z]满足
d eF[t,z]/dz=p[t,z]-n[t,z]
eF[t,0]==0
我试过直接把这些加紧NDSolve函数里面,但是会是别成三个偏微分方程。