Mathematica 微分方程初始条件问题Mathematica解微分方程时,加了初始条件出错!为什么?如:In[1]=DSolve[{y'[x]+y[x]==aSin[x],y[0]==0},y[x],x]DSolve::deqn:Equation or list of equations expected instead of True in the first argume

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 04:29:42

Mathematica 微分方程初始条件问题Mathematica解微分方程时,加了初始条件出错!为什么?如:In[1]=DSolve[{y'[x]+y[x]==aSin[x],y[0]==0},y[x],x]DSolve::deqn:Equation or list of equations expected instead of True in the first argume
Mathematica 微分方程初始条件问题
Mathematica解微分方程时,加了初始条件出错!为什么?
如:
In[1]=DSolve[{y'[x]+y[x]==aSin[x],y[0]==0},y[x],x]
DSolve::deqn:Equation or list of equations expected instead of True in the first argument {y[x]+y'[x]==aSin[x],True}.>>
Out[1]=DSolve[{y[x]+y'[x]==aSin[x],True},y[x],x]

Mathematica 微分方程初始条件问题Mathematica解微分方程时,加了初始条件出错!为什么?如:In[1]=DSolve[{y'[x]+y[x]==aSin[x],y[0]==0},y[x],x]DSolve::deqn:Equation or list of equations expected instead of True in the first argume
In[286]:= DSolve[{y'[x] + y[x] == a*Sin[x],y[0] == 0},y[x],x]
Out[286]= {{y[x] -> -(1/2) a E^-x (-1 + E^x Cos[x] - E^x Sin[x])}}
未发现问题;
In[287]:= y[0] = 0;
DSolve[{y'[x] + y[x] == a*Sin[x],y[0] == 0},y[x],x]
DSolve::deqn:Equation or list of equations expected instead of True in the first argument {y[x]+y'[x]==aSin[x],True}.>>
Out[288]=DSolve[{y[x]+y'[x]==aSin[x],True},y[x],x]
发现问题;
说明是你在写方程之前,已经在什么时候对y[0]赋过值了.
你可以改成下面的形式,即使以前对y赋过值,也不会出错了.
Remove[y];
DSolve[{y'[x] + y[x] == a*Sin[x],y[0] == 0},y[x],x]