Changeset 8157


Ignore:
Timestamp:
Mar 20, 2011, 9:42:55 AM (13 years ago)
Author:
steve
Message:

Found annoying bug x(3/2) should be x(1.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_validation/validation_tests/dam_break_analytical.py

    r8156 r8157  
    2929    Taken from formula (3.14) from Zoppou and Roberts SWW notes
    3030    """
    31     x = h2/h1
     31   
     32    h21 = h2/h1
    3233    h01 = h0/h1
    3334   
    34     return x**3 -9.0*(x**2)*h01 +16.0*(x**(3/2))*h01 -x*h01*(h01+8.0) +h01**3
     35    return h21**3 -9.0*(h21**2)*h01 +16.0*(h21**(1.5))*h01 -h21*h01*(h01+8.0) +h01**3
    3536
    3637
    3738h0 = 1.0
    38 h1 = 10.0
     39h1 = 2.0
     40
     41h21 = 1.0
     42h01 = 0.5
     43
     44print h21**3 - 9.0*(h21**2)*h01 + 16.0*(h21**(1.5))*h01 - h21*h01*(h01+8.0) + h01**3
     45
     46h21 = 0.5
     47h01 = 0.5
     48
     49print  - 8.0*h21**3 + 16.0*h21**(2.5) -8*h21**2
     50
    3951
    4052n = 10
     
    5466print wu(h0), wu(h1)
    5567
    56 #from scipy.optimize import brentq
     68from scipy.optimize import brentq
    5769
    58 #h2 = brentq(wu, h0,h1,disp=True)
     70h2 = brentq(wu, h0,h1,disp=True)
    5971
    6072#print  h2, wu(h2)
Note: See TracChangeset for help on using the changeset viewer.