JFM-Notebooks / Experimental_Dataset / with_flow / wavemaker_program / 3rd_order_straight_solitary_wave.ipynb
3482 views unlisted
ubuntu2204Kernel: Python 3 (ipykernel)
In [1]:
In [2]:
Define some constant values
- gravity (determines units)
- still water depth
- target wave amplitude
P997 - timestep between paddle moves in ms (typically 20)
In [3]:
Out[3]:
80 24
Define functions for solitary wave form (3rd order following Grimshaw)
starting from physical quantites (denoted with tilde), we can define some useful paramaters: and where the subscript naught indicates a constant value. Then, for convienence, we define:
and take and as some spatial and temporal offset, if needed, to write
then finally retrieve the free surface elevation
and the depth averaged flow velocity
In [4]:
Determine the total time for the paddle movement
also determine offset the arrival time of the soliton so that the paddle velocity is initially zero
In [5]:
Check the wave form
In [6]:
Out[6]:
Text(0.5, 1.0, 'shape of solitary flow velocity at $x=0$')
Prepare subroutine for integrating paddle motion
In [7]:
Integrate paddle motion
In [8]:
Check the paddle motion
In [9]:
Out[9]:
Text(0.5, 1.0, 'paddle velocity vs paddle position')
Check some paddle motion properties
In [10]:
Out[10]:
the total paddle stroke is: 109.73896415028867 mm
the max paddle velocity is: 232.63514676409073 mm/s
the initial paddle velocity is: 0.0031260970988302907 mm/s
the final paddle velocity is: 0.009610118265296796 mm/s
In [11]:
Finally, write out the motion control programs
the motion control program for paddles 1 through 8
In [12]:
the motion control program for paddles 9 through 16
In [13]:
Verify file output
In [14]:
Out[14]:
; WAVE TYPE - 3rd Order Solitary Wave
; GRAVITATION CONSTANT - 9810
; WATER DEPTH - 80
; TARGET AMPLITUDE - 24
; FILE A
; GENERATION DATE - Jul-31-2023
;
CLOSE
DELETE GATHER
DELETE TRACE
; M7024 = 1 turns off the TTL from output 1
M7024=1
; assign motors and scaling to coordinate system
&1 A
; in this case, all motors have the same motion, assign all to X
; to prevent motor motion, simply comment out the assigment
; 1 inch is 50,000 counts therefore 1mm is 1968.50393700787 counts
; the units of X,Y,Z,U,V,W,A,B depend on the scaling defined here
#1->1968.503937X
#2->1968.503937X
#3->1968.503937X
#4->1968.503937X
#5->1968.503937X
#6->1968.503937X
#7->1968.503937X
#8->1968.503937X
; redefine motion program 2
OPEN PROG 2 CLEAR
P997=10
HOMEZ1..8
ABS
LINEAR
TS0
TA1000
TM5000
DWELL5000
PVT(P997)
; M7024=0 will turn on the TTL signal from output 1
M7024=0
; define motion like X(position):(velocity)
X(0.000000):(0.003126)
X(0.000033):(0.003466)
X(0.000070):(0.003844)
X(0.000111):(0.004263)
X(0.000156):(0.004728)
X(0.000207):(0.005243)
X(0.000262):(0.005815)
X(0.000324):(0.006449)
X(0.000393):(0.007153)
X(0.000469):(0.007933)
X(0.000553):(0.008798)
X(0.000647):(0.009758)
X(0.000750):(0.010822)
X(0.000866):(0.012002)
X(0.000993):(0.013311)
X(0.001135):(0.014763)
X(0.001292):(0.016373)
X(0.001466):(0.018158)
X(0.001659):(0.020139)
X(0.001873):(0.022335)
X(0.002111):(0.024771)
X(0.002374):(0.027472)
X(0.002666):(0.030468)
X(0.002990):(0.033791)
X(0.003349):(0.037476)
X(0.003748):(0.041563)
X(0.004190):(0.046095)
X(0.004680):(0.051122)
X(0.005224):(0.056696)
X(0.005826):(0.062878)
X(0.006495):(0.069735)
X(0.007237):(0.077338)
X(0.008059):(0.085771)
X(0.008971):(0.095122)
X(0.009983):(0.105493)
X(0.011104):(0.116993)
X(0.012348):(0.129747)
X(0.013728):(0.143891)
X(0.015258):(0.159575)
X(0.016955):(0.176968)
X(0.018837):(0.196256)
X(0.020923):(0.217644)
X(0.023238):(0.241360)
X(0.025804):(0.267659)
X(0.028650):(0.296819)
X(0.031806):(0.329153)
X(0.035306):(0.365004)
X(0.039187):(0.404754)
X(0.043491):(0.448826)
X(0.048263):(0.497688)
X(0.053555):(0.551858)
X(0.059422):(0.611911)
X(0.065928):(0.678482)
X(0.073142):(0.752276)
X(0.081141):(0.834070)
X(0.090008):(0.924728)
X(0.099840):(1.025202)
X(0.110739):(1.136547)
X(0.122822):(1.259927)
X(0.136216):(1.396633)
X(0.151064):(1.548085)
X(0.167520):(1.715857)
X(0.185760):(1.901682)
X(0.205974):(2.107474)
X(0.228375):(2.335342)
X(0.253197):(2.587611)
X(0.280698):(2.866841)
X(0.311166):(3.175845)
X(0.344916):(3.517720)
X(0.382296):(3.895863)
X(0.423691):(4.314002)
X(0.469526):(4.776221)
X(0.520266):(5.286988)
X(0.576428):(5.851185)
X(0.638575):(6.474135)
X(0.707331):(7.161635)
X(0.783378):(7.919982)
X(0.867465):(8.756004)
X(0.960413):(9.677080)
X(1.063120):(10.691172)
X(1.176568):(11.806833)
X(1.301827):(13.033227)
X(1.440065):(14.380130)
X(1.592550):(15.857930)
X(1.760657):(17.477604)
X(1.945877):(19.250696)
X(2.149819):(21.189263)
X(2.374217):(23.305814)
X(2.620931):(25.613221)
X(2.891955):(28.124606)
X(3.189414):(30.853202)
X(3.515569):(33.812185)
X(3.872811):(37.014474)
X(4.263660):(40.472501)
X(4.690757):(44.197950)
X(5.156858):(48.201461)
X(5.664818):(52.492314)
X(6.217580):(57.078078)
X(6.818150):(61.964248)
X(7.469582):(67.153865)
X(8.174943):(72.647128)
X(8.937287):(78.441009)
X(9.759622):(84.528879)
X(10.644868):(90.900157)
X(11.595818):(97.539994)
X(12.615090):(104.429003)
X(13.705087):(111.543052)
X(14.867941):(118.853139)
X(16.105467):(126.325357)
X(17.419116):(133.920968)
X(18.809921):(141.596601)
X(20.278458):(149.304587)
X(21.824800):(156.993418)
X(23.448485):(164.608359)
X(25.148484):(172.092169)
X(26.923180):(179.385934)
X(28.770359):(186.429976)
X(30.687203):(193.164813)
X(32.670296):(199.532121)
X(34.715647):(205.475676)
X(36.818708):(210.942240)
X(38.974413):(215.882357)
X(41.177216):(220.251055)
X(43.421145):(224.008429)
X(45.699849):(227.120121)
X(48.006659):(229.557688)
X(50.334652):(231.298876)
X(52.676710):(232.327815)
X(55.025585):(232.635147)
X(57.373971):(232.218089)
X(59.714562):(231.080459)
X(62.040127):(229.232642)
X(64.343571):(226.691515)
X(66.617999):(223.480308)
X(68.856784):(219.628399)
X(71.053624):(215.171024)
X(73.202601):(210.148891)
X(75.298231):(204.607686)
X(77.335518):(198.597473)
X(79.309986):(192.171975)
X(81.217719):(185.387766)
X(83.055383):(178.303376)
X(84.820242):(170.978346)
X(86.510159):(163.472262)
X(88.123599):(155.843809)
X(89.659610):(148.149867)
X(91.117802):(140.444700)
X(92.498317):(132.779242)
X(93.801795):(125.200522)
X(95.029327):(117.751214)
X(96.182412):(110.469323)
X(97.262912):(103.388015)
X(98.272997):(96.535551)
X(99.215099):(89.935339)
X(100.091862):(83.606072)
X(100.906099):(77.561948)
X(101.660742):(71.812942)
X(102.358806):(66.365128)
X(103.003348):(61.221037)
X(103.597437):(56.380032)
X(104.144120):(51.838689)
X(104.646395):(47.591191)
X(105.107194):(43.629699)
X(105.529360):(39.944719)
X(105.915633):(36.525443)
X(106.268640):(33.360066)
X(106.590883):(30.436074)
X(106.884737):(27.740502)
X(107.152443):(25.260159)
X(107.396110):(22.981822)
X(107.617713):(20.892403)
X(107.819096):(18.979080)
X(108.001977):(17.229409)
X(108.167947):(15.631408)
X(108.318482):(14.173615)
X(108.454944):(12.845141)
X(108.578586):(11.635690)
X(108.690563):(10.535577)
X(108.791933):(9.535729)
X(108.883667):(8.627682)
X(108.966652):(7.803564)
X(109.041700):(7.056077)
X(109.109550):(6.378475)
X(109.170877):(5.764537)
X(109.226294):(5.208537)
X(109.276362):(4.705220)
X(109.321588):(4.249766)
X(109.362432):(3.837766)
X(109.399315):(3.465191)
X(109.432614):(3.128364)
X(109.462675):(2.823932)
X(109.489808):(2.548843)
X(109.514298):(2.300322)
X(109.536399):(2.075845)
X(109.556342):(1.873121)
X(109.574337):(1.690070)
X(109.590573):(1.524806)
X(109.605220):(1.375619)
X(109.618435):(1.240961)
X(109.630355):(1.119430)
X(109.641108):(1.009757)
X(109.650807):(0.910791)
X(109.659556):(0.821496)
X(109.667446):(0.740931)
X(109.674563):(0.668248)
X(109.680981):(0.602678)
X(109.686770):(0.543530)
X(109.691990):(0.490176)
X(109.696698):(0.442050)
X(109.700944):(0.398643)
X(109.704772):(0.359492)
X(109.708225):(0.324182)
X(109.711339):(0.292336)
X(109.714146):(0.263615)
X(109.716678):(0.237714)
X(109.718961):(0.214355)
X(109.721020):(0.193290)
X(109.722876):(0.174294)
X(109.724550):(0.157164)
X(109.726059):(0.141716)
X(109.727421):(0.127786)
X(109.728648):(0.115225)
X(109.729754):(0.103898)
X(109.730752):(0.093684)
X(109.731652):(0.084474)
X(109.732463):(0.076169)
X(109.733195):(0.068680)
X(109.733854):(0.061928)
X(109.734449):(0.055839)
X(109.734985):(0.050349)
X(109.735469):(0.045398)
X(109.735905):(0.040934)
X(109.736298):(0.036909)
X(109.736652):(0.033280)
X(109.736972):(0.030008)
X(109.737260):(0.027057)
X(109.737520):(0.024396)
X(109.737754):(0.021997)
X(109.737966):(0.019834)
X(109.738156):(0.017884)
X(109.738328):(0.016125)
X(109.738483):(0.014540)
X(109.738622):(0.013110)
X(109.738748):(0.011821)
X(109.738862):(0.010658)
X(109.738964):(0.009610)
DWELL15000 ; dwell time in ms
; M7024 = 1 turns off the TTL from output 1
M7024=1
LINEAR
TA100
TS0
TM1000
; Comment below to prevent paddles moving back to zero after dwelling
X0
CLOSE
CLOSE
In [15]:
Out[15]:
; WAVE TYPE - 3rd Order Solitary Wave
; GRAVITATION CONSTANT - 9810
; WATER DEPTH - 80
; TARGET AMPLITUDE - 24
; FILE B
; GENERATION DATE - Jul-31-2023
;
CLOSE
DELETE GATHER
DELETE TRACE
; assign motors and scaling to coordinate system
&2 A
; in this case, all motors have the same motion, assign all to X
; to prevent motor motion, simply comment out the assigment
; 1 inch is 50,000 counts therefore 1mm is 1968.50393700787 counts
; the units of X,Y,Z,U,V,W,A,B depend on the scaling defined here
#9->1968.503937X
#10->1968.503937X
#11->1968.503937X
#12->1968.503937X
#13->1968.503937X
#14->1968.503937X
#15->1968.503937X
#16->1968.503937X
; redefine motion program 3
OPEN PROG 3 CLEAR
P997=10
HOMEZ9..16
ABS
LINEAR
TS0
TA1000
TM5000
DWELL5000
PVT(P997)
; define motion like X(position):(velocity)
X(0.000000):(0.003126)
X(0.000033):(0.003466)
X(0.000070):(0.003844)
X(0.000111):(0.004263)
X(0.000156):(0.004728)
X(0.000207):(0.005243)
X(0.000262):(0.005815)
X(0.000324):(0.006449)
X(0.000393):(0.007153)
X(0.000469):(0.007933)
X(0.000553):(0.008798)
X(0.000647):(0.009758)
X(0.000750):(0.010822)
X(0.000866):(0.012002)
X(0.000993):(0.013311)
X(0.001135):(0.014763)
X(0.001292):(0.016373)
X(0.001466):(0.018158)
X(0.001659):(0.020139)
X(0.001873):(0.022335)
X(0.002111):(0.024771)
X(0.002374):(0.027472)
X(0.002666):(0.030468)
X(0.002990):(0.033791)
X(0.003349):(0.037476)
X(0.003748):(0.041563)
X(0.004190):(0.046095)
X(0.004680):(0.051122)
X(0.005224):(0.056696)
X(0.005826):(0.062878)
X(0.006495):(0.069735)
X(0.007237):(0.077338)
X(0.008059):(0.085771)
X(0.008971):(0.095122)
X(0.009983):(0.105493)
X(0.011104):(0.116993)
X(0.012348):(0.129747)
X(0.013728):(0.143891)
X(0.015258):(0.159575)
X(0.016955):(0.176968)
X(0.018837):(0.196256)
X(0.020923):(0.217644)
X(0.023238):(0.241360)
X(0.025804):(0.267659)
X(0.028650):(0.296819)
X(0.031806):(0.329153)
X(0.035306):(0.365004)
X(0.039187):(0.404754)
X(0.043491):(0.448826)
X(0.048263):(0.497688)
X(0.053555):(0.551858)
X(0.059422):(0.611911)
X(0.065928):(0.678482)
X(0.073142):(0.752276)
X(0.081141):(0.834070)
X(0.090008):(0.924728)
X(0.099840):(1.025202)
X(0.110739):(1.136547)
X(0.122822):(1.259927)
X(0.136216):(1.396633)
X(0.151064):(1.548085)
X(0.167520):(1.715857)
X(0.185760):(1.901682)
X(0.205974):(2.107474)
X(0.228375):(2.335342)
X(0.253197):(2.587611)
X(0.280698):(2.866841)
X(0.311166):(3.175845)
X(0.344916):(3.517720)
X(0.382296):(3.895863)
X(0.423691):(4.314002)
X(0.469526):(4.776221)
X(0.520266):(5.286988)
X(0.576428):(5.851185)
X(0.638575):(6.474135)
X(0.707331):(7.161635)
X(0.783378):(7.919982)
X(0.867465):(8.756004)
X(0.960413):(9.677080)
X(1.063120):(10.691172)
X(1.176568):(11.806833)
X(1.301827):(13.033227)
X(1.440065):(14.380130)
X(1.592550):(15.857930)
X(1.760657):(17.477604)
X(1.945877):(19.250696)
X(2.149819):(21.189263)
X(2.374217):(23.305814)
X(2.620931):(25.613221)
X(2.891955):(28.124606)
X(3.189414):(30.853202)
X(3.515569):(33.812185)
X(3.872811):(37.014474)
X(4.263660):(40.472501)
X(4.690757):(44.197950)
X(5.156858):(48.201461)
X(5.664818):(52.492314)
X(6.217580):(57.078078)
X(6.818150):(61.964248)
X(7.469582):(67.153865)
X(8.174943):(72.647128)
X(8.937287):(78.441009)
X(9.759622):(84.528879)
X(10.644868):(90.900157)
X(11.595818):(97.539994)
X(12.615090):(104.429003)
X(13.705087):(111.543052)
X(14.867941):(118.853139)
X(16.105467):(126.325357)
X(17.419116):(133.920968)
X(18.809921):(141.596601)
X(20.278458):(149.304587)
X(21.824800):(156.993418)
X(23.448485):(164.608359)
X(25.148484):(172.092169)
X(26.923180):(179.385934)
X(28.770359):(186.429976)
X(30.687203):(193.164813)
X(32.670296):(199.532121)
X(34.715647):(205.475676)
X(36.818708):(210.942240)
X(38.974413):(215.882357)
X(41.177216):(220.251055)
X(43.421145):(224.008429)
X(45.699849):(227.120121)
X(48.006659):(229.557688)
X(50.334652):(231.298876)
X(52.676710):(232.327815)
X(55.025585):(232.635147)
X(57.373971):(232.218089)
X(59.714562):(231.080459)
X(62.040127):(229.232642)
X(64.343571):(226.691515)
X(66.617999):(223.480308)
X(68.856784):(219.628399)
X(71.053624):(215.171024)
X(73.202601):(210.148891)
X(75.298231):(204.607686)
X(77.335518):(198.597473)
X(79.309986):(192.171975)
X(81.217719):(185.387766)
X(83.055383):(178.303376)
X(84.820242):(170.978346)
X(86.510159):(163.472262)
X(88.123599):(155.843809)
X(89.659610):(148.149867)
X(91.117802):(140.444700)
X(92.498317):(132.779242)
X(93.801795):(125.200522)
X(95.029327):(117.751214)
X(96.182412):(110.469323)
X(97.262912):(103.388015)
X(98.272997):(96.535551)
X(99.215099):(89.935339)
X(100.091862):(83.606072)
X(100.906099):(77.561948)
X(101.660742):(71.812942)
X(102.358806):(66.365128)
X(103.003348):(61.221037)
X(103.597437):(56.380032)
X(104.144120):(51.838689)
X(104.646395):(47.591191)
X(105.107194):(43.629699)
X(105.529360):(39.944719)
X(105.915633):(36.525443)
X(106.268640):(33.360066)
X(106.590883):(30.436074)
X(106.884737):(27.740502)
X(107.152443):(25.260159)
X(107.396110):(22.981822)
X(107.617713):(20.892403)
X(107.819096):(18.979080)
X(108.001977):(17.229409)
X(108.167947):(15.631408)
X(108.318482):(14.173615)
X(108.454944):(12.845141)
X(108.578586):(11.635690)
X(108.690563):(10.535577)
X(108.791933):(9.535729)
X(108.883667):(8.627682)
X(108.966652):(7.803564)
X(109.041700):(7.056077)
X(109.109550):(6.378475)
X(109.170877):(5.764537)
X(109.226294):(5.208537)
X(109.276362):(4.705220)
X(109.321588):(4.249766)
X(109.362432):(3.837766)
X(109.399315):(3.465191)
X(109.432614):(3.128364)
X(109.462675):(2.823932)
X(109.489808):(2.548843)
X(109.514298):(2.300322)
X(109.536399):(2.075845)
X(109.556342):(1.873121)
X(109.574337):(1.690070)
X(109.590573):(1.524806)
X(109.605220):(1.375619)
X(109.618435):(1.240961)
X(109.630355):(1.119430)
X(109.641108):(1.009757)
X(109.650807):(0.910791)
X(109.659556):(0.821496)
X(109.667446):(0.740931)
X(109.674563):(0.668248)
X(109.680981):(0.602678)
X(109.686770):(0.543530)
X(109.691990):(0.490176)
X(109.696698):(0.442050)
X(109.700944):(0.398643)
X(109.704772):(0.359492)
X(109.708225):(0.324182)
X(109.711339):(0.292336)
X(109.714146):(0.263615)
X(109.716678):(0.237714)
X(109.718961):(0.214355)
X(109.721020):(0.193290)
X(109.722876):(0.174294)
X(109.724550):(0.157164)
X(109.726059):(0.141716)
X(109.727421):(0.127786)
X(109.728648):(0.115225)
X(109.729754):(0.103898)
X(109.730752):(0.093684)
X(109.731652):(0.084474)
X(109.732463):(0.076169)
X(109.733195):(0.068680)
X(109.733854):(0.061928)
X(109.734449):(0.055839)
X(109.734985):(0.050349)
X(109.735469):(0.045398)
X(109.735905):(0.040934)
X(109.736298):(0.036909)
X(109.736652):(0.033280)
X(109.736972):(0.030008)
X(109.737260):(0.027057)
X(109.737520):(0.024396)
X(109.737754):(0.021997)
X(109.737966):(0.019834)
X(109.738156):(0.017884)
X(109.738328):(0.016125)
X(109.738483):(0.014540)
X(109.738622):(0.013110)
X(109.738748):(0.011821)
X(109.738862):(0.010658)
X(109.738964):(0.009610)
DWELL15000 ; dwell time in ms
LINEAR
TA100
TS0
TM1000
; Comment below to prevent paddles moving back to zero after dwelling
X0
CLOSE
CLOSE