Hydrogen has been proposed as a potential partial solution to the need for a clean-energy economy. In order to make this a reality, large-scale hydrogen transportation networks need to be engineered and installed. Steel pipelines are the most likely candidate for the required hydrogen transportation network. One historical barrier to the use of steel pipelines to transport hydrogen was a lack of experimental data and models pertaining to the fatigue response of steels in gaseous hydrogen. Extensive research at NIST has been performed in conjunction with the ASME B31.12 Hydrogen Piping and Pipeline committee to fill this need. After a large number of fatigue crack growth (FCG) tests were performed in gaseous hydrogen, a phenomenological model was created to correlate the applied loading conditions, geometry, and hydrogen pressure to the resultant hydrogen-assisted fatigue crack growth (HA-FCG) response of the steels. As a result of this extensive data set, and a simplification of the above-mentioned phenomenological model, the ASME B31.12 code was modified to enable the use of higher strength steels without penalty, thereby resulting in the potential for considerable installation cost savings. This paper details the modeling effort that led to the code change.

## Introduction

Hydrogen will likely play a key role in transitioning the world away from the use of fossil fuels as a primary energy source. There are multiple ways in which hydrogen may be used to accomplish this goal. First, hydrogen may be produced with excess power at solar, wind, and other clean power-generation facilities that produce power regardless of demand. In this way, the excess energy generated during times of off-peak demand may be stored as hydrogen. The hydrogen would then be transported throughout the U.S. to be converted to usable energy via electrochemical fuel cells once demand arises. As a second option, hydrogen may be used as a simple energy carrier, i.e., hydrogen production and distribution for the sake of distributed electricity generation rather than simply as an energy storage mechanism. In either scenario, hydrogen must be transported long distances in order for it to achieve its potential usefulness.

Steel pipelines are the most economical means of transporting fuels in the U.S., including hydrogen [1]. Currently, the length of hydrogen-dedicated pipelines in the U.S. comprises only one-half of one percent of the total length of operating U.S. natural gas pipelines [2,3]. Considering the current U.S. natural gas transportation system as a benchmark, one recognizes the need for far more hydrogen-specific pipelines to be operational in the near future in order to meet similar energy needs. According to the ASME B31.12 committee on hydrogen piping and pipelines, a major barrier to the design and installation of steel pipelines for hydrogen transportation has historically been the lack of information on hydrogen-assisted fatigue crack growth (HA-FCG) in pipeline materials. Though noncyclic fracture studies of pipeline steels in gaseous hydrogen have been performed to provide a baseline understanding of the effect of hydrogen upon these loading and failure scenarios [4–8], test results on HA-FCG were lacking because of the expense and difficulty associated with the tests. As such, the ASME committee tasked with creating the hydrogen transportation pipeline design and engineering criteria based the original ASME B31.12-2008 code [9] on the relative response of pipeline steels to monotonic loading in a gaseous hydrogen environment.

An inverse relationship was found between material strength and the adverse effect of hydrogen on ductility, known as hydrogen embrittlement, in tensile tests. Therefore, the use of monotonic data resulted in design thickness penalties, which were assessed to any steel having a specified minimum yield strength (SMYS) greater than 360 MPa (52 ksi). Research at NIST and Sandia National Laboratories, however, has shown that unlike other material properties (e.g., ductility), strength is not correlated to the response of a material to HA-FCG [10]. The recent HA-FCG results produced by the two laboratories indicate that the design penalty placed upon higher strength steels is overly conservative and without justification. Studies have shown that allowing pipeline steels with a SMYS of up to 480 MPa (70 ksi) without penalty could reduce material and installation costs by approximately 25% [11]. As a result, the forthcoming version of the ASME B31.12 code will remove the design penalties on materials with a SMYS between 360 MPa and 480 MPa (52 ksi and 70 ksi). This work details the recent data analysis and modeling studies performed at NIST that were used to inform the ASME B31.12 committee during the code revision process. This work also outlines the HA-FCG modeling background and implementation for both predictive and engineering design purposes.

## Hydrogen-Assisted Fatigue Crack Growth Results

