red = Mod.reduced(A, E, Qs) import random import math def Gs(i, j): return lambda: random.gauss(Qs[0][i, j], math.sqrt(Qs[1][i, j])) import Pymatr.synthesis as Syn from Pymatr.utils import numerical L = red.dEigen nsyn = 100 Gen = Syn.MatrixRngOpt(numerical(A), numerical(E / L), Gs, nsyn) def average(): s = sum(Gen()) av = s / nsyn # print(" \n sum {}, average: {}\n".format(r, av) ) return av lln = red.lln() import Pymatr.byPieces as Bp Bp.plot(lln) import Pymatr.histogram as H nsample = 1000
def GsLLN(i, j): return lambda: random.gauss(Qs[0][i, j], 1) def GsCLT(i, j): return lambda: random.gauss(0, math.sqrt(Qs[1][i, j])) import Pymatr.synthesis as Syn nsyn = 500 nhist = 1000 from Pymatr.utils import numerical E0n = numerical(E0) A0n = numerical(A0) GenLLN = Syn.MatrixRngOpt(A0n, E0n, GsLLN, nsyn) GenCLT = Syn.MatrixRngOpt(A0n, E0n, GsCLT, nsyn) __latex__(r'''% \begin{equation} \mEx = ''') __pynclusion__(pr.mat(E0, spacing="0.1cm")) __latex__(r''', \quad \mAx_{i,j} = 1 \end{equation} \section{Strongly connected classes $\Xi_i$} The first step is to identify the irreducible classes (called strongly connected components in graph theory) of $\mE$. In order to do so, an interesting method is to compute a connectivity matrix $\Conn$ \begin{equation}
import Pymatr.model as Mod red= Mod.reduced(A,E, Qs ) import random import math def Gs(i,j): return lambda : random.gauss( Qs[0][i,j], math.sqrt(Qs[1][i,j]) ) import Pymatr.synthesis as Syn from Pymatr.utils import numerical L= red.dEigen nsyn=100 Gen = Syn.MatrixRngOpt(numerical(A),numerical(E/L), Gs, nsyn) def average(): s= sum(Gen()) av= s /nsyn # print(" \n sum {}, average: {}\n".format(r, av) ) return av lln=red.lln() import Pymatr.byPieces as Bp Bp.plot(lln) import Pymatr.histogram as H nsample=1000 H.plot(nsample, average)
def GsLLN(i,j): return lambda : random.gauss( Qs[0][i,j] , 1 ) def GsCLT(i,j): return lambda : random.gauss( 0, math.sqrt(Qs[1][i,j]) ) import Pymatr.synthesis as Syn nsyn = 500 nhist=1000 from Pymatr.utils import numerical E0n= numerical(E0) A0n= numerical(A0) GenLLN = Syn.MatrixRngOpt(A0n, E0n, GsLLN, nsyn) GenCLT = Syn.MatrixRngOpt(A0n, E0n, GsCLT, nsyn) __latex__(r'''% \begin{equation} \mEx = ''') __pynclusion__(pr.mat(E0,spacing="0.1cm")) __latex__(r''', \quad \mAx_{i,j} = 1 \end{equation} \section{Strongly connected classes $\Xi_i$} The first step is to identify the irreducible classes (called strongly connected components in graph theory) of $\mE$. In order to do so, an interesting method is to compute a connectivity matrix $\Conn$ \begin{equation}