Sei sulla pagina 1di 10

# SetDirectory@"C:\\Users\\luciano\\Desktop\\DIDATTICA\\PASM\\Figure"D;

fig = Import@"OscillatoreArmonicoDoppio.jpg"D;
Show@fig, ImageSize 500D

## METODO DI INTEGRAZIONE DIRETTA DELLE

EQUAZIONI DEL MOTO
m2 x2 ''@tD +k2 Hx2 @tD -x1 @tDL FA Sin@ tD
m1 x1 ''@tD +k1 x1 @tD k2 Hx2 @tD -x1 @tDL

## m2 x2 ''@tD +k2 x2 @tD -k2 x1 @tD FA Sin@ tD

m1 x1 ''@tD +Hk1 + k2 L x1 @tD -k2 x2 @tD 0

## X1 @sD L 8x1 @tD<;

X2 @sD L 8x2 @tD<
2
L 8x1 ''@tD< s X1 @sD - s x1 @0D - x1 '@0D = s2 X1 @sD
L 8x2 ''@tD< s2 X2 @sD - s x2 @0D - x2 '@0D = s2 X1 @sD
FA
L 8FA Sin@ tD<
s2 + 2
FA
m2 s2 X2 + k2 X2 - k2 X1
s2 + 2
m1 s2 X1 + Hk1 + k2 L X1 - k2 X2 0
X2

m1 s2 + k1 + k2

X1

k2
Im2 s2 + k2 M
X1
X2

FA

s2

+ 2

FA
s2 + 2

m1 s2 + k1 + k2
k2

X1 - k2 X1

FA
s2 + 2

k2 IIm2 s2 + k2 M Im1 s2 + k1 + k2 M - k2 2 M

## Im1 s2 + k1 + k2 M IIm2 s2 + k2 M Im1 s2 + k1 + k2 M - k2 2 M

Esempio2Masse2Molle.nb

k2 IIm2 s2 + k2 M Im1 s2 + k1 + k2 M - k2 2 M, s, tF .
s2 + 2
8FA -> 1, k1 -> 10, k2 -> 5, m1 10, m2 20, -> 0.5<;

x1 = InverseLaplaceTransformB

FA

x2 = InverseLaplaceTransformB

## Im1 s2 + k1 + k2 M IIm2 s2 + k2 M Im1 s2 + k1 + k2 M - k2 2 M, s, tF .

s2 + 2
8FA -> 1, k1 -> 10, k2 -> 5, m1 10, m2 20, -> 0.5<;
FA

## Plot@8Re@x1 D, Re@x2 D<, 8t, 0, 200<, Frame True, ImageSize 500,

FrameLabel 8"t", "x1 HtL x2 HtL"<, BaseStyle 8"Times New Roman", 16<,
PlotStyle 88RGBColor@0, 0, 0D, Thickness@0.002D<,
8RGBColor@1, 0, 0D, Thickness@0.002D<<D

1.0

0.5
x1 HtL x2 HtL

0.0

-0.5

-1.0
0

50

100

150

200

## INTEGRAZIONE NUMERICA CON IL METODO ALLE

DIFFERENZE CENTRALI

Esempio2Masse2Molle.nb

## H* Central Finite Difference Method HCFDML *L

k1 = 10; k2 = 5; m1 = 10; m2 = 20; = 0.5; Fa1 = 0; Fa2 = 1;
Dt = 0.1; ntot = 2000;
H* Condizioni iniziali t0 = 0 *L
x10 = x20 = 0; v10 = v20 = 0;
fr10 = Fa1 Sin@ 0D - Hk1 + k2L x10 + k2 x20 ;
fr20 = Fa2 Cos@ 0D + k2 x10 - k2 x20 ;
fr10
fr20
a10 =
; a20 =
;
m1
m2
H* Istante di tempo t1=t0+Dt=Dt *L
Dt2

x11 =

Dt2

## a10 + x10 ; x21 =

