This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
# TO DO | |
# 5-2. Dominant Cycle Measured by Zero Crossings of the Band-Pass Filter - Validated against TS up to DC portion | |
# 8-3. Autocorrelation Periodogram - Validated against TS up to Normalization | |
# Outstanding | |
# 9-1 onwards | |
############################## | |
using Statistics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################# | |
# Fitness-For-Service API 579-1/ASME FFS-1, June, 2016 | |
# PART 4 – ASSESSMENT OF GENERAL METAL LOSS | |
################################################################# | |
# Methods: | |
# 1. Point Thickness Readings (PTR) | |
# 2. Critical Thickness Profile (CTP) | |
# By: Andrew Bannerman 12.18.2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ASME VIII 2017 | |
# 13-4 DESIGN OF VESSELS OF NONCIRCULAR CROSS SECTION | |
# Figure 13-2(a) Vessels of Rectangular Cross Section | |
# Selection = Sketch (1) | |
#--- Begin single script - validate calculations against example problem | |
# ASME PTB-4-2013 - Example Problem - Header Box Data | |
# Material = SA516, Grade 70 (S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################# | |
# Calculating the Required Structural Thickness of Pipe Using Beam Stress Theory | |
############################################################################################# | |
# Input parameters | |
P = 850 # pressure | |
Do = 12.75 # outside diameter | |
S = 17900 # code allowable stress | |
E = .85 # weld joint efficieny | |
W = 1.0 | |
Y = 0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PSMSL Tide Data | |
library(lubridate) | |
library(data.table) | |
# Individual File Reading | |
# Read the gauge file list (location, names) | |
file_list = read.csv("C:/Users/Andrew.Bannerman/Desktop/PSMSL Tidal Data/rlr_monthly/rlr_monthly/filelist.txt",stringsAsFactors = FALSE, header=F,sep=";") | |
# Read 1x data set - oldest station with 1807 start date (sets the initial date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################################################### | |
# Rolling Hurst | |
#################################################################################### | |
# initialize outputs | |
m = Array{Float64}(length(d_es_close),0) | |
log_n_out = m | |
out_RS = m | |
# Set lags (range or specific) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# julia language | |
using Plots | |
# n = degrees | |
n = 360 | |
sin_out = fill(NaN,n) | |
cos_out = fill(NaN,n) | |
for i = 1:size(sin_out,1) | |
# julia function - sind,cosd = sin/cos in degrees | |
sin_out[i] = sind(i) | |
cos_out[i] = cosd(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# API 579 Pitting Assessment | |
# Level 1 | |
# Piping Assessment | |
################################################################# | |
# Fitness-For-Service API 579-1/ASME FFS-1, June, 2016 | |
# PART 6 – ASSESSMENT OF PITTING CORROSION | |
################################################################# | |
# Pipe Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rectangle Vessels With Stay Plates | |
# Figure 13-2(a) - Sketch (7) | |
# 13-9 STAYED VESSELS OF RECTANGULAR CROSS SECTION | |
# [FIGURE 13-2(A) SKETCHES (7) AND (8)] | |
#--- Begin single Script | |
# Material SA-516 Gr 70 (S) | |
S = 20000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
``` | |
Relative strength index | |
rsi(x::Array{T}; n::Int64=14)::Array{Float64} | |
Indicator weights the average gain and loss correctly not averaging over 0 values. Accounts for NaN in the calculation | |
using NaNMath; nm=NaNMath | |
``` | |
""" | |
function rsi(x::AbstractArray{T}; n::Int64=14)::Array{Float64} where {T<:Real} | |
dims = size(x,1) |
NewerOlder