The HA-FCG experiments performed at NIST include pipeline base materials, which have a SMYS between 360 MPa and 690 MPa (52 ksi and 100 ksi), as well as on welds and heat-affected zones in pipeline steels with an SMYS between 360 MPa and 480 MPa (52 ksi and 70 ksi). A selection of the data collected at NIST on the base materials from pipeline steels is shown in Fig. 1 [12–14]. The data in Fig. 1, and those in Refs. [12], [13], and [15–17] indicate that the presence of hydrogen can increase the fatigue crack growth rate (FCGR) of pipeline steels as much as an order of magnitude over the FCGR in air, depending upon the applied load and geometry (Δ*K*). The HA-FCG results also indicate that the effect of hydrogen on the FCG is not dependent upon SMYS, at least between values of 360 MPa (52 ksi) and 690 MPa (100 ksi), as the “X52 New” material at 5.5 MPa data falls right on the response of X70B at 5.5 MPa, for example.

The data presented in Fig. 2 are delineated by the American Petroleum Institute (API) steel designation (e.g., X52), NIST internal naming convention if applicable (e.g., Alloy J, Vintage, New), and hydrogen pressure in MPa. Note that the API naming convention includes the SMYS of the material such that X52 designates an API pipeline steel that has an SMYS of 360 MPa (52 ksi). Fatigue crack growth (FCG) data shown in these figures have d*a*/d*N* as the dependent variable (*y*-axis), which is the crack growth per load cycle, and Δ*K* is the independent variable (*X*-axis), where Δ*K* is the stress-intensity-factor range. When delineating the results by material type, there appears to be a correlation between increased hydrogen pressure and increased HA-FCG, shown in Fig. 3(a).

For modeling purposes, analysis of the data in Figs. 1–3 shows that (a) HA-FCG is increased over FCG in air for Δ*K* values larger than some threshold value, (b) HA-FCG rates are not SMYS dependent, (c) HA-FCG rates appear to increase with hydrogen pressure for a given material, and (d) the HA-FCG data appear to have multiple linear regions of FCG response (shown specifically in Fig. 4). A full description of the HA-FCG test methodology, tests performed, and test results produced at NIST, can be found in Ref. [18].

## Fatigue Crack Surface Morphology

Figure 4 details the separation of the HA-FCG response of an API X100 pipeline steel into three regions for discussion purposes. The regions are referred to as regions A, B, and C. The curve for air falls outside the three regions.

In these three regions in Fig. 4, the fracture surfaces produced as a result of the HA-FCG within each region differ markedly. For reference, Fig. 5 provides the FCG surfaces of three representative pipeline materials tested in hydrogen. The Δ*K* values delineating each region are approximated in the following discussion. The FCG surface in region A (Δ*K* < ∼8 MPa m^{1/2}) closely matches that produced in air. The response in region B (∼8 MPa m^{1/2} < Δ*K* < ∼15 MPa m^{1/2}) produces an FCG surface dominated by crystallographic faceting, indicative of a more brittle FCG response and some hydrogen attack at grain boundaries. Representative crystallographic facets are indicated by arrows in this regime for all three materials shown in Fig. 5. The FCG surface produced in region C (Δ*K* > ∼15 MPa m^{1/2}), while also exhibiting a small amount of crystallographic faceting, shows a return to much of the character of the FCG surface of air. That is, the existence of quasi-cleavage and “river” marks, as well as the relative amount of crack branching within region C, more closely resembles that of region A. The FCG surface in region C is indicative of a transition to a more ductile fatigue behavior, in contrast to that produced in the middle regime (region B). Specifically, the failure surface morphology in region C indicates that the effect of hydrogen has effectively saturated, in which case the failure surface morphology in region C has components of maximum hydrogen-induced damage (region B) plus an additional ductile-type character similar to that found in region A. The HA-FCG surfaces produced from the different regions for three representative materials are shown in Fig. 5. The FCG surface morphologies found here are similar to those detailed in Refs. [19–21]. Details of quasi-brittle fatigue fracture of a low-carbon steel in hydrogen, where predominantly transgranular cracking was seen, showed that what appeared to be brittle fracture was a combination of extensive slip and localized ductile cracking [22]. An explanation of microstructural details of quasi-cleavage with crystallographic faceting in a low-carbon steel tested in hydrogen gas can be found in the literature [17].