a20 + x20 ;
2
2
v11 = Dt a10 + v10 ; v21 = Dt a20 + v20 ;
fr11 = Fa1 Sin@ DtD - Hk1 + k2L x11 + k2 x21 ;
fr21 = Fa2 Sin@ DtD + k2 x11 - k2 x21 ;
fr11
fr21
a11 =
; a21 =
;
m1
m2
vm11 = 0; vm21 = 0;
H* Istanti successivi al primo ti+1 = ti + Dt *L
DoB

## vm1i+1 = Dt a1i + vm1i ; vm2i+1 = Dt a2i + vm2i ;

x1i+1 = Dt vm1i+1 + x1i ; x2i+1 = Dt vm2i+1 + x2i ;
v1i+1 = Dt a1i + v1i ; v2i+1 = Dt a2i + v2i ;
fr1i+1 = Fa1 Sin@ Hi + 1L DtD - Hk1 + k2L x1i+1 + k2 x2i+1 ;
fr2i+1 = Fa2 Sin@ Hi + 1L DtD + k2 x1i+1 - k2 x2i+1 ;
fr1i+1
fr2i+1
a1i+1 =
; a2i+1 =
;
m1
m2
, 8i, 1, ntot<F;

Esempio2Masse2Molle.nb

## plotx1 = ListPlot@Table@8i Dt, x1i <, 8i, 1, ntot<D, Joined True,

PlotStyle 8RGBColor@0, 0, 0D, Thickness@0.002D<, Frame True,
BaseStyle 8"Times New Roman", 16<, ImageSize 500D;
plotx2 = ListPlot@Table@8i Dt, x2i <, 8i, 1, ntot<D, Joined True,
PlotStyle 8RGBColor@1, 0, 0D, Thickness@0.002D<, Frame True,
BaseStyle 8"Times New Roman", 16<, ImageSize 500D;
plotD = Show@plotx1, plotx2, PlotRange AllD

1.0

0.5

0.0

-0.5

-1.0
0

50

100

150

200

## INTEGRAZIONE NUMERICA CON IL METODO DI

NEWMARK
M=K

m1 0
O;
0 m2

K=K

k1 + k2 - k2
O;
- k2
k2

k1
- k1
0
- k1 k1 + k2 - k2 ;
0
- k2
k2

Kcm = Dt2 K + M;
Kcm =

;
- Dt2 k2
Dt2 k2 + m2

## Fresi+1 = Fi+1 - K Xi + Dt Vi + Dt2

K

fr1i+1
O=
fr2i+1
K

- Ai ;
2

0
k1 + k2 -k2
x1
v1
O-K
O K i O + Dt K i O + Dt2
FA Sin@ Hi + 1L DtD
-k2
k2
x2i
v2i

fr1i+1
0
k1 + k2 -k2
K
O=K
O-K
O
fr2i+1
FA Sin@ Hi + 1L DtD
-k2
k2
=

1
2

- K

a1i
O ;
a2i

## x1i + Dt v1i + Dt2 I 12 - M a1i

x2i + Dt v2i + Dt2 I 12 - M a2i

Esempio2Masse2Molle.nb

fr1i+1
0
O=K
Ofr2i+1
FA Sin@ Hi + 1L DtD

Hk1 + k2L Ix1i + Dt v1i + Dt2 I 12 - M a1i M - k2 Ix2i + Dt v2i + Dt2 I 12 - M a2i M
-k2 Ix1i + Dt v1i + Dt2 I 12 - M a1i M + k2 Ix2i + Dt v2i + Dt2 I 12 - M a2i M

fr1i+1
K
O=
fr2i+1

## Ai+1 = Kcm-1 Fresi+1 ;

a1
K i+1 O =
a2i+1

m2+k2 Dt2
m1 m2+k2 m1 Dt2 +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4

k2 Dt2
m1 m2+k2 m1 Dt2 +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4

k2 Dt2
m1 m2+k2 m1 Dt +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4

m1+Hk1+k2L Dt2
m1 m2+k2 m1 Dt +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4

fr1i+1
O;
fr2i+1

a1i+1
O=
a2i+1

## m1 m2+k2 m1 Dt +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4

k2 Dt2 fr11+i
m1 m2+k2 m1 Dt +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4
2

+
+

