Mathematica does give a warning on this, telling me about this. But Maple
does not.
I was wondering if this behavior by Maple can be considered "OK" or should
the system point to the user this given that I am giving it 4 conditions,
and this is a 4th order ODE.
How does other CAS systems behave in such an example? axiom, sage, etc...
(btw, this is the Euler-Bernoulli beam equation, and I am trying to get the
boundary conditions right for a cantilever beam with load w distributed over
the half the length of the beam starting from the free end).
Also, notice, that when setting this unresolved coefficient to zero in the
final solution, this would end up giving the correct analytical solution !
> restart;
> ode :=e*i* diff(y(x),x$4) = w*Heaviside(L/2 - x):
> ics := y(L)=0, D(y)(L)=0,D(y)(L)=0,D(D(y))(0)=0:
> sol:=simplify(dsolve({ode,ics},y(x))):
<----- NO WARNING HERE
> sol:=collect(sol,_C1);
sol := y(x) = -1/384*(192*L^2*x*e*i-64*x^3*e*i-128*L^3*e*i)/e/i*_C1
-1/384*(-16*w*x^4+16*w*Heaviside(x-1/2*L)*x^4-72*w*L^4+
w*Heaviside(x-1/2*L)*L^4+112*w*L^3*x-8*w*L^3*Heaviside(x-1/2*L)*x
-24*w*L^2*x^2+24*w*L^2*Heaviside(x-1/2*L)*x^2-32*w*L*
Heaviside(x1/2*L)*x^3+31*w*Heaviside(L)*L^4
+24*w*L^2*x^2*Heaviside(L)-56*L^3*x*w*Heaviside(L))/e/i
Mathematica:
In[1]:= eq = e*i*Derivative[4][y][x] == (-w)*HeavisideTheta[L/2 - x];
sol = Simplify[First[DSolve[{eq, y[L] == 0, Derivative[2][y][0] == 0, y[L]
== 0,
Derivative[1][y][L] == 0}, y[x], x]]];
During evaluation of In[1]:= DSolve::bvsing:Unable to resolve some of the
arbitrary constants in the general solution using the given boundary
conditions. It is possible that some of the conditions have been specified
at a singular point for the equation. >>
y = y[x] /. sol;
y = Collect[y, C[4]]
Out[4]= ((768*e*i*L^3 - 1152*e*i*L^2*x + 384*e*i*x^3)*C[4])/(384*e*i)
+ (1/(384*e*i))*(-48*L^4*w + 64*L^3*w*x - 16*w*x^4
- 24*L^2*w*(L - x)^2* HeavisideTheta[-(L/2)]
+ L^3*w*(7*L - 8*x)*HeavisideTheta[L/2] + L^4*w*HeavisideTheta[-(L/2) + x]
- 8*L^3*w*x*HeavisideTheta[-(L/2) + x] + 24*L^2*w*x^2*HeavisideTheta[-(L/2)
+ x]
- 32*L*w*x^3*HeavisideTheta[-(L/2) + x] + 16*w*x^4*HeavisideTheta[-(L/2) +
x])
--Nasser
So what? Maple gives you a solution having an unresolved constant.
Isn't that warning enough?
>
> I was wondering if this behavior by Maple can be considered "OK" or should
> the system point to the user this given that I am giving it 4 conditions,
> and this is a 4th order ODE.
You are not giving it four conditions: see below.
>
> How does other CAS systems behave in such an example? axiom, sage, etc...
>
> (btw, this is the Euler-Bernoulli beam equation, and I am trying to get the
> boundary conditions right for a cantilever beam with load w distributed over
> the half the length of the beam starting from the free end).
>
> Also, notice, that when setting this unresolved coefficient to zero in the
> final solution, this would end up giving the correct analytical solution !
>
> > restart;
> > ode :=e*i* diff(y(x),x$4) = w*Heaviside(L/2 - x):
> > ics := y(L)=0, D(y)(L)=0,D(y)(L)=0,D(D(y))(0)=0:
You have D(y)(L)=0 written twice here, so you really have only three
initial conditions. Do you mean y(L)=0, D(y)(L)=0, D(D(y))(0)=0 and D(D
(D(y)))(L)=0? Using this form gives a solution having no arbitrary
constants.
R.G. Vickson
"You are not giving it four conditions: see below.
> > ics := y(L)=0, D(y)(L)=0,D(y)(L)=0,D(D(y))(0)=0:
You have D(y)(L)=0 written twice here, so you really have only three
initial conditions. Do you mean y(L)=0, D(y)(L)=0, D(D(y))(0)=0 and D(D
(D(y)))(L)=0? Using this form gives a solution having no arbitrary
constants."
Opps, Yes, you are right Ray, thanks for seeing this. But the duplicated one
should have been D(D(D(y)))(0)=0 (no shear, the beam is hinged at the right
side, the x=0 end is the free end)
I do now know how I did not see it. Now also Mathematica does not give the
warning message. But I did like that Mathematica gave me that warning, at
least it told me "something is not right here" even if the not right thing
was due to user error.
any way, no big deal....problem solved, I really have to watch my initial
conditions more carefully.
--Nasser