% This script determines the calibration matrix entries for a single crack,
% as outlined in equation 13. The crack is placed in a wedge of angle
% 2*alpha, the crack itself at an angle of theta. The entries a, b, c, d are
% the matrix entries. The numerical value may differ from those published
% if different parameter values are used.
% 
% This script was written in MATLAB R2017b and requires SingleCrackCalib 
% and WilliamsEigenSol
%
% The results produced are displayed in equation 14.
% 
% Daniel Riddoch, 2021-03-01
% University of Oxford, Department of Engineering Science
clc
clear
close all
%% Inputs
% This section contains all the inputs to the problem, both physical and
% numerical.
alpha=3*pi/4;                             % Wedge half-angle(radians)
theta=pi-alpha;                           % Crack angle(radians)
N=100;                                    % Number of points on the crack face(default value is 100)
n=500;                                    % Number of Gauss points for notch faces(default value is 500)
facl=80;                                 % Multiplicative constant used in transformations(default value is 80)
%% Eigensolution
% This section generates the eigensolution needed to solve the problem.
[EigenVal,~]=WilliamsEigenSol(alpha,theta);     % Generation of the eigenvectors
lam1=EigenVal.M1; lam2=EigenVal.M2;
%% Calibrations
% This section generates the calibration matrix entries.
[a,b,c,d,~]=SingleCrackCalib(alpha,theta,1,n,facl,N);