RCJuridisch

25. Broncode trillingstool Archipunt.sql.txt

Apr 23rd, 2024 (edited)
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | Housing | 0 0
  1. -- Empirical Ground Motion Prediction Method for small earthquakes - Julian Bommer etal 2019.pdf
  2.  
  3. DROP FUNCTION IF EXISTS lookup.PGV_v4emp_2019_in_mmps(numeric,numeric,numeric,numeric) CASCADE;
  4. CREATE OR REPLACE FUNCTION lookup.PGV_v4emp_2019_in_mmps(magnitude numeric, diepte_km numeric, hor_afstand_km numeric, N numeric) RETURNS numeric
  5. AS $$
  6. DECLARE
  7. sigma CONSTANT numeric := 0.5777;
  8. c1 CONSTANT numeric := -5.0006; --Table 3.1; column PGVMaxRot, row C₁ [UPDATED 2019]
  9. c2 CONSTANT numeric := 2.2770; --Table 3.1; column PGVMaxRot, row C1₂ [UPDATED 2019]
  10. c4 CONSTANT numeric := -1.9446; --Table 3.1; column PGVMaxRot, row C1₃ [UPDATED 2019]
  11. c4a CONSTANT numeric := -1.2077; --Table 3.1; column PGVMaxRot, row C1₄ᵃ [UPDATED 2019]
  12. c4b CONSTANT numeric := -1.6533; --Table 3.1; column PGVMaxRot, row C1₄ᵇ [UPDATED 2019]
  13. Repi numeric; --
  14. R numeric; --
  15. g_R numeric; --
  16. ln_PGV numeric; --In cm/s
  17. BEGIN
  18. Repi := hor_afstand_km; -- Formula takes distance between epi-centre and address, NOT hypo-centre
  19. R := sqrt( Repi^2 + exp(0.4233*magnitude - 0.6083)^2 ); --(3.2)
  20. CASE
  21. WHEN R <= 6.32 THEN --(3.3a)
  22. g_R := c4*ln(R); --(3.3a)
  23. WHEN R <= 11.62 THEN --(3.3a)+(3.3b)
  24. g_R := c4*ln(6.32) + c4a*ln(R/6.32); --(3.3a)+(3.3b)
  25. ELSE --(3.3a)+(3.3b)+(3.3c)
  26. g_R := c4*ln(6.32) + c4a*ln(11.62/6.32) + c4b*ln(R/11.62); --(3.3a)+(3.3b)+(3.3c)
  27. END CASE;
  28. ln_PGV := c1 + c2*magnitude + g_R + sigma*N; --(3.1)
  29. RETURN exp(ln_PGV)*10; -- Converteren naar PGV in mm/s
  30. END
  31. $$
  32. LANGUAGE plpgsql
  33. IMMUTABLE
  34. RETURNS NULL ON NULL INPUT
  35. ;
  36.  
Advertisement
Add Comment
Please, Sign In to add comment