Description Usage Public function Author(s) Examples
Base class for the analysis using limit state function method.
1 |
Standard reference class is R6 class
Public function
function | contents | variable(s) |
initialize(name,n,Mu,sigmmaX,dist) | initializes the object | name: name of the subject,n:number of variables, Mu:list of mean values of variables, sigmmaX: list of std. values of variables,dist: list of distribution names(characters) |
GetN() | returns the number of variables | |
DefineG(glim) | difines control class for G-calculation | glim: object of g-definition class which is inheritted class of Lbase |
GetMu() | returns list of mean values of variables | |
GetSigm() \ tab returns list of std. values of variables | ||
GetBeta() | retuns reliability index | |
GetAlpha() | returns the list of differential vector | |
GetPOF() | returns value of probability of failure | |
GetDP() | returns list of DP vector | |
GetConv() | returns number of convergence | |
GetG() | returns g value at the mean vector of the variables | |
SetMu(Xm) | sets mean values of variables from list Xm | Xm:list of mean values of variables |
RF() | searches the design point usein modified Rackwitz-Fiessler algorithm | |
Shinsuke Sakai, Takuyo Kaida
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | # Most simple example
# Definition of G and dGdX
GRS <- R6::R6Class("GRS",
inherit=Lbase,
public=list(
gcalc = function(){
X <- super$GetX()
R <- X[1]
S <- X[2]
g<- R-S
super$SetG(g)
},
dGdXcalc = function(){
X <- super$GetX()
dGdX <- super$GetdGdX()
dGdX[1] <- 1
dGdX[2] <- -1
super$SetdGdX(dGdX)
}
)
)
# Reliability Analysis
Sexample <- R6::R6Class("Sexample",
inherit=LSFM,
public= list(
Calc=function(){
super$DefineG(GRS$new(super$GetN()))
super$RF()
}
)
)
####main###
muX<-c(200,100)
sigmmaX<-c(10,20)
dist <- c("normal", "normal")
exam <- Sexample$new("Sexample",2,muX,sigmmaX,dist)
exam$Calc()
exam$GetPOF()
# correct answer 3.872108e-06
#Example of Lbase must be executed before this example.
# Example
#"Probability, Reliability and Statistical Methods in
# Engineering Design"
# Achintya Haldar & Sankaran Mahadevan
# P.218 Table 7.5, 7.6
GPRSMED <- R6::R6Class("GPRSMED",
inherit=Lbase,
public = list(
gcalc = function(){
X <- super$GetX()
As <- X[1]
fy <- X[2]
fcd <- X[3]
b <- X[4]
d <- X[5]
eta <- X[6]
M <- X[7]
g <- As*fy*d*(1.0-eta*As*fy/b/d/fcd)-M
super$SetG(g)
} ,
dGdXcalc = function(){
X <- super$GetX()
dGdX <- super$GetdGdX()
As <- X[1]
fy <- X[2]
fcd <- X[3]
b <- X[4]
d <- X[5]
eta <- X[6]
M <- X[7]
dd<-expression(As*fy*d*(1.0-eta*As*fy/b/d/fcd)-M)
dGdX[1] <- eval(D(dd,"As"))
dGdX[2] <- eval(D(dd,"fy"))
dGdX[3] <- eval(D(dd,"fcd"))
dGdX[4] <- eval(D(dd,"b"))
dGdX[5] <- eval(D(dd,"d"))
dGdX[6] <- eval(D(dd,"eta"))
dGdX[7] <- eval(D(dd,"M"))
super$SetdGdX(dGdX)
}
)
)
PRSMED <- R6::R6Class("PRSMED",
inherit=LSFM,
public = list(
Calc = function(){
super$DefineG(GPRSMED$new(super$GetN()))
super$RF()
}
)
)
############### Main Program #######################
##################### Input Data (mean value and COV) ##################
Ay <- 1.56 ; Aycov <- 0.036
fy <- 47.7; fycov <- 0.15
fcd <- 3.5; fcdcov <- 0.21
b <- 8.0; bcov <- 0.045
d <- 13.2; dcov <- 0.086
eta <- 0.59; etacov <- 0.05
M <- 326.25; Mcov <- 0.17
##list of mean values
muX <- c(Ay,fy,fcd,b,d,eta,M)
##list of COV values
COVX <- c(Aycov,fycov,fcdcov,bcov,dcov,etacov,Mcov)
sigmmaX <- muX * COVX
##sets names of distribution
dist <- c("normal", "normal", "normal", "normal" ,"normal" ,"normal" ,"normal" )
robj <- PRSMED$new("PRSMDE",7,muX,sigmmaX,dist)
robj$Calc()
cat('Reliability index beta = ', robj$GetBeta(), '\n')
dist[7] <- "lognormal"
robj <- PRSMED$new("PRSMDE",7,muX,sigmmaX,dist)
robj$Calc()
cat('Reliability index beta = ', robj$GetBeta(), '\n')
dist <- c("lognormal", "lognormal", "lognormal", "lognormal" ,"lognormal" ,"lognormal" ,"normal" )
robj <- PRSMED$new("PRSMDE",7,muX,sigmmaX,dist)
robj$Calc()
cat('Reliability index beta = ', robj$GetBeta(), '\n')
dist <- c("lognormal", "lognormal", "lognormal", "lognormal" ,"lognormal" ,"lognormal" ,"lognormal" )
robj <- PRSMED$new("PRSMDE",7,muX,sigmmaX,dist)
robj$Calc()
cat('Reliability index beta = ', robj$GetBeta(), '\n')
#######################################################
#### expected results of the example program ####
#Reliability index beta = 3.833028
#Reliability index beta = 3.761254
#Reliability index beta = 4.387684
#Reliability index beta = 4.090647
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.