source: issm/trunk-jpl/examples/EsaWahr/wahr.m@ 22793

Last change on this file since 22793 was 22793, checked in by adhikari, 7 years ago

CHG: tutorial 1 completed

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1% compute semi-analytic solutions for a disc load
2function [vert, horz] = wahr(disc_rad,xi,love_h,love_l);
3
4 disc_rad = disc_rad/1000; % km
5 % compute P(x), dP(x)/dx, d2P(x)/dx2
6 %---------------------------------------------------------------------
7 % compute p_value
8 theta=km2deg(xi/1000)';
9 ang = theta/180*pi;
10 alpha=cos(ang);
11 m=length(alpha);
12 n=length(love_h)-1;
13 p_value = p_polynomial_value(m,n,alpha);
14 p_prime = p_polynomial_prime(m,n,alpha);
15 %---------------------------------------------------------------------
16 nn=[0:n];
17 nn_plus_1=nn+1;
18
19 % disc radius in degree
20 disc_rad = km2deg(disc_rad)/180*pi;
21 tau=zeros(size(love_h));
22 tau(1) = 0.5*(1-cos(disc_rad)); % tau_0
23 p_value_disc = p_polynomial_value(1,n+1,cos(disc_rad));
24 p_prime_disc = p_polynomial_prime(1,n,cos(disc_rad));
25 for jj=2:n+1
26 nnn = jj-1;
27 tau(jj) = 0.5 * (p_value_disc(jj-1) - p_value_disc(jj+1));
28 end
29
30 const=zeros(size(love_h));
31 for jj=1:n+1
32 const(jj) = 1/(2*(jj-1)+1);
33 end
34
35 disc=sum(bsxfun(@times,p_value,tau'),2);
36
37 g1 = -sum(bsxfun(@times,p_value,(tau.*love_h.*const)'),2);
38 g5 = -sum(bsxfun(@times,-sin(ang),bsxfun(@times,p_prime,(tau.*love_l.*const)')),2);
39
40 % coeff
41 coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81;
42
43 % vertical and horizontal solutions in mm
44 vert = g1*coeff*1000; % mm
45 horz = g5*coeff*1000; % mm
46
Note: See TracBrowser for help on using the repository browser.