Cascade phenomenology

β-model

As we have seen in lesson Fractals, we can characterizes the occurrence of the rainfall by its fractal dimension Df. The main goal of this exercise is to reproduce the pattern of rainfall occurrence according to some given parameter (co-dimension).

Question

  • 1 - According to cascade principle : determine the possible states after n steps.

  • 2 - Play with different values of C, and interpret the obtained result

  • 3 - For the same value of C run the simulation different times and discuss the obtained field.

  • 4 - Use the given python code to generate different field in 1D/2D.

Solution
  • 1 - After n steps of cascade the state of the field can be expressed as follows:

  • 2 - Decreasing the value of the co-dimension the obtained field is more homogenous (less intermittent), and increasing the value of this yields to a field which is more intermittent (see figures).

  • 3 - For the same value of and running the simulation several times, the obtained field is not the same visually, but the they are similar statistically.

Different steps of β-model cascade obtained for C = 0.2
Different steps of β-model cascade obtained for C = 0.8
1
# -*- coding: utf-8 -*-
2
"""
3
@author: yacine.mezemate
4
"""
5
6
import scipy as sp
7
from scipy.stats import uniform 
8
import matplotlib.pyplot as plt
9
10
11
def BetaModel(Lambda, C, nsteps, dimension):
12
    
13
    if dimension == 1:
14
        
15
        DataInit = sp.ones(1)
16
17
        for t in range(nsteps):
18
            length = sp.power(Lambda,t+1)
19
            DataBuff = sp.ones((length,1))
20
21
            for k in range(0,length):
22
                index = sp.floor((k+2)/Lambda) -1
23
                mu = uniform.rvs()
24
25
                if mu <= sp.power(Lambda,-C):
26
                    DataBuff[k] = DataInit[index]*sp.power(Lambda,C)
27
                else:
28
                    DataBuff[k] = 0
29
            DataInit = DataBuff
30
            
31
    if dimension == 2:
32
        
33
        DataInit = sp.ones((1,1))
34
35
        for t in range (nsteps):
36
            
37
            length = sp.power(Lambda,t+1)
38
            DataBuff = sp.ones((length,length))           
39
            
40
            for k in range(0,length):
41
                for l in range(0,length):
42
                    
43
                    indexI = sp.floor((k+2)/Lambda)-1
44
                    indexJ = sp.floor((l+2)/Lambda)-1
45
                    mu = uniform.rvs()
46
                    
47
                    if mu <= sp.power(Lambda,-C):
48
                        DataBuff[k,l] = DataInit[indexI,indexJ]*sp.power(Lambda,C)
49
                    else:
50
                        
51
                        DataBuff[k,l] = 0         
52
            if t % 2:            
53
                plt.subplot(1,nsteps,t)
54
                plt.imshow(DataBuff,interpolation='nearest',cmap='Greys')
55
                plt.title("Step number:" + str(t))
56
                frame = plt.gca()
57
                frame.axes.get_xaxis().set_ticks([])
58
                frame.axes.get_yaxis().set_ticks([])
59
            plt.show()
60
            
61
            DataInit = DataBuff      
62
            
63
            
64
    return DataInit            
65
###############################################################################
66
    
67
############################# Parameters ######################################
68
Lambda = 2
69
C = 0.8
70
nsteps = 8
71
dimension = 1
72
73
############################# Cascade #########################################        
74
DataSim = BetaModel(Lambda, C, nsteps,2)
75
PreviousPreviousNextNext
HomepageHomepagePrintPrintCreated with Scenari (new window)