level 2
崎岖以寻壑
楼主
我要求解一维波动方程,一维杆左端(x=0)固定,右端(x=L)自由,初始时刻杆处于静力平衡状态,在右端(x=L)加载一个自己定义的荷载P(t)。我的代码如下
EE = 30000000000;
\[Rho] = 2600;
\[Mu] = 0.2;
a = Sqrt[EE/\[Rho]*(1 - \[Mu])/((1 - 2*\[Mu])*(1 + \[Mu]))];
\[Xi] = 1500;
Pmax = 500000000;
Pmid = 500000000/2;
t1 = 0.01/1000;
t2 = 0.1/1000;
t3 = 5/1000;
Pt = \!\(\*
TagBox[GridBox[{
{"\[Piecewise]", GridBox[{
{
RowBox[{
RowBox[{"Pmax", "/", "t1"}], "*", "t"}],
RowBox[{"0", "<=", "t", "<=", "t1"}]},
{
RowBox[{"Pmax", "-",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"Pmax", "-", "Pmid"}], ")"}], "/",
RowBox[{"(",
RowBox[{"t2", "-", "t1"}], ")"}]}], "*",
RowBox[{"(",
RowBox[{"t", "-", "t1"}], ")"}]}]}],
RowBox[{"t1", "<=", "t", "<=", "t2"}]},
{
RowBox[{"Pmid", "-",
RowBox[{
RowBox[{"Pmid", "/",
RowBox[{"(",
RowBox[{"t3", "-", "t2"}], ")"}]}], "*",
RowBox[{"(",
RowBox[{"t", "-", "t2"}], ")"}]}]}],
RowBox[{"t2", "<=", "t", "<=", "t3"}]},
{"0",
RowBox[{"t", ">=", "t3"}]}
},
AllowedDimensions->{2, Automatic},
Editable->True,
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.84]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}},
Selectable->True]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.35]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}}],
"Piecewise",
DeleteWithContents->True,
Editable->False,
SelectWithContents->True,
Selectable->False]\);
L = 10;
s1 = NDSolve[{D[u[x, t], t, t] -
a^2 D[u[x, t], x, x] + \[Xi]*D[u[x, t], t] == 0, u[0, t] == 0,
Derivative[0, 1][u][x, 0] == 0, u[x, 0] == 0,
EE*Derivative[1, 0][u][L, t] == Pt}, u, {x, 0, L}, {t, 0, 20/1000}]
然后得到了两个提示
1.Warning: boundary and initial conditions are inconsistent.
2.Encountered non-numerical value for a derivative at t == 0.`.
请大家帮忙看一下
2020年04月15日 07点04分
1
EE = 30000000000;
\[Rho] = 2600;
\[Mu] = 0.2;
a = Sqrt[EE/\[Rho]*(1 - \[Mu])/((1 - 2*\[Mu])*(1 + \[Mu]))];
\[Xi] = 1500;
Pmax = 500000000;
Pmid = 500000000/2;
t1 = 0.01/1000;
t2 = 0.1/1000;
t3 = 5/1000;
Pt = \!\(\*
TagBox[GridBox[{
{"\[Piecewise]", GridBox[{
{
RowBox[{
RowBox[{"Pmax", "/", "t1"}], "*", "t"}],
RowBox[{"0", "<=", "t", "<=", "t1"}]},
{
RowBox[{"Pmax", "-",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"Pmax", "-", "Pmid"}], ")"}], "/",
RowBox[{"(",
RowBox[{"t2", "-", "t1"}], ")"}]}], "*",
RowBox[{"(",
RowBox[{"t", "-", "t1"}], ")"}]}]}],
RowBox[{"t1", "<=", "t", "<=", "t2"}]},
{
RowBox[{"Pmid", "-",
RowBox[{
RowBox[{"Pmid", "/",
RowBox[{"(",
RowBox[{"t3", "-", "t2"}], ")"}]}], "*",
RowBox[{"(",
RowBox[{"t", "-", "t2"}], ")"}]}]}],
RowBox[{"t2", "<=", "t", "<=", "t3"}]},
{"0",
RowBox[{"t", ">=", "t3"}]}
},
AllowedDimensions->{2, Automatic},
Editable->True,
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.84]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}},
Selectable->True]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.35]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}}],
"Piecewise",
DeleteWithContents->True,
Editable->False,
SelectWithContents->True,
Selectable->False]\);
L = 10;
s1 = NDSolve[{D[u[x, t], t, t] -
a^2 D[u[x, t], x, x] + \[Xi]*D[u[x, t], t] == 0, u[0, t] == 0,
Derivative[0, 1][u][x, 0] == 0, u[x, 0] == 0,
EE*Derivative[1, 0][u][L, t] == Pt}, u, {x, 0, L}, {t, 0, 20/1000}]
然后得到了两个提示
1.Warning: boundary and initial conditions are inconsistent.
2.Encountered non-numerical value for a derivative at t == 0.`.
请大家帮忙看一下