Not only do the images in Fig. 5 indicate a transition in relative amounts of crystallographic faceting between the three regions, the images also indicate a change in the out-of-plane crack branching as a function of crack growth. Crack branching is manifested in Fig. 5 as fissures that traverse into the pictures. As an example, region A exhibits little or no crack branching, region B exhibits considerable branching, while region C exhibits some amount of out-of-plane branching between that of regions A and B for all three materials. This supports the notion of a transition in FCG morphology as the crack traverses the specimen (growing from region A to B to C). It is understood that the HA-FCGR of pipeline steels is sensitive to loading frequency. The test frequency presented here, 1 Hz, was chosen as it provides baseline for understanding of the deformation mechanisms present, while providing a sufficient amount of time for hydrogen diffusion during each loading incursion. A complete discussion of the test frequency as it applies to pipeline operation is provided in Ref. [18].

## Dominant Damage Mechanisms

Each of the three regimes discussed above is produced as a result of different dominant damage mechanisms. Each damage mechanism dominates at different times depending upon the rate of crack growth per cycle (d*a*/d*N*). Given that the FCG regime of region A (Δ*K* < ∼8 MPa m^{1/2}) produces a fatigue surface that matches that of tests in air, it is presumed that this FCG regime is dominated by a fatigue-only mechanism. Suresh and Ritchie hypothesized that there exists a threshold stress intensity value, $KmaxT$, below which hydrogen does not affect the FCG response of steels [21]. It is believed that the region A results are due to the stress intensity factor falling below the threshold value, $KmaxT$.

