Post Reply 
problems with integration
01-09-2015, 04:13 AM (This post was last modified: 01-09-2015 04:16 AM by resolved.)
Post: #36
RE: problems with integration
Thanks Claudio for your kind input, I have read your post twice, but I will need more time to absorb it all because this subject was taught to me differently. Below is a sample problem I was given:

   

This is how I solve the problem in Mathematica. Solving for the two supports:
NSolve[{(*Ma*)
0 == -25 + 7*2*(1) + 7*(2) + 14*2*(3) + 11 - dv*(7) + 7*2*(8),(*Fv*)
0 == -7*2 - 7 - 14*2 - 7*2 + av + dv}, {av, dv}]
{{av -> 33., dv -> 30.}}

Setting the problem up:
y21 = -25 + 33 x - (7 x*(x/2) - 7 (x - 2) (x - 2)/2) -
7 (x - 2) - (14 (x - 2) (x - 2)/2 - 14 (x - 4) (x - 4)/2) +
11 (x - 4)^0 + 30 (x - 7) - 7 (x - 7) (x - 7)/2

Mathematica simplified y21 to:
y22 = -14 + 30 (-7 + x) - 7/2 (-7 + x)^2 +
7 (-4 + x)^2 - 7 (-2 + x) - 7/2 (-2 + x)^2 + 33 x - (7 x^2)/2

but I manually broke the two couples apart as shown below
y22 = -25 + 11 (x - 4)^0 + 30 (-7 + x) - 7/2 (-7 + x)^2 +
7 (-4 + x)^2 - 7 (-2 + x) - 7/2 (-2 + x)^2 + 33 x - (7 x^2)/2

I then integrated manually to get:
y11 = -25 x + 11 (x - 4) + 30 (-7 + x)^2/2 - 7/2 (-7 + x)^3/3 +
7 (-4 + x)^3/3 - 7 (-2 + x)^2/2 - 7/2 (-2 + x)^3/3 + 33 x^2/2 -
7 /2 x^3/3

Mathematica simplified y11 to (see below) and I added c1:
y12 = 15 (-7 + x)^2 - 7/6 (-7 + x)^3 + 11 (-4 + x) + 7/3 (-4 + x)^3 -
7/2 (-2 + x)^2 - 7/6 (-2 + x)^3 - 25 x + (33 x^2)/2 - (7 x^3)/6 + c1

I then manually integrated a second time to get (below) and added c2:
y01 = 15 (-7 + x)^3/3 - 7/6 (-7 + x)^4/4 + 11 (-4 + x)^2/2 +
7/3 (-4 + x)^4/4 - 7/2 (-2 + x)^3/3 - 7/6 (-2 + x)^4/4 - 25 x^2/2 +
33/2 x^3/3 - 7/6 x^4/4 + c1 x + c2

Mathematica simplified to get:
y02 = c1 x + c2 + 5 (-7 + x)^3 - 7/24 (-7 + x)^4 + 11/2 (-4 + x)^2 +
7/12 (-4 + x)^4 - 7/6 (-2 + x)^3 - 7/24 (-2 + x)^4 - (25 x^2)/2 + (
11 x^3)/2 - (7 x^4)/24

I then used "Max" instead of piecewise to solve for c1 and c2:
y[x_] = c1 x + c2 + 5 Max[0, (-7 + x)]^3 - 7/24 Max[0, (-7 + x)]^4 +
11/2 Max[0, (-4 + x)]^2 + 7/12 Max[0, (-4 + x)]^4 -
7/6 Max[0, (-2 + x)]^3 - 7/24 Max[0, (-2 + x)]^4 - (25 x^2)/2 + (
11 x^3)/2 - (7 x^4)/24;

NSolve[{y[0] == 0, y[7] == 0}, {c1, c2}]
{{c1 -> -48.9048, c2 -> 0.}}

