Re: The use of Piecewise function

• To: mathgroup at smc.vnet.net
• Subject: [mg95240] Re: [mg95221] The use of Piecewise function
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Mon, 12 Jan 2009 06:23:43 -0500 (EST)

```M[x_] := Piecewise[{{Subscript[V, A] x, 0 <= x < b},
{Subscript[V, A] x - P (x - b), b <= x <= a + b}}];

soln = y[x] /. DSolve[{y''[x] == M[x], y[a + b] == 0,
y'[a + b] == 0}, y[x], x][[1]];

Y[x_] = FullSimplify[PiecewiseExpand[soln],
{a >= 0, b > 0, x >= 0}]

Piecewise[{{(1/6)*(Subscript[V, A]*(a + b - x)^2*(2*(a + b) + x) -
P*(a + b)*(2*a^2 + a*(b - 3*x) - b*(b - 3*x))), b > x},
{(1/6)*(a + b - x)^2*(Subscript[V, A]*(2*(a + b) + x) +
P*(-(2*a) + b - x)),
a + b >= x && b <= x}}, (1/6)*(a +
b)*(P*(-(2*a^2) - a*b + 3*a*x + b^2 - 3*b*x) +
(a + b)*Subscript[V, A]*(2*(a + b) - 3*x))]

Bob Hanlon

---- Miguel <misvrne at gmail.com> wrote:

=============
Hi all,
How can I to use the Piecewise function for symbolic calculations. For
example, let the equation of ellastic line of a beam

In[]: M[x_]:=Piecewise[{{Subscript[V, A]x,0<=x<b},{Subscript[V, A]x-P
(x-b),b<=x<=a+b}}];
DSolve[{y''[x]==M[x],y[a+b]==0,y'[a+b]==0},y[x],x];
Y[x_]=y[x]/.%[[1]]

Out[]:-\[Piecewise]1/12 a^2 (2 a+3 b) P	a+b>=0\[And]-a>0
1/4 (2 b (a+b)^2-1/3 b (3 a^2+6 b a+2 b^2)) P	-a<=0

+ etc, etc

I have proved with Assumptions, Assuming, but it does'nt work.

```

• Prev by Date: Re: Web question
• Next by Date: Re: printing symbols at as a table
• Previous by thread: Re: Is this so hard?
• Next by thread: Re: printing symbols at as a table