It is understood that the combined HA-FCG response (region A + region B + region C) results from the superposition of a mechanism not affected by hydrogen (region A) and a FCG response affected by hydrogen (region B + region C). This overarching formulation follows the underpinnings of Ref. [23]. The HA-FCG response that is affected by the presence of hydrogen, region B + region C, is comprised of a bi-linear trend when plotting d*a/*d*N* versus Δ*K*, which will be discussed further. Similar bi-linear trends, or transitions in FCG response, have been attributed to the following interactions:

*r*, is on the order of

where *R* is the load ratio of the test and is defined as *R* = *K*_{min}/*K*_{max}. Equation (1), by use of Eq. (2), is plotted as a dashed line along with the HA-FCG results of API X100 steel in Fig. 6.

Equation (1) correlates well with the transition between the two bi-linear HA-FCG regimes (region B and region C). It is hypothesized here that when the value of d*a/*d*N* is smaller than *x _{tr}*, the HA-FCG response is dominated by the stress-assisted hydrogen accumulation within the FPZ. Specifically, while hydrogen accumulation far-field in front of the crack tip is increased due to hydrostatic stresses, the hydrogen concentration within the FPZ is exponentially proportional to the hydrostatic stress. As such, when the d

*a/*d

*N*is within the zone of increased hydrogen concentration produced by the 1/

*r*dependence of the hydrostatic stress, the FCG falls in region B and is termed the transient HA-FCG regime. Transient is used here given that these materials exhibit this particular HA-FCG response for a finite amount of crack extension per cycle. The presumed interaction between d

*a/*d

*N*and the FPZ, which produces the response in the transient regime, is shown graphically in Fig. 7(a). Specifically, when the crack extension, per cycle, falls within the FPZ having size $xtr$, the resulting FCGR is enhanced. In which case, the presence of the accumulated hydrogen at the crack tip dominates the damage response in this HA-FCG regime. This results in a more brittle material response than that produced in the region A, ultimately leading to an FCG surface that is dominated by crystallographic faceting. While crack extension per cycle within region A also occurs within the FPZ and its associated region of increased hydrogen concentration, it is hypothesized that the HA-FCGR is not increased over that of air because the critical K-value for environmental-assisted mechanisms to occur (termed

*K*

_{max}by Suresh and Ritchie [21]) has not yet been reached.

On the other hand, when the crack extension per cycle, d*a/*d*N*, extends beyond the FPZ transition length, *x _{tr}*, with its associated enhanced hydrogen accumulation, the crack extension is affected primarily by the far-field hydrogen accumulation in the material. This leads to the HA-FCG response that is dominated by traditional fatigue mechanisms; albeit at an accelerated rate due to the initial crack extension per cycle occurring within the FPZ. This hypothesis is supported by the evidence that the FCG surface in this regime closely matches that of FCG surfaces tested in air. This HA-FCG regime (region C) is termed the steady-state regime. The relationship between the per-cycle crack extension and the FPZ that correlates to region C is shown in Fig. 7(b). Specifically, in this regime, the per-cycle crack extension grows through and extends beyond the FPZ. While the FCG surface produced by this regime appears to be mixed mode, it exhibits far more transgranular crack growth than intergranular, and, therefore, more closely resembles FCG surfaces of materials tested in air.

## Predictive Model

Based upon the above findings, a predictive model was sought to correlate the HA-FCGR of API pipeline steels to the applied load and geometry (together defining Δ*K*), and hydrogen pressure. The purpose of such a model is to predict the remaining useful lifetime of steel components (e.g., pipes), given an understanding of the boundary conditions and initial conditions placed upon the component. The following outlines the derivation of the predictive model intended for that purpose.

The HA-FCG response of API steels appears to follow a multilinear trend on the conventional log-log axes used to plot FCGR data. As an example, one could argue that the X100 data collected in hydrogen gas pressurized to 1.72 MPa follows a tri-linear trend, as proposed in Fig. 8.

Figure 8 proposes the existence of one HA-FCG trend for Δ*K* < ∼8 MPa m^{1/2}, a separate trend for ∼8 MPa m^{1/2} < Δ*K* < ∼15 MPa m^{1/2}, and a third trend for Δ*K* > ∼15 MPa m^{1/2}. In order of increasing Δ*K*, the three regions are termed the “air,” “transient,” and “steady-state” regimes for the remainder of this work. These regimes correlate with regions A, B, and C, respectively. Given that the steady-state regime is presumed to be dominated by the same damage mechanisms that occur in air, it is not surprising that the slope of the linear region in the steady-state regime matches that of air.

and $(da/dN)H$ is the hydrogen-assisted FCG response. The framework outlined in Eq. (4) views the two separate mechanisms as if occurring in parallel; that is, they occur concurrently and without interaction. The Heaviside step function, *δ*, simply turns the hydrogen FCG response on when the ambient hydrogen pressure, *P _{H}* is above a threshold value of $PHth=0.02MPa$ [26]. Although it is likely that hydrogen affects the FCG response of steels at pressures below 0.02 MPa, this value is used here, as it is the lowest hydrogen pressure for which steel HA-FCG results are known to have been published [27].

*Q*is the activation energy for hydrogen diffusion (

*Q*= 27.1 kJ/mol) [28];

*V*is the partial molar volume of hydrogen in the metal (

*V*= 2.0 × 10

^{−6}m

^{3}/mol) [29,30];

*R*is the universal gas constant;

*T*is the absolute temperature; $\sigma h$ is the hydrostatic stress at a critical distance in front of the crack tip (Eq. (1));

*P*is the ambient hydrogen pressure; and

_{H}*a*1,

*B*1,

*m*1, and

*d*1 are fitting parameters. The stress intensity factor is used here to capture the information regarding the crack-tip stress and deformation state for lack of a better surrogate. The stress intensity-driven component of the HA-FCG response was initially described by [19]

*a*2,

*B*2,

*m*2, and

*d*2 are fitting parameters and all other parameters are defined above. It was found, however, that the HA-FCG results all converged at larger values of Δ

*K*regardless of the ambient hydrogen pressure, thereby minimizing the effect of the terms within the parenthesis and driving the value of

*d*2 toward 0 [31,32]. As such, the following functional form is proposed here for the stress intensity-driven HA-FCG:

The robust HA-FCG predictive model must be calibrated for each material of interest. A minimum of three FCG tests at three different hydrogen pressures and one FCG test in air are required to calibrate the model. As extrapolation beyond the calibration data is not suggested, all four data sets should be created by use of Δ*K* values that bound the loading and boundary conditions of interest to be subsequently modeled. Once calibrated, the model can predict HA-FCG as a function of geometry and load (Δ*K*), as well as hydrogen pressure. If the stress intensity for the geometry of interest is known, e.g., a pipe with an internal thumbnail-shaped crack, one can then use the model to predict the cycles to failure, given particular loading and initial conditions. Furthermore, given a crack of known size and geometry at known stress intensity, one may quantify the effect of an increase or decrease in hydrogen operating pressure upon the lifetime of the component. The full model applied to an X100 pipeline steel is provided in Fig. 9. Additional implementation examples can be found in Ref. [31]. Model calibrations to several materials are provided in the Appendix. When calibrated, the model fits HA-FCGR data to within a factor of 2.

## Simplified Model

Note that the simplified model is no longer predictive as a function of hydrogen pressure. As such, model calibrations must be performed for each material of interest, at all hydrogen pressures of interest.

There are two ways in which the simplified model may be calibrated to experimental data. First, power law relationships may be fit to each of the three regions (air, transient, and steady-state), using the relationships in Eqs. (5), (11), and (12). Specifically, the variables *a*, *a*3, *a*4, *B*, *B*3, and *B*4 are all determined as if each region of interest exists independent of the others. When combining the power law relationships in this way, the transitions between each linear region of interest are more gradual, as shown in Fig. 10(a). Pseudo code that can be used to create the parameter values *a*, *a*3, *a*4, *B*, *B*3, and *B*4, while minimizing user bias is provided in the Appendix as PseudoCode1.

The second way to calibrate the simplified model is to first fit power law relationships to the three individual regions of interest (as discussed above), followed by a second fitting of the parameters in which the final parameter values for each region are determined by enabling neighboring regions to influence the others. In this way, the calibration more closely fits the transition between regions exhibited by the experimental data. This technique was performed on a representative data set and the results are provided in Fig. 10(b). Pseudo code that can be used to create the second-fit parameter values *a*1, *a*3, *a*4, *B*1, *B*3, and *B*4, while minimizing user bias, is provided in the Appendix as PseudoCode2 and 3.

While the second calibration technique does a far better job of correlating the data, it is more cumbersome to implement than the first. Simplified model calibrations for all materials tested to date at NIST are provided in the Appendix.

## ASME B31.12 Code Implementation

Upon review of both the full and simplified model implementations presented above, the ASME B31.12 committee determined that a single, upper-bound simplification should be employed within the code. That is, given the vast number of microstructural constituents potentially found within pipeline steels and their respective FCGRs (see Fig. 2), the committee determined that use of the worst-case model representation was the safest course of action. Use of this upper bound simplification would then enable the engineer to use materials having SMYS up to 480 MPa (70 ksi) at design pressures up to 20.7 MPa (3000 psi) without penalty. The upper-bound solution utilizes Eqs. (5), (6), and (10)–(12), in conjunction with the parameter values provided in Table 1. The graphical representation of the upper-bound FCG prediction, as well as a representative pipeline steel HA-FCG response, is provided in Fig. 11. Note that the upper bound curve provides an upper bound for all data tested at NIST, including the data provided in Fig. 2.

Although the upper bound appears to be conservative with respect to the experimental data shown in Fig. 11, it provides an upper bound for all potential HA-FCG data sets in existence for the boundary and loading conditions of interest. As such, one may use the upper-bound model implementation with confidence that the FCG prediction will be conservative for any potential pipeline steel.

## Future Work

The full HA-FCG model detailed in Eqs. (4)–(8) can predict the life of a component as a function of hydrogen pressure, provided that (a) there is a closed-form solution for Δ*K* for the geometry and loading conditions of interest, and (b) the model is calibrated to that particular material. Both provisions are nontrivial. As was detailed in Ref. [31], depending upon which closed-form solution one uses for an internal thumbnail-shaped crack (as an example), the resulting life estimate may be upward of 2× different than if another estimate was chosen. Additionally, full model calibrations require a minimum of one test in air and one test at three different hydrogen pressures for each pipeline steel of interest. As can be seen in Fig. 2 and was discussed previously, the HA-FCG response of pipeline steels is not correlated with their API designation. That is, the HA-FCG response is not correlated to the SMYS of the material. The HA-FCG response does appear to correlate with the microstructure of the material, however. Specifically, the HA-FCGR for a material increases with increasing percent polygonal ferrite, as shown in Fig. 12.

To address the two provisions discussed above, NIST is supporting a concerted effort to create and calibrate microstructure-specific models, implemented into a finite element (FE) platform. Once completed, the FE analysis will enable the user to calculate the HA-FCGR for any geometry and loading condition, not just those for which a closed-form *K*-solution exists. Furthermore, the microstructure-based model will enable the engineer to calculate HA-FCGR for any material, with any microstructure, given that the microstructure of the pipeline material is known. Finally, the implemented FE model would enable material design for improved HA-FCG response.

### Summary.

This paper, in conjunction with Ref. [18], provides a detailed accounting of the work performed at NIST to support a modification of the ASME B31.12 code to enable the use of higher strength pipeline steels for hydrogen transportation. Specific conclusions from this work are as follows:

A phenomenological model has been created to predict HA-FCG of pipeline steels. In the simplified engineering form, the model is capable of predicting HA-FCG for each material that it has been calibrated to (see Table 2).

A single, upper bound solution set of the phenomenological model has been chosen to be implemented within the ASME B31.12 code. While still somewhat conservative, if chosen to be utilized by the design engineer, this model will enable the use of API steels having SMYS up to 70 ksi without penalty.

The phenomenological model may also be used, in conjunction with the data in Table 2, to enable pipeline design engineers to more accurately predict pipeline-specific HA-FCG for engineering purposes.

## Funding Data

Material Measurement Laboratory (Hydrogen pipelines).

Pipeline and Hazardous Materials Safety Administration (Grant No. DTPH56-09-T-000005).

### Appendix

Simplified model calibrations performed to date are provided in Table 2. Table 3 provides the chemical compositions, tensile properties, and microstructural constituents of all materials in which HA-FCG tests have been performed at NIST.

**PseudoCode1**

Clear all previous data and variables

Prompt user for file

Prompt user for data range within file

Store the Delta K and da/dN data points as variables **x** and **y** respectively

Plot **x** versus **y** data on a logarithmic scale in both axis so that the user can view the data set

Prompt the user to select a point in which they think is part of region 1 the _________ based region

Store this point as variable **PickedPoint**

Create variables **up** and **low** and set both equal to zero

These will be used to turn on and off specific parts of the tolerance check loop

Create variable **resetBounds** and set equal to 1

This will be used to turn on and off the loop which determines the initial line fit for a region

Create variable **nextRegion** and set equal to 1

This variable keeps the program in a large loop until all three regions have been found

Create variable **count** and set equal to zero

This variable keeps track of how many times the main loop has been executed (how many regions have been found)

Create variable **tolerance** and set equal to desired initial tolerance.

This will be turned into a percentage later

Create main loop that will run while **nextRegion** is equal to 1

Add one to **count**

Create variable **accepted** and set equal to zero

This variable will keep the program in the next loop until the user has accepted the fit for the region being worked with

Create variable **stop** and set equal to zero

This variable will keep the program in the tolerance loop until a point on the fitted line exceeds the set tolerance

Create accepted loop that will run while **accepted** equals zero

Create conditional statement so that program will only advance here if **resetBounds** equals 1

Create variable **lower** and set equal to **PickedPoint**-1

Create conditional statement so that if **lower** is less than 1 then **lower** equals 1

This will keep the tolerance checks from indexing beyond the dataset

Create variable **upper** and set equal to **PickedPoint** + 1

Create conditional statement so that if **upper** is greater than the number of x data points then **upper** equals the highest index of **x**

This will keep the tolerance checks from indexing beyond the dataset

Create sub set of data **xx** which contains all **x** points from the **lower** index to the **upper** index

Create sub set of data **yy** which contains all **y** points from **lower** index to **upper** index

Find a power fit line (y = αx^{β}) of **(xx,yy)** and store alpha and beta as variables **a** and **b**

Create variable **yfitstart** and set equal to the y values of the power fit line for x values 1 through the number of **x** points from raw data

End the **resetBounds** section by setting **resetBounds** equal to zero

Create variable **yfit** and set equal to **yfitstart**

Create variable **toleranceAbove** and set equal to 1+(**tolerance**/100)

