Message Boards Message Boards

0
|
8522 Views
|
6 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Having problems with integration

Posted 10 years ago

Using the Double Integration Method to determine the deflection in a beam.

What am I doing wrong when I integrate the below equation

y[x_] := 168 (-8 + x) + 10 (-8 + x)^2 - 4 (-6 + x) + 5 (-4 + x)^2 + 96 x - 15 x^2

This is the result I got in Mathematica

enter image description here

Okay, I change the function name, (I don't know why y[x_] doesn't work)

a[x_] := 168 (-8 + x) + 10 (-8 + x)^2 - 4 (-6 + x) + 5 (-4 + x)^2 + 96 x - 15 x^2

enter image description here

Clearly, if I am integrating I should have an x^3 term, but none, what am I doing wrong here????

POSTED BY: Raymond Low
6 Replies

It might help to use PiecewiseExpand here. Integrate will have an easier time dealing with explicit Piecewise objects than with various other formulations thereof.

ycc[x_] = 
 PiecewiseExpand[
  3 Max[0, (-9 + x)]^3 + 1/4 Max[0, (-9 + x)]^4 + 
   7/2 Max[0, (-3 + x)]^3 - 1/4 Max[0, (-3 + x)]^4 - 12 x^2 + c1 x + 
   c2]

(* Out[86]= Piecewise[{{c2 + c1*x - 12*x^2, x <= 3}, 
     {(1/2)*(-1323 + 2*c2 + 243*x + 2*c1*x - 33*x^2 + x^3), x > 9}}, 
   (1/4)*(-459 + 4*c2 + 486*x + 4*c1*x - 228*x^2 + 26*x^3 - x^4)] *)

Integrate[ycc[x], x, x]

(* Out[87]= Piecewise[{{(1/2)*(c2*x^2 + (c1*x^3)/3 - 2*x^4), x <= 3}, 
     {(9/2)*(-18 + c1 + c2) - (9/10)*(-36 + 5*c1 + 5*c2) + 
         (1/40)*(3321*x + 
       5*(-459 + 4*c2)*x^2 + (10/3)*(243 + 2*c1)*x^3 - 
              190*x^4 + 13*x^5 - x^6/3), 
   Inequality[3, Less, x, LessEqual, 9]}}, 
   (81/2)*(-138 + 3*c1 + c2) - (81/40)*(-549 + 60*c1 + 20*c2) + 
     (1/40)*(82053*x + 
     10*(-1323 + 2*c2)*x^2 + (10/3)*(243 + 2*c1)*x^3 - 
          55*x^4 + x^5)] *)

I was not able to figure out what it was about the solving for the constants that you did not like. In particular that NSolve formulation looked fine. If it is giving something incorrect then there needs to be a better explanation of why, and of what is the desired result.

POSTED BY: Daniel Lichtblau
Posted 10 years ago

unfortunately I spent an hour explaining my problem but lost all this work because the forum became unavailable. so now of the much shorten explanation. my problem is I have a beam with a couple, two loads, two supports and has the following moment equation:

c2 + 3 (-9 + x)^3 + 1/4 (-9 + x)^4 + 7/2 (-3 + x)^3 - 1/4 (-3 + x)^4 + c1 x - 12 x^2

to solve for c1 and c2 requires that I use 'singular functions' that is, the term drops out if it evaluates less than zero. In mathematica it looks like this

ycc[x_] := 3 Max[0, (-9 + x)]^3 + 1/4 Max[0, (-9 + x)]^4 + 7/2 Max[0, (-3 + x)]^3 - 1/4 Max[0, (-3 + x)]^4 - 12 x^2 + c1 x + c2

NSolve[{0 == ycc[x] /. x -> 3, 0 == ycc[x] /. x -> 9}, {c1, c2}]

the results are: {{c1 -> 72., c2 -> -108.}}

my first expression above has been integrated twice generating the c1 and c2 terms, then I have to solve for them to have a complete equation that represents the deflection on the loaded beam. so if I "just simplify" my first equation I will get the wrong values for c1 and c2 as they evaluate at different location differently along the beam and different terms will drop out at different locations on the beam. This is reason why I can't integrate a simplified form of the equation, as terms will be combined losing the ability to drop those terms (representing different loads) that come after the location I am determining the deflection in the beam.

POSTED BY: Raymond Low

I know how frustrating it is to loose the outcome of an hour of work. Nevertheless, I would need to know the equations which 'create' the c1 and c2.

POSTED BY: Ulrich Mutze
Posted 10 years ago

thanks Ivan

I had tried Clearing the function without success before, but it worked this time, possibly I was focusing on the wrong variables. Regarding the integration, I now understand that the command Integrate will simplify the expression before it integrates. This doesn't work for me as each term needs to be evaluate separately after it has been integrated twice.

enter image description here

y2 is my original function, y1 after integration and y after the second integration. After solving for C2 and C1x, in yf[x] each term is evaluated depending how far along the beam one needs to determine the deflection of the beam at that location. By simplifying the expression before integration destroys the whole value of the expression. Is there anyway in Mathematica to integrate this expression without having it simplified first????

POSTED BY: Raymond Low

Unfortunately, you don't tell us what C2 and C1 stand for. So what you intend to do is not clear to me (I don't take the time to figure out all possibilities which are consistent with the incomplete information you give). It sounds absolutely strange to me that the simplification of a term should render any meaningful computational strategy impossible. Could you provide a full description of the beam deflection problem?

POSTED BY: Ulrich Mutze

Hi,

I don't know why y[x_] doesn't work

The reason for this is clear from the error message, y was set to 168 (-8+ x)+10 (-8+ x)^2- 4 (-6+ x)+ 5 (-4+ x)^2+96 x-15 x^2. You just need to Clear[] the definition of y.

what am I doing wrong here????

 y[x_] = 168 (-8 + x) + 10 (-8 + x)^2 - 4 (-6 + x) + 5 (-4 + x)^2 + 96 x - 15 x^2 ;
 y[x] // Simplify
 (* 60 (-10 + x) *)

I.M.

POSTED BY: Ivan Morozov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract