Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi
When I simulated a Kelvin Shipe Wake[^] I had a need of plotting the result.

And I wanted something like the picture below:
https://skydrive.live.com/?cid=31C12AA3E3EE0DCB&id=31C12AA3E3EE0DCB!505[^]

The code I used was (on each rectangle):
VB
Public Function ColorGradient(ByVal Value As Single) As Brush
    Dim val As Single
    Dim bt As Byte

    Val = 1 - Math.Abs(Value) * 10 / 3
    If Val() > 1 Then Val = 1
    If Val() < 0 Then Val = 0
    bt = Val() * 255

    If Value > 0 Then
        'Red color
        Return New SolidColorBrush(Color.FromRgb(255, bt, bt))
    ElseIf Value < 0 Then
        'Blue color
        Return New SolidColorBrush(Color.FromRgb(bt, bt, 255))
    Else
        'White color
        Return New SolidColorBrush(Colors.White)
    End If
End Function



What are these kind of plots called? If I dont know the name I dont know what to search for...
(and possibly Do you know any articles that performs better versions than my crude example?)

Edit:
The Kelvin Wake code looks like this:
VB
Private Function MidPointKelvin(ByVal x As Double, ByVal y As Double)
    Dim m As Double = 80
    Dim h As Double = Math.PI / (2 * m)
    Dim p As Double = 0.001
    Dim pheda, t1, t2, sum, g1, gp1, cg1, sg1, sgp1 As Double
    sum = 0
    For i As Integer = 1 To m
        pheda = -(Math.PI / 2) + (2 * i - 1) * h
        g1 = g0(x, y, pheda)
        gp1 = gp(x, y, pheda)
        cg1 = Math.Sin(gp1 * h)
        sg1 = Math.Sin(g1)
        sgp1 = Math.Sin(gp1 * h)
        t1 = p * 2 * h * cg1
        t2 = 2 * gp1 * cg1 * sgp1
        sum = sum + (t1 + t2) / (p + gp1 ^ 2)
    Next
    Return sum
End Function

Private Function g0(ByVal x As Double, ByVal y As Double, ByVal p As Double) As Double
    Return (x - y * Math.Tan(p)) / Math.Cos(p)
End Function

Private Function gp(ByVal x As Double, ByVal y As Double, ByVal p As Double) As Double
    Return -(1 / Math.Cos(p)) ^ 3 + (1 / Math.Cos(p)) * Math.Tan(p) * (x - y * Math.Tan(p))
End Function


And it is a direct copy from :
http://demonstrations.wolfram.com/KelvinShipWavePattern/[^]
(Click preview to see the code)
Posted
Updated 4-Apr-13 5:06am
v2
Comments
Sergey Alexandrovich Kryukov 4-Apr-13 9:41am    
Kenneth, you did not explain the purpose of your search. What to you want to achieve, why?
Plot is plot, everything can be plotted in many ways, so, what's the problem?
—SA
Kenneth Haugland 4-Apr-13 10:28am    
Like this one:
http://www.phy.bris.ac.uk/people/berry_mv/pictures/ship1.jpg
or this:
http://dlmf.nist.gov/36.13
They olmost seems like a 3D plot but not.
or here:
http://demonstrations.wolfram.com/KelvinShipWavePattern/
I guess the color grading is more the question.

1 solution

Maybe this is optical illusion (probably not, see below), but it looks like outer counters of a big pictures are curved, which would not fit a physical model which is described by the Mach cone.

Please see:
http://en.wikipedia.org/wiki/Cherenkov_radiation[^].

Yes, the mathematics of the wave from a boat is identical to the Cherenkov's radiation; I've referenced this page just because the English Wikipedia page on Mach's cone is presently missing. There is also an animated picture, which I also could not find on related English Wikipedia pages:

http://upload.wikimedia.org/wikipedia/commons/8/87/Cherenkov_radiation-animation.gif[^] (click to see the animation).

Your very first image you referenced as https://skydrive.live.com/?cid=31C12AA3E3EE0DCB&id=31C12AA3E3EE0DCB!505[^] certainly does not fit the physical model. If you really want to depict the wave from a boat, you the use of the wave picture you show would not be correct.

If you model something else, please explain.

—SA
 
Share this answer
 
v3
Comments
Kenneth Haugland 4-Apr-13 11:08am    
I think that it has something to do with the resolution of the integration to do. If you cange m=80 to m=500 the shape looks more like the correct values.
Kenneth Haugland 8-Oct-13 0:16am    
After I designed the TLM for acoustic simmulations I finally have managed to implement the Boat wake:
http://www.codeproject.com/Articles/661257/Transmission-Line-Matrix-for-acoustic-simulations

There are some other issues now, I must design a proper Gaussian Pulse source, as it is now it dosnt quite follow the norm when the frequency is adjusted upwards.

So Im marking your solution as the answer :-)
Kenneth Haugland 4-Apr-13 11:14am    
Almost forgot, but I give you a 5 for the information as it was very helpful. However the model is only correct if you have infinitely water depth below. See:
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&ved=0CEcQFjAC&url=http%3A%2F%2Fwww.maths.lth.se%2Fseamocs%2Fmeetings%2FMalta_Posters_and_Talks%2FTomasTorsvikmalta_200309.pdf&ei=m5RdUaKKL8bm4QSh5YB4&usg=AFQjCNGRIfMj7ZJdHLRTPGJmxFc6q57Krg&sig2=2A8FfP1KyXButB9L5o-3BA&bvm=bv.44770516,d.bGE

Apperantly it has something to do with Froude number.
Sergey Alexandrovich Kryukov 8-Oct-13 3:32am    
Wow! Very interesting article.
Thank you very much,
-SA
Sergey Alexandrovich Kryukov 4-Apr-13 11:38am    
Thank you, Kenneth.

As to your previous comment, the scale is irrelevant; is something is close to a right picture is a special case, it does not mean that the general is correct.

Now, it's hard to judge on the shallow-water wave model (and thank you for referencing this article; it's very interesting). I know very well that the shallow-water gives the strongly non-linear model for waves (in contrast to linear "gravitational wave" on the surface of water (not to be mixed up with the waves of gravitation field :-)), which is very hard to analyze and solve, especially in general cases.

Ever heard of solitons (actually, in a more complex environment, as a channel, but nevertheless)? If not, read about them, to be really amazed:

http://en.wikipedia.org/wiki/Soliton

Cheers,
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900