Create variable **toleranceBellow** and set equal to 1-(**tolerance**/100)

Create a loop that will run as long as stop equals zero

Create conditional statement so that if the **upper** index of **yfit** is greater than **toleranceAbove** times the **upper** index of **y** or less than **toleranceBelow** times the upper index of **y** then setup equal to 1

Create conditional statement so that if the **lower** index of **yfit** is greater than **toleranceAbove** times the **lower** index of **y** or less than **toleranceBelow** times the **lower** index of **y** then set **low** equal to 1

Create conditional statement so if **up** and **low** both equal 1 then **stop** equals 1 which will exit the tolerance checking loop

Create conditional statement so that if **up** equals zero **upper** equals **upper** plus one

Create conditional statement so that if **upper** is greater than the number of x data points then **upper** equals the highest index of **x**

Create conditional statement so that if **low** equals zero **lower** equals **lower** plus one

Create conditional statement so that if **lower** is less than 1 then **lower** equals 1

Change sub set **xx** to contain all **x** points from the new **lower** index to the new **upper** index

Change sub set **yy** to contain all **y** points from the new **lower** index to the new **upper** index

Find a power fit line (y = αx^{β}) of **(xx,yy)** and store alpha and beta as variable **a** and **b**

Change variable **yfit** to equal to the y values of the power fit line for x values 1 through the number of **x** points from raw data

