Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
curve_fitting/boussinesq_spline.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
43 lines (37 sloc)
1.29 KB
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
function sigma_z=boussinesq_spline(q,a,b,z) | |
% function that determines stress under corner of an a by b rectangular platform | |
% z-meters below the platform. The calculated solutions are in the fmn data | |
% m=fmn(:,1) | |
% in column 2, fmn(:,2), n=1.2 | |
% in column 3, fmn(:,2), n=1.4 | |
% in column 4, fmn(:,2), n=1.6 | |
% this funciton uses spline interpolation | |
% outputs : sigma_z is the stress under the corner | |
%fmn is the data table given | |
fmn= [0.1,0.02926,0.03007,0.03058 | |
0.2,0.05733,0.05894,0.05994 | |
0.3,0.08323,0.08561,0.08709 | |
0.4,0.10631,0.10941,0.11135 | |
0.5,0.12626,0.13003,0.13241 | |
0.6,0.14309,0.14749,0.15027 | |
0.7,0.15703,0.16199,0.16515 | |
0.8,0.16843,0.17389,0.17739]; | |
%fmn1 is a new data table that removes the first column of n values to be | |
%used in interp2 function | |
fmn1=fmn(:,2:4); | |
% these lines calculate m and n | |
m=a/z; | |
n=b/z; | |
%these lines convert the m and n values into there coordinates on the new | |
%data table | |
m=m*10; | |
n=(n-1)/.2; | |
%these lines create the cordinates of the fmn1 table | |
y=1:8; | |
x=1:3; | |
% interp2 is a built in function that in this cases uses cubic spline to | |
% solve for the interpolated value. | |
value=interp2(x,y,fmn1,n,m,'spline'); | |
%calculates the stress | |
sigma_z=q*value; | |
end |