I then substituted in for c1 and was able to create a plot of the beam deflection
yf[x_] :=
5 Max[0, (-7 + x)]^3 - 7/24 Max[0, (-7 + x)]^4 +
11/2 Max[0, (-4 + x)]^2 + 7/12 Max[0, (-4 + x)]^4 -
7/6 Max[0, (-2 + x)]^3 - 7/24 Max[0, (-2 + x)]^4 - (25 x^2)/2 + (
11 x^3)/2 - (7 x^4)/24 - 48.904761904761905` x;
Plot[yf[x], {x, 0, 9}]

   

Now HP Prime's turn using Han's program MINT

I set up the initial equation as shown below:
y1:=−25*MINT(0,0,2)+11*MINT(4,0,2)+30*MINT(7,1,2)-(7/2)*MINT(7,2,2)+7*MINT(4,2,2)-7*MINT(2,1,2)-(7/2)*MINT(2,2,2)+33*MINT(0,1,2)-(7/2)*MINT(0,2,2)

The program worked and I got:
(x)->-25*CASE IF 0>x THEN
0 END IF x≥0 THEN
1/2*x^2 END END+11*CASE IF 4>x THEN
0 END IF x≥4 THEN
1/2*(x-4)^2 END END+30*CASE IF 7>x THEN
0 END IF x≥7 THEN
1/6*(x-7)^3 END END-7/2*CASE IF 7>x THEN
0 END IF x≥7 THEN
1/12*(x-7)^4 END END+7*CASE IF 4>x THEN
0 END IF x≥4 THEN
1/12*(x-4)^4 END END-7*CASE IF 2>x THEN
0 END IF x≥2 THEN
1/6*(x-2)^3 END END-7/2*CASE IF 2>x THEN
0 END IF x≥2 THEN
1/12*(x-2)^4 END END+33*CASE IF 0>x THEN
0 END IF x≥0 THEN
1/6*x^3 END END-7/2*CASE IF 0>x THEN
0 END IF x≥0 THEN
1/12*x^4 END END

I added c1*x + c2 to y1
y2:=y1 + c1*x + c2

and solved for c1 and c2
fsolve({y2(0)=0,y2(7)=0},{c1,c2})

and got the result:
[−48.9047619048,0.] cool, much faster than by hand with less chance for error

I then created a new function
y3:=y1 -48.9047619048 x (how do you extract just the -48.904... out of the matrix???, had to type it in)

I checked my memory in CAS variables and found y1, y2, y3

Great now I have an equation that will give me the deflection of the beam at any point on the beam.. so lets try at the end of the beam, 9 meters from point A
y3(9)

damn -- soooo close, application crashed and I lost all my variables y1,y2 and y3

   

so what did I do wrong this time????
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
problems with integration - resolved - 11-28-2014, 05:04 AM
RE: problems with integration - parisse - 11-28-2014, 07:33 AM
RE: problems with integration - resolved - 11-28-2014, 01:26 PM
RE: problems with integration - parisse - 11-28-2014, 02:33 PM
RE: problems with integration - akmon - 11-28-2014, 10:30 PM
RE: problems with integration - resolved - 11-29-2014, 11:42 AM
RE: problems with integration - Gilles - 11-29-2014, 09:00 PM
RE: problems with integration - akmon - 11-29-2014, 01:32 PM
RE: problems with integration - peacecalc - 11-29-2014, 08:12 PM
RE: problems with integration - parisse - 11-30-2014, 07:10 AM
RE: problems with integration - resolved - 11-30-2014, 12:22 PM
RE: problems with integration - akmon - 11-30-2014, 12:28 PM
RE: problems with integration - resolved - 12-01-2014, 06:00 AM
RE: problems with integration - Han - 12-01-2014, 03:45 PM
RE: problems with integration - resolved - 12-06-2014, 01:39 PM
RE: problems with integration - Han - 12-06-2014, 03:35 PM
RE: problems with integration - resolved - 12-06-2014, 03:37 PM
RE: problems with integration - Han - 12-06-2014, 03:46 PM
RE: problems with integration - resolved - 12-06-2014, 04:07 PM
RE: problems with integration - resolved - 12-07-2014, 12:07 PM
RE: problems with integration - Han - 12-08-2014, 02:19 AM
RE: problems with integration - Claudio L. - 01-07-2015, 03:48 PM
RE: problems with integration - Han - 12-08-2014, 03:57 PM
RE: problems with integration - resolved - 01-03-2015, 11:45 AM
RE: problems with integration - resolved - 01-06-2015, 01:55 AM
RE: problems with integration - Han - 01-06-2015, 01:09 PM
RE: problems with integration - resolved - 01-07-2015, 03:57 AM
RE: problems with integration - resolved - 01-08-2015, 12:40 AM
RE: problems with integration - Han - 01-07-2015, 05:11 AM
RE: problems with integration - Snorre - 01-07-2015, 08:57 AM
RE: problems with integration - resolved - 01-09-2015 04:13 AM
RE: problems with integration - parisse - 01-09-2015, 07:21 AM
RE: problems with integration - parisse - 01-09-2015, 12:40 PM
RE: problems with integration - resolved - 01-10-2015, 10:30 AM
RE: problems with integration - rprosperi - 01-10-2015, 01:34 PM
RE: problems with integration - Snorre - 01-10-2015, 02:16 PM
RE: problems with integration - Han - 01-10-2015, 02:19 PM
RE: problems with integration - parisse - 01-10-2015, 03:17 PM
RE: problems with integration - Snorre - 01-10-2015, 03:58 PM
RE: problems with integration - parisse - 01-10-2015, 07:58 PM
RE: problems with integration - jte - 01-12-2015, 06:18 AM



User(s) browsing this thread: 1 Guest(s)