On a logarithmic plot in both axis plot (**x,y**) and (**x,yfit**)

(**x,y**) should be plotted as individual data points. (**x,yfit**) should be plotted as a line

Prompt user for feed back

Ask user if they accept the fit

Ask user if they would like to change the picked point

Ask user if they would like to adjust the tolerance

Create conditional statement so that if the user picked a new point then store the new point as variable **PickedPoint** and set **resetBounds** equal to 1

Create conditional statement so that if the user accepts the fit **stop** equals 1

Otherwise set **accepted**, **stop**, **up**, and **low** all equal to zero. Set **yfit** equal to **yfitstart**

Set variable **lower** equal to **PickedPoint**-1

Create conditional statement so that if **lower** is less than 1 then **lower** equals 1

Set variable **upper** equal to **PickedPoint** + 1

Create conditional statement so that if **upper** is greater than the number of x data points then **upper** equals the highest index of **x**

Create conditional statement if **count** equals 1

Create variable **R1upper** and set equal to **upper**

Create variable **R1lower** and set equal to **lower**

Create variable **R1yfit** and set equal to **yfit**

Create variable **a1** and set equal to **a**

Create variable **b1** and set equal to **b**

Plot raw (**x,y**) data on a logarithmic scale in both axis so that the user can view the data set

