Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Empirical Ground Motion Prediction Method for small earthquakes - Julian Bommer etal 2019.pdf
- DROP FUNCTION IF EXISTS lookup.PGV_v4emp_2019_in_mmps(numeric,numeric,numeric,numeric) CASCADE;
- CREATE OR REPLACE FUNCTION lookup.PGV_v4emp_2019_in_mmps(magnitude numeric, diepte_km numeric, hor_afstand_km numeric, N numeric) RETURNS numeric
- AS $$
- DECLARE
- sigma CONSTANT numeric := 0.5777;
- c1 CONSTANT numeric := -5.0006; --Table 3.1; column PGVMaxRot, row C₁ [UPDATED 2019]
- c2 CONSTANT numeric := 2.2770; --Table 3.1; column PGVMaxRot, row C1₂ [UPDATED 2019]
- c4 CONSTANT numeric := -1.9446; --Table 3.1; column PGVMaxRot, row C1₃ [UPDATED 2019]
- c4a CONSTANT numeric := -1.2077; --Table 3.1; column PGVMaxRot, row C1₄ᵃ [UPDATED 2019]
- c4b CONSTANT numeric := -1.6533; --Table 3.1; column PGVMaxRot, row C1₄ᵇ [UPDATED 2019]
- Repi numeric; --
- R numeric; --
- g_R numeric; --
- ln_PGV numeric; --In cm/s
- BEGIN
- Repi := hor_afstand_km; -- Formula takes distance between epi-centre and address, NOT hypo-centre
- R := sqrt( Repi^2 + exp(0.4233*magnitude - 0.6083)^2 ); --(3.2)
- CASE
- WHEN R <= 6.32 THEN --(3.3a)
- g_R := c4*ln(R); --(3.3a)
- WHEN R <= 11.62 THEN --(3.3a)+(3.3b)
- g_R := c4*ln(6.32) + c4a*ln(R/6.32); --(3.3a)+(3.3b)
- ELSE --(3.3a)+(3.3b)+(3.3c)
- g_R := c4*ln(6.32) + c4a*ln(11.62/6.32) + c4b*ln(R/11.62); --(3.3a)+(3.3b)+(3.3c)
- END CASE;
- ln_PGV := c1 + c2*magnitude + g_R + sigma*N; --(3.1)
- RETURN exp(ln_PGV)*10; -- Converteren naar PGV in mm/s
- END
- $$
- LANGUAGE plpgsql
- IMMUTABLE
- RETURNS NULL ON NULL INPUT
- ;
Advertisement
Add Comment
Please, Sign In to add comment