Multi-Scale Simulation

Continuous cascade

In the previous lecture we discuss and practice the discrete in scale models constructed by iteratively dividing large structures (eddies) into disjoint daughter sub-eddies each reduced in scale by an integer ratio . These cascade have significant limitations, the fact that such cascade are developed only on a countable set of scales (hence the name discrete cascades). We have seen that this limitation can be supported using the continuous cascade. During this exercise we will simulate a continuous multifractal field with different sets of UM parameters.

Question

  • Write a main code which calls the following function in order to generate a multifractal field with and .

  • Play with different values of the UM parameter to generate different field and comment the obtained result.

1
// Generate a Levy variable
2
function [L] = Levy(alpha, lambda)
3
    L = zeros(1,lambda);
4
    
5
    for i = 1:lambda
6
        U = rand();
7
        W = exp(-U);
8
        a = - %pi/2; b = %pi/2;
9
        Phi = a + (b-a).*rand();
10
        Phi0 = -(%pi/2)*(1-abs(1-alpha))/alpha;
11
        L(i) = sign(alpha-1)*sin(alpha*(Phi-Phi0))*cos(Phi)^(-(1/alpha))*(cos(Phi-alpha*(Phi-Phi0))/W)^((1-alpha)/alpha);
12
    end
13
    
14
endfunction
1
function [Y]= ColorFunc(L, lambda, alpha)
2
    
3
    ap = (alpha/(alpha-1));
4
    // FFT
5
    X = fft(L);
6
    N = lambda/2 + 1;
7
    n = 1:N;
8
    X(1:N) = X(1:N).*(n.^(-1/ap));
9
    X(N+1:lambda) = real(X(lambda/2:-1:2)) -%i*imag(X(lambda/2:-1:2));
10
    Y = ifft(X);
11
    Y = real(Y(1,1:lambda));
12
    
13
endfunction
1
// Continuous simulated field
2
function [Sim]=Continuous(alpha,C1,lambda)
3
    
4
    l = Levy(alpha, lambda);
5
    L = l.*((C1/(alpha-1))^(1/alpha)); 
6
    
7
    Gamma = ColorFunc(L,lambda,alpha);
8
    Generator = exp(Gamma);
9
    Sim =  Generator./(lambda^(C1/(alpha-1)));
10
    
11
    
12
endfunction
Solution
1
clear;
2
clc;
3
4
exec("Levy.sce");
5
exec("FracIntegration.sce");
6
exec("ColorFunc.sce");
7
exec("Continuous.sce");
8
9
10
// Universal multifractal parameters
11
alpha = 1.7;
12
C1 = 0.5;
13
lambda = 2^12;
14
15
// Continuous simulation
16
Sim = Continuous(alpha,C1,lambda);
Continuous simulation of a conservative field
PreviousPreviousNextNext
HomepageHomepagePrintPrintCreated with Scenari (new window)