Prompt the user to select a point in which they think is part of region 2 the _________ based region

Store this point as variable **PickedPoint**

Set variable **resetBounds** equal to 1

Create conditional statement if **count** equals 1

Create variable **R2upper** and set equal to **upper**

Create variable **R2lower** and set equal to **lower**

Create variable **R2yfit** and set equal to **yfit**

Create variable **a2** and set equal to **a**

Create variable **b2** and set equal to **b**

Plot raw (**x,y**) data on a logarithmic scale in both axis so that the user can view the data set

Prompt the user to select a point in which they think is part of region 3 the _________ based region

Store this point as variable **PickedPoint**

Set variable **resetBounds** equal to 1

Create conditional statement if **count** equals 3

Create variable **R3upper** and set equal to **upper**

Create variable **R3lower** and set equal to **lower**

Create variable **R3yfit** and set equal to **yfit**

Create variable **a3** and set equal to **a**

Create variable **b3** and set equal to **b**

Set variable **nextRegion** equal to zero

Create variables **R12x** and **R12y** and store the x and y values of the intercept between regions 1&2

Create variables **R23x** and **R23y** and store the x and y values of the intercept between regions 2&3

Preform any required operations required to trim regions to intercepts and combine the three trimmed regions into one x and one y array called **xMeasured** and **yMeasured** respectively.

Create array **ycalculated** and store all y values for all three regions based on the equation________

Plot on a logarithmic plot in both axis **(x,y)**, **(x,ycalculated)**, **(xMeasured,yMeasured)**

(x,y) should be plotted as individual points. (x,ycalculated) and (xMeasured,yMeasured) should be plotted as solid lines in separate colors

*PseudoCode2 and 3- to be used together*

**PseudoCode2**

Clear all previous data, variables, etc.

Call code provided in pseudo code 1 and carry over variables **a1, a2, a3, b1, b2, b3, data, x, ycalculated, xMeasuered,** and **yMeasured.**

Prompt user to answer yes or no to the question “Do you have Paris values for the material ran in air?”

Create variable **air** and set equal to 1 if user entered yes or 0 if user entered no

Create conditional statement for value of **air**

If **air** equals 1

Prompt user for “Paris prefactor for air” and overwrite **a1** from pseudo code 1

Prompt user for “Paris exponent for air” and overwrite **b1** from pseudo code 1

Create a 3x2 matrix **data1** and populate with $a1b1a2b2a3b3$

If **air** equals 0

Create a 3x2 matrix **data1** and populate with $a1b1a2b2a3b3$

End conditional statement

Create variable **data2** and set equal to **data**

Create cell **data3** and populate with {**data1,data2**}

Create variable **opt_parameteres** and set equal to the output from the function described in pseudo code 3 using **data3** as an input

Plot on a logarithmic plot in both axis **(xMeasured,yMeasured)** and **(x,ycalculated)**

Create variable **airf** and set equal to **opt_parameters**(1,1)*10 ̂ (-10) * **data2**(:,1) ̂ **opt_parameters**(1,2)

Where (1,1) is (row number, column number) and: means all

Create variable **transf** and set equal to **opt_parameters**(2,1) *10 ̂ -19 ***data2**(:,1) ̂ **opt_parameters**(2,2)

Create variable **ssf** and set equal to **opt_parameters**(3,1)*10 ̂ -10***data2**(:,1). ̂ **opt_parameters**(3,2)

Create variable **fitlifef** and set equal to **airf**+((**transf**). ̂ (-1)+(**ssf**). ̂ (-1)). ̂ (-1)

Plot on a logarithmic plot in both axis (**data2**(:,1), **fitlifef**) and (**x,y**)

Create variable **piecewise_values** and set equal to **data1**

PseudoCode3

Create function that takes **data3** as an input and outputs **opt_parameters**

Create variable **data1** and set equal to cell one of **data3**

Create variable **data2** and set equal to cell two of **data3**

Create variable **expnt_air** and set equal to the exponent on **data1(1,1)**

Where (1,1) is (row number, column number). This format will be used going forward

Create variable **expnt_trans** and set equal to the exponent on **data1(2,2)**

Create variable **expnt_ss** and set equal to the exponent on **data1(3,2)**

Create 3x2 matrix **ab** and populate with $data11,1*10\u2009\u0302\u2002expnt_airdata(1,2)data12,1*10\u2009\u0302\u2002expnt_airdata(2,2)data13,1*10\u2009\u0302\u2002expnt_airdata(3,2)$Create 3x2 matrix **lb** and populate with$ab1,1*.999ab1,2*.75ab2,1*10\u2009\u0302\u2009\u221212ab2,2*.9ab3,1*.1ab3,2*.75$

Create 3x2 matrix **ub** and populate with $ab1,1*10ab1,2*3ab2,1*1.1ab2,2*5ab3,1*10ab3,2*1.25$

Create function that will minimize a residual function **error1** based on **ab**, **lb**, **ub**, with a tolerance 1e-8 and stores the resulting optimized values of **ab** as **opt_parameters**

Note: an example of such a function is fmincon in matlab

Create the residual function **error(params,data2)**

Where **params** is a variable filled with variable set to be optimized, **ab**. **Params** should be fed back into minimization function until the tolerance is reached.

Create variable **a1** and set equal to **params**(1,1)*10 ̂ -10;

Create variable **b1** and set equal to **params**(1,2);

Create variable **a2** and set equal to **params**(2,1)*10 ̂ -19;

Create variable **b2** and set equal to **params**(2,2);

Create variable **a3** and set equal to **params**(3,1)*10 ̂ -10;

Create variable **b3** and set equal to **params**(3,2);

Create a loop to go from 1 to the number of rows in **data2**

Create variable **air**(index#) and set equal to **a1*****data2**(index #,1) ̂ **b1**

Where index # is the number of times through the loop and **air** will become an array of size 1 x number of rows in **data2**. This format will be used going forward

Create variable **trans**(index #) and set equal to **a2*****data2**(index #,1) ̂ **b2**

Create variable **ss**(index #) and set equal to **a3*****data2**(index #,1) ̂ **b3**;

Create variable **fitlife**(index #) and set equal to **air**(index #)+((**trans**(index #)) ̂ (-1)+(**ss**(index #)) ̂ (-1)) ̂ (-1)

Create variable **residual** (index #) and set equal to **fitlife**(index #)-**data2**(index #,2)

End the loop