k2 Dt2 fr21+i
m1 m2+k2 m1 Dt2 +k1 m2 Dt2 +k2 m2 Dt2 +k1 k2 2 Dt4
Im1+Hk1+k2L Dt2 M fr21+i
2

## m1 m2+k2 m1 Dt +k1 m2 Dt +k2 m2 Dt +k1 k2

Dt

Esempio2Masse2Molle.nb

## k1 = 10; k2 = 5; m1 = 10; m2 = 20; = 0.5; Fa1 = 0; Fa2 = 1;

Dt = 0.1; ntot = 2000;
= 0.5; =

H2 + 1L2

;
16
H* Condizioni iniziali t0 = 0 *L
x10 = x20 = 0; v10 = v20 = 0;
fr10 = Fa1 Sin@ 0D - Hk1 + k2L x10 + k2 x20 ;
fr20 = Fa2 Cos@ 0D + k2 x10 - k2 x20 ;
fr10
fr20
a10 =
; a20 =
;
m1
m2
H* Istanti successivi ti+1 = ti + Dt *L
DoB

fr1i+1 =

## fr2i+1 = Fa2 Sin@ Hi + 1L DtD + k2 x1i + Dt v1i + Dt2

k2 x2i + Dt v2i + Dt2

a1i+1

1
- a2i ;
2

1
- a1i 2

- a2i ;
2
= IIm2 + k2 Dt2 M fr11+i M

## x1i+1 = x1i + Dt v1i + Dt2

x2i+1 = x2i + Dt v2i + Dt2
v1i+1
v2i+1

1
2
1

- a1i + a1i+1 ;

- a2i + a2i+1 ;
2
= v1i + Dt HH1 - L a1i + a1i+1 L;
= v2i + Dt HH1 - L a2i + a2i+1 L;

, 8i, 0, ntot<F;

Esempio2Masse2Molle.nb

## plotx1N = ListPlot@Table@8i Dt, x1i <, 8i, 1, ntot<D, Joined

PlotStyle 8RGBColor@0, 0, 0D, Thickness@0.002D<, Frame
BaseStyle 8"Times New Roman", 16<, ImageSize 500D;
plotx2N = ListPlot@Table@8i Dt, x2i <, 8i, 1, ntot<D, Joined
PlotStyle 8RGBColor@1, 0, 0D, Thickness@0.002D<, Frame
BaseStyle 8"Times New Roman", 16<, ImageSize 500D;
plotDN = Show@plotx1N, plotx2N, PlotRange AllD

True,
True,
True,
True,

1.0

0.5

0.0

-0.5

-1.0
0

50

100

150

## METODO DI SOVRAPPOSIZIONE MODALE

M=K

m1 0
O;
0 m2
k1 + k2 - k2
K=K
O;
- k2
k2
eq1 = Det@K - MD
50 - 350 + 200 2
sol = . Solve@eq1 0, D
:

1
8

I7 -

1 =
2 =

33 M,

1
8

I7 +

sol@@1DD N
sol@@2DD N

0.396143
1.26217

33 M>

200

Esempio2Masse2Molle.nb

IK - 12 MM.K

0.11
O MatrixForm
12
0.1
IK - 22 MM.K
O MatrixForm
22
K
K

1.47738 - 5. 12
O
- 0.55 + 1.86141 12
- 0.0930703 - 5. 22
O
- 0.5 - 26.8614 22

F1 = K

0.11
O
1.477377363898979` 5
0.1
F2 = K
O
- 0.5 26.861406616345075`
880.11<, 80.295475<<

880.1<, 8- 0.0186141<<

X HtL K

x1
q1
F1@@1, 1DD F2@@1, 1DD
OFQK
OK O
x2
q2
F1@@2, 1DD F2@@2, 1DD
F1@@1, 1DD q1 + F2@@1, 1DD q2
K
O
F1@@2, 1DD q1 + F2@@2, 1DD q2

## x1 HtL F1@@1, 1DD q1 + F2@@1, 1DD q2

x2 HtL F1@@2, 1DD q1 + F2@@2, 1DD q2
Q'' HtL + W2 Q HtL p HtL
p HtL
K

F T F HtL

==

FT M F
K

## F1@@1, 1DD F1@@2, 1DD

0
OK
O
F2@@1, 1DD F2@@2, 1DD
FA Sin@ tD

## F1@@1, 1DD F1@@2, 1DD

m1 0
F1@@1, 1DD F2@@1, 1DD
OK
OK
O
F2@@1, 1DD F2@@2, 1DD
0 m2
F1@@2, 1DD F2@@2, 1DD
K

## F1@@2, 1DD FA Sin@ tD

O
F2@@2, 1DD FA Sin@ tD

## F1@@1, 1DD m1 F1@@2, 1DD m2

F1@@1, 1DD F2@@1, 1DD
K
OK
O
F2@@1, 1DD m1 F2@@2, 1DD m2
F1@@2, 1DD F2@@2, 1DD

## F1@@2, 1DD FA Sin@ tD

O
F2@@2, 1DD FA Sin@ tD
K

==

==

## F1@@1, 1DD2 m1 + F1@@2, 1DD2 m2

F1
F1@@1, 1DD F2@@1, 1DD m1 + F1@@2, 1DD F2@@2, 1DD m2

## F1@@2, 1DD FA Sin@ tD

O
F2@@2, 1DD FA Sin@ tD

## F1@@1, 1DD2 m1 + F1@@2, 1DD2 m2

0
2
0
F2@@1, 1DD m1 + F2@@2, 1DD2 m2
F1@@2,1DD FA Sin@ tD
F1@@1,1DD2 m1+F1@@2,1DD2 m2
F2@@2,1DD FA Sin@ tD
F2@@1,1DD2 m1+F2@@2,1DD2 m2

Esempio2Masse2Molle.nb

## qi -i 2 gi HtL q0,i + gi ' HtL q'0,i + gi ' Ht - L pi HL d ==

gi ' Ht - L pi HL d

dove

gi ' HtL =

Quindi,

e-i i t Sin Hi tL =

q1 ''@tD + 1 2 q1 @tD
q2 ''@tD + 2 2 q2 @tD

1
i

Sin Hi tL

## F1@@2, 1DD FA Sin@ tD

F1@@1, 1DD2 m1 + F1@@2, 1DD2 m2
F2@@2, 1DD FA Sin@ tD
F2@@1, 1DD2 m1 + F2@@2, 1DD2 m2

Pertanto
q1 HtL
q2 HtL
1

q1 =

1
1
1
2

Sin @1 Ht - LD
t

Sin @2 Ht - LD
0

1
IntegrateB
2

## Sin@1 Ht - LD F1@@2, 1DD Fa2 Sin@ D

F1@@1, 1DD2 m1 + F1@@2, 1DD2 m2

IntegrateB

q2 =

## Sin@2 Ht - LD F2@@2, 1DD Fa2 Sin@ D

F2@@1, 1DD2 m1 + F2@@2, 1DD2 m2

, 8, 0, t<F
, 8, 0, t<F

## 0.792287 H- 0.163592 Sin@0.5 tD + 0.0648059 Sin@1.26217 tDL

x1 = F1@@1, 1DD q1 + F2@@1, 1DD q2
x2 = F1@@2, 1DD q1 + F2@@2, 1DD q2
0.277677 H0.850176 Sin@0.396143 tD - 0.673584 Sin@0.5 tDL +
0.0792287 H- 0.163592 Sin@0.5 tD + 0.0648059 Sin@1.26217 tDL
0.74588 H0.850176 Sin@0.396143 tD - 0.673584 Sin@0.5 tDL 0.0147477 H- 0.163592 Sin@0.5 tD + 0.0648059 Sin@1.26217 tDL

Esempio2Masse2Molle.nb

## Plot@8x1, x2<, 8t, 0, 200<, PlotStyle 88RGBColor@0, 0, 0D, Thickness@0.002D<,

8RGBColor@1, 0, 0D, Thickness@0.002D<<, Frame True,
BaseStyle 8"Times New Roman", 16<, ImageSize 500,
FrameLabel 8"t", "x1 HtL x2 HtL"<D

1.0

0.5
x1 HtL x2 HtL

10

0.0

-0.5

-1.0
0

50

100
t

150

200