A Numerical Study of Ship’s Rolling Motion

download A Numerical Study of Ship’s Rolling Motion

of 9

Transcript of A Numerical Study of Ship’s Rolling Motion

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    1/9

    A Numerical Study of Ships Rolling Motion

    Liew How Hui and Pan Yean Fong

    Faculty of Engineering and Science,Department of Mathematical and Actuarial Sciences,

    Universiti Tunku Abdul Rahman, Kuala Lumpur Campus,Jalan Genting Kelang, 53300 Kuala Lumpur, Malaysia

    [email protected] , yean [email protected]: http://sites.google.com/site/liewhowhui

    Abstract. The rolling motion of a ship can be modelled by a second order ordinarydifferential equation with the oscillation of sea waves as the parameter. An analyticalstudy of the ship model lead to a system of algebraic equations which demonstrated

    period doubling bifurcation and jump phenomena. To study the system of algebraicequations, numerical continuation method is used. It is compared to the simulationresult when the frequency changes. During the numerical analysis of the ship model,sensitivity of numerical integrator, the simulation results matched the theoretical cal-culated resonant curves except for the period doubling region.

    1 Introduction

    Rolling motion has been considered since long time the motion relevant to thehydrodynamic part of the ship safety [8]. Rolling motions of a ship not onlycause dangers (e.g. ship capsizing) to ships but can also cause damages to ship

    containers, as demonstrated in [7].Grochowalski [9] pointed out that ... at present, neither model testing nor

    pure theoretical modelling alone could provide a reliable prediction of stronglynon-linear and transient phenomena involved in ship capsizing. Instead, a com-bination of theoretical modelling with model experiments proved to be a verypowerful and effective approach in studies of this kind of problems.

    The most accurate model that describes the motions of a ship involves ordi-nary differential equations with six degrees of freedom [12]. However, this modelis only suitable for numerical simulation and is too complex to analyse mathe-matically. When only rolling motion is considered, the system can be reduced

    to a forced nonlinear oscillator with nonlinear damping and restoring force, i.e.I + D(, ) + Mr() = E(t). It approximates closely the rolling motion of aship and is widely analysed in the study of ship dynamics [4].

    Steady-state response to the frequency of external forcing is one of the im-portant research in the understanding of the rolling motion of ships [4]. Chaosand jumping phenomena may be the possible causes of damages related to vi-brations in general mechanical systems, including the rolling motion of ships.Jumping phenomenon can even lead to the ship capsizing.

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 843

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    2/9

    This paper studies the methods and open source software used and the diffi-culties faced in the numerical computation of steady-state response of externalforcing.

    2 Ship Roll Model

    The following nonlinear oscillator with asymmetric nonlinear elastic character-istics is a simplified model for ship rolling motions [23]:

    + h + 20 + k2 + 3 = P1 cos(t) (1)

    where is related to the rolling angle with respect to the calm sea surface,h > 0, h2 420 (the system is lightly damped).

    Let 20 = 33

    P20 , k = 33

    P0, by introducing a new coordinate, x = +3

    P0,

    the equation (1) can be transformed into a forced Duffing equation [4]:

    x + hx + x3 = P0 + P1 cos(t). (2)

    The Duffing equation (2) is a nonlinear equation which demonstrates perioddoubling bifurcations, chaotic behaviour and jump phenomenon and has beenextensively studied [24, 23]. The Duffing equation (2) with P0 = 0.020, P1 =0.16, h = 0.05 was implemented in Python (to be introduced in next Section)as follows:

    Program: shipmodels.py Python implementation of the Equation (2)

    from scipy import cos

    def rolling_ship(xv,t,v):

    x,y = xv[0], xv[1]

    d x = y

    # P0=0.02; P1=0.16; h=0.05

    dy = 0.02 + 0.16*cos(v*t)-0.05*y-x**3

    return (dx,dy)

    3 Open Source Software

    Scientists and engineers must have appreciation for computers in order to gettheir job done more efficiently and productively [14]. There will be surveys on theavailable software for symbolic algebra and numerical computation publishedin books [21], journals, proceeding and the Internet [3] every few years.

    Although commercial mathematical software are more advanced but theopen source software have been developed with all important basic features. Toperform proper numerical analysis on the ship roll model (2), a computer algebrasystem Maxima [17] and a numerical computation system SciPy [13] are used.

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 844

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    3/9

    They provide the necessary numerical methods mentioned in [20] required tostudy dynamical systems.

    Maxima is based on a 1982 version ofMacsyma [16], which was developed

    at MIT with funding from the United States Department of Energy and othergovernment agencies. A version of Macsyma was maintained by Bill Schelterfrom 1982 until his death in 2001. In 1998 Schelter obtained permission fromthe Department of Energy to release his version under the GPL. That version,now called Maxima, is maintained by an independent group of developers [25].

    Maxima is a rather simple system which allows the user to perform basicsymbolic calculus (substitution and simplification), differentiation and integra-tion only. The comparison, expansion and extraction of harmonic terms requiredin the analysis of resonance curve discussed in Section 5 are not available. Hence,one needs to manually code and check each line of code to find the equations

    for the resonance curve.Python[15, 19] is an interpret programming language with many useful mod-ules for numerical computation, such as NumPy [2, 18] and SciPy [13]. Thismade Python an excellent system to perform numerical modelling and simula-tion.

    To analyse system (2), we need numerical integration for ordinary differentialequations (ODEs), Fast Fourier Transform (FFT), and numerical continuation.SciPy has included Odepack [10], which consists of a collection of standardroutines to perform numerical integration for ODEs. SciPy also included FFT-PACK [22], a standard routine to compute FFT.

    PyDSTool [5] implements the numerical continuation method [1]. It is used

    to compute the resonant curves given by theoretical derived equations.Finally, Matplotlib [11] is a Python 2D plotting library which produces pub-

    lication quality figures in a variety of hardcopy formats and interactive environ-ments across platforms.

    4 Phase Portraits of Steady-State Solutions

    To study the dynamics of the system (2) for a fixed forcing frequency , thephase portrait (x(t; x0, x0), x(t; x0, x0)), is analysed. Here (x0, x0) denotes theinitial condition for (2).

    We have chosen = 0.9 which lies in the region which demonstrates periodicbifurcation to investigate the qT-periodic solution. Using the Python programbelow, we obtained Figures 1(a)1(c).

    Program: phase.py Plotting the phase portrait of Equation (2)

    stop = 250 # Number of Cycles

    steady = 150 # Assume steady after 150 cycles

    sample = 200 # For more precision this can be made large

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 845

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    4/9

    v, x0 = .9, [0.1,0.0]

    from shipmodels import rolling_ship

    T = 2*pi/vt = r_[0:stop*T:stop*sample*1j]

    x = odeint(rolling_ship, x0, t, args=(v,))

    tsteady = t[steady*sample:stop*sample] - t[steady*sample]

    xsteady = x[steady*sample:stop*sample,0]

    vsteady = x[steady*sample:stop*sample,1]

    # Phase portrait

    xmin, xmax, ymin, ymax = -2.,2.,-2.,2.

    axis([xmin,xmax,ymin,ymax])

    plot(xsteady,vsteady,k);

    axhline(xmin=xmin,xmax=xmax); axvline(ymin=ymin,ymax=ymax);

    title(Phase Plot);xlabel($x$);ylabel($\dot{x}$);

    1 . 5 1 .0 0 . 5 0 . 0 0 . 5 1 . 0 1 . 5

    x

    1 .0

    0 . 5

    0 . 0

    0 . 5

    1 .0

    x

    P h a s e P l o t @ v = 0 . 9 , x

    0

    = ( 0 . 1 0 , 0 . 0 0 )

    (a) (x0, x0) = (0.10, 0.00)

    1 . 5 1 . 0 0 . 5 0 . 0 0 . 5 1 . 0 1 . 5

    x

    1 . 0

    0 . 5

    0 . 0

    0 .5

    1 . 0

    x

    P h a s e P l o t @ v = 0 . 9 , x

    0

    = ( 0 . 1 0 , 0 . 2 0 )

    (b) (x0, x0) = (0.10, 0.20)

    1 . 5 1 . 0 0 . 5 0 . 0 0 . 5 1 . 0 1 . 5

    x

    1 . 0

    0 .5

    0 . 0

    0 . 5

    1 . 0

    x

    P h a s e P l o t @ v = 0 . 9 , x

    0

    = ( 0 . 1 0 , 0 . 3 0 )

    (c) (x0, x0) = (0.10, 0.30)

    Fig. 1. Steady-state solution for Equation (2) with = 0.9, P0

    = 0.020, P1

    = 0.16, h = 0.05 anddifferent initial conditions.

    Comparing Figure 1(a) and Figure 1(b), we suspected the transient existsfor steady equals to 150. Hence, the variable steady was changed to 300 andstop was changed to 350, the transient goes away and we obtained Figure 1(b).What is really surprising is that when stop was changed to 400, we obtainedFigure 1(c) and when stop was changed to 500, we obtained Figure 1(b). This isreally surprising in view of the routine in SciPy is from Odepack, which has beena standard ODE solver. We attribute this to the possibility that the adaptivealgorithm implemented in Odepack may cause the system to be sensitive torounding errors.

    5 Implementations

    In [24] and [23], the harmonic balance method was used to study the system(2) for the T-periodic solution and qT-periodic solution, where q is an integerlarger than 1. This section implements the numerical computation in Python

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 846

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    5/9

    of resonance curves associated with the T-period and 2T-periodic solutions ofEquation (2) studied in [23].

    5.1 First Order Resonance Curves and Simulation ResultWith first order approximation x = x(1)0 = C0 + C1 cos(t + ), Equation (2)gives

    (C30 +32

    C0C21 ) + (2C1 + 3C20C1 + 34C31 ) cos(t + ) + (hC1) sin(t + )

    + 32

    C0C21 cos(2(t + )) +

    14

    C31 cos(3(t + ))= P0 + P1 cos cos(t + ) + P1 sin sin(t + )

    By ignoring the high frequency terms cos(2(t +)) and cos(3(t +)), we obtain

    2C1 +3

    4C31 + 3C

    20C1 = P1 cos() (3)

    hC1 = P1 sin() (4)

    C30 +3

    2C0C

    21 = P0 (5)

    The solution of equations (3)(5) can be obtained using PyDSTool. Thecode is shown below.

    Program: First order approximation of the resonant curve.

    from PyDSTool import *

    ### Theoretical Calculation using First Order Approximation

    class Order1(object):

    def __init__(self):

    pars = {v: 0.6}

    ### The model with P0=0.020; P1=0.16; h=0.05

    c0str = (-v**2*C1 + 3*C0**2*C1 + 0.75*C1**3)**2 + (0.05*v*C1)**2 - 0.16**2

    c1str = pow(C0,3) + 1.5*C0*C1**2 - 0.020

    DSargs = args(name=ShipResonanceCurve)

    DSargs.pars = pars

    DSargs.varspecs = {C0: c0str, C1: c1str}

    DSargs.ics = {C0 : 0.01836388, C1 : 0.85196136}

    testDS = Generator.Vode_ODEsystem(DSargs)

    PyCont = ContClass(testDS)

    PCargs = args(name=EQ1, type=EP-C)

    PCargs.freepars = [v]

    PCargs.StepSize = 1e-2

    PCargs.MaxNumPoints = 75

    PCargs.MaxStepSize = 1e-1

    PCargs.LocBifPoints = all

    PCargs.verbosity = 2

    PyCont.newCurve(PCargs)

    PyCont[EQ1].backward()

    self.c = PyCont[EQ1].curve

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 847

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    6/9

    To verify the theoretical prediction, we perform a simulation and use FFTto extract the amplitude of the first harmonic using the code below.

    Program: resonc1.py Compare simulated result with first order approxi-

    mationfrom approx1 import Order1

    ap1 = Order1(); c = ap1.c

    from shipmodels import rolling_ship as rs

    from simul import Simulation

    s = Simulation(rs,x0=[1.,1.],start=0.4,end=2.4,step=.05,verbose=True)

    vs,c0,c1 = s.vs, s.c0, s.c1

    from matplotlib.pylab import plot, show, xlabel,ylabel, legend, savefig

    plot(vs,c0,bo,vs,c1,r*,c[:-2,2],c[:-2,0],b-,c[:,2],c[:,1],r-)

    legend(($C_0$, $C_1$));xlabel(r"$\nu$");ylabel("Amplitude");

    show()

    From the simulation, we observe a jump occurring around = 1.6 if theforcing frequency increases from = 0.4 to 2.4. However, another jump isobserved to occur around = 0.9 if the forcing decreases from = 2.4 down to0.4.

    0 . 0 0 . 5 1 . 0 1 . 5 2 . 0 2 . 5 3 . 0

    0 . 0

    0 . 5

    1 . 0

    1 . 5

    2 . 0

    A

    m

    p

    l

    i

    t

    u

    d

    e

    C

    0

    C

    1

    (a) Forcing frequency is increasing

    0 . 0 0 . 5 1 . 0 1 . 5 2 . 0 2 . 5 3 . 0

    0 . 0

    0 . 5

    1 . 0

    1 . 5

    2 . 0

    A

    m

    p

    l

    i

    t

    u

    d

    e

    C

    0

    C

    1

    (b) Forcing frequency is decreasing

    Fig. 2. Steady-state behaviour of the outer cycle

    From Figure 2(b), we observed that the simulated result and resonance curve

    differs for the range from 0.9 to 1.1. This according to [23], is because a perioddoubling has happened and the T-periodic solution becomes unstable. Hence,a second order approximation is needed to better approximate the 2T-periodsolution, as demonstrated in the next section.

    5.2 Second Order Resonance Curves

    Substituting the second order approximation x = x(2)0 = A0 + A1 cos(t) +

    A1/2 cos(t2

    +) into Equation (2) and balance the harmonic terms using Maxima,

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 848

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    7/9

    we obtain [24]

    2 +

    3

    4

    A21/2 + 3A20 +

    3

    2

    A21 + 3A0A1 cos(2) = 0,

    A12 +3

    4A31 + 3A

    20A1 +

    3

    2A21/2A1 +

    3

    2A0A

    21/2 cos(2) = 0,

    12

    h+ 3A0A1 sin(2) = 0,

    A30 +3

    2A0A

    21/2 +

    3

    2A0A

    21 +

    3

    4A21/2A1 cos(2) = P0.

    (6)

    Using a similar program to resonc1.py, the resonance curve (6) was foundin Figure 3 (the solid lines). We see that it is only located in the range 0.7 to1.2 indicating that in this range, we may observe 2T-periodic solutions.

    0 . 5 1 . 0 1 . 5

    2 . 0 2 . 5

    0 . 0

    0 . 5

    1 . 0

    1 . 5

    2 . 0

    A

    m

    p

    l

    i

    t

    u

    d

    e

    A

    0

    A

    0 . 5

    C

    0

    C

    1

    Fig. 3. Comparison of resonance curves obtained from first and second order approximations.

    Performing a simulation for changing from 1.3 down to 0.7, we obtainedFigure 4 which is a good match except for the range 0.93 to 0.98. The poormatch here may be due to further period doubling or the sensitivity of Odepackto numerical errors.

    0 . 6 0 . 7 0 . 8 0 . 9 1 . 0 1 . 1 1 . 2 1 . 3 1 . 4

    0 . 0

    0 . 2

    0 . 4

    0 . 6

    0 . 8

    1 . 0

    1 . 2

    A

    m

    p

    l

    i

    t

    u

    d

    e

    C

    0

    A

    0 . 5

    C

    1

    A

    0

    A

    0 . 5

    Fig. 4. Steady-state behaviour of the p eriod-doubling process.

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 849

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    8/9

    6 Conclusion

    This paper applied the open source software to the investigation of the numerical

    computation of steady-state response of external forcing. The computer algebrasystem was found to lack the implementation of algorithms for harmonic balancetechnique.

    The numerical system for Python is sufficient for the numerical study of theship rolling motion described by Duffing equation. However, it is found thatfor certain parameters, the numerical integrator of a differential equation isbehaving strangely and more in depth investigation into the implementation isrequired.

    If we change P0 in Equation (2) from 0.02 to 0.03 or 0.045, we observed thatthe range of period-doubling will get larger and that the chaotic solution can

    be clearly observed numerically, whereas the chaotic solution is not clearly ob-servable for P0 = 0.02. According to Feigenbaum principle [6], we should expectall the three cases with period-doubling to demonstrate similar behaviour. Thisrequires further mathematical and numerical analysis.

    7 Acknowledgements

    The authors wish to thank Universiti Tunku Abdul Rahman for the support ofthis research. The first author would like to thank Professor James Peyton-Jonesfor introducing him to the research in ship dynamics.

    References

    1. Allgower, E.L., Georg, K.: Introduction to Numerical Continuation Methods. No. 45 in SIAMClassics in Applied Mathematics, SIAM (2003)

    2. Ascher, D., et al.: Numerical python. Tech. Rep. UCRL-MA-128569, Lawrence Livermore Na-tional Laboratory (2001), http://numpy.scipy.org

    3. Boisvert, R.F.: A guide to available mathematical software (1994), \url{http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.17.3729}

    4. Cardo, A., Francescutto, A., Nabergoj, R.: Ultraharmonics and subharmonics in the rollingmotion of a ship: Steady-state solution. International shipbuilding progress, Marine technologymonthly, Rotterdam The Netherlands 28(326) (October 1981)

    5. Clewley, R., Sherwood, W.E., Lamar, M.D., Guckenheimer, J.: Pydstool: An integrated simula-tion, modeling, and analysis package for dynamical systems (2007), http://sourceforge.net/projects/pydstool

    6. Feigenbaum, J.D.: Quantitative universality for a class of non-linear transformations. Journal ofSatistical Physics 19, 2552 (1978)

    7. France, W.N., Levadou, M., Treakle, T.W., Paulling, J.R., Michel, R.K., Moore, C.: An investi-gation of head-sea parametric rolling and its influence on container lashing systems. Tech. rep.,SNAME Annual Meeting 2001 Presentation (2001)

    8. Francescutto, A.: Nonlinear ship rolling in the presence of narrow band excitation. In: NonlinearDynamics of Marine Vehicles. ASME/DSC, vol. 5, pp. 93102 (1993)

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 850

  • 7/28/2019 A Numerical Study of Ships Rolling Motion

    9/9

    9. Grochowalski, S.: Experimental investigation of ship dynamics in extreme waves. In: Vassalos, D.,Hamamoto, M., Papanikolaou, A., Molyneux, D. (eds.) Contemporary Ideas on Ship Stability.Elsevier Science Ltd. (2000)

    10. Hindmarsh, A.C.: ODEPACK, a systematized collection of ode solvers. In: Stepleman, R.S., et al.

    (eds.) Scientific Computing, IMACS Transactions on Scientific Computation, vol. 1, pp. 5564.North-Holland, Amsterdam (1983), https://computation.llnl.gov/casc/odepack/odepack_home.html

    11. Hunter, J.D.: Matplotlib: A 2d graphics environment. Computing in Science & Engineering 9(3),9095 (2007), http://dx.doi.org/10.1109/MCSE.2007.55

    12. Ibrahim, R.A., Grace, I.M.: Modeling of ship roll dynamics and its coupling with heave andpitch. Mathematical Problems in Engineering 2010, 32 (2010), doi:10.1155/2010/934714

    13. Jones, E., Oliphant, T., Peterson, P., et al.: SciPy: Open source scientific tools for Python (2001), http://www.scipy.org/

    14. Landau, R.H., Fink, Jr, P.J.: A Scientists and Engineers guide to Workstations and Supercom-puters, Coping with UNIX?, RISC, Vectors, and Programming. John Wiley and Sons, New York(1993)

    15. Lutz, M.: Learning Python. OReilly & Associates (2009)16. Martin, W.A., Fateman, R.J.: The MACSYMA system. In: SYMSAC 71: Proceedings of the

    second ACM symposium on Symbolic and algebraic manipulation. pp. 5975. ACM, New York,NY, USA (1971)

    17. Maxima.sourceforge.net: Maxima, a computer algebra system (2010)18. Oliphant, T.E.: Guide to NumPy. Trelgol Publishing, USA. (2006), http://numpy.scipy.org19. Oliphant, T.E.: Python for scientific computing. Computing in Science & Engineering 9(3), 1020

    (May/June 2007)20. Parker, T.S., Chua, L.O.: Practical Numerical Algorithms for Chaotic Systems. Springer-Verlag

    New York, Inc. (1989)21. Ross, P.W. (ed.): The Handbook of Software for Engineers and Scientists. CRC Press, Inc. (1996)22. Swarztrauber, P.: Vectorizing the ffts. In: Rodrigue, G. (ed.) Parallel Computations, pp. 5183.

    Academic Press (1982)23. Szemplinska-Stupnicka, W.: Secondary resonances and approximate models of routes to chaotic

    motion in nonlinear oscillators. Journal of Sound and Vibration 113(1), 155172 (1987),

    http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6WM3-4XB9K8J-H&_user=10&_coverDate=02%2F22%2F1987&_rdoc=1&_fmt=high&_orig=search&_sort=d&_docanchor=

    &view=c&_searchStrId=1388541812&_rerunOrigin=google&_acct=C000050221&_version=

    1&_urlVersion=0&_userid=10&md5=aa96ba7cc45aeea50c9b02ba8a2248fe, doi:10.1016/S0022-460X(87)81348-2

    24. Szemplinska-Stupnicka, W., Bajkowski, J.: The

    -subharmonic resonance and its transition tochaotic motion in a nonlinear oscillator. Int. J. Nonlinear Mechanics 25(5), 401419 (1986)

    25. http://en.wikipedia.org/wiki/Maxima_(software) (2010)

    Proceedings of the 6th IMT-GT Conference on Mathematics, Statistics and its Applications (ICMSA2010)

    Universiti Tunku Abdul Rahman, Kuala Lumpur, Malaysia 851