[21337] | 1 | Index: ../trunk-jpl/src/m/boundaryconditions/love_numbers.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/boundaryconditions/love_numbers.m (revision 21306)
|
---|
| 4 | +++ ../trunk-jpl/src/m/boundaryconditions/love_numbers.m (revision 21307)
|
---|
| 5 | @@ -3,26 +3,37 @@
|
---|
| 6 | % retrieved from: http://www.srosat.com/iag-jsg/loveNb.php
|
---|
| 7 | % in a chosen reference frame
|
---|
| 8 | %
|
---|
| 9 | -% Usage: series=love_numbers(type,reference_frame)
|
---|
| 10 | -% type is one of 'h','k','l','gamma' and 'lambda'.
|
---|
| 11 | -% reference_frame is one of 'CM' and 'CF'.
|
---|
| 12 | +% Usage:
|
---|
| 13 | +% series = love_numbers(type)
|
---|
| 14 | +% series = love_numbers(type,reference_frame)
|
---|
| 15 | +%
|
---|
| 16 | +% - type = one of 'h','k','l','gamma' and 'lambda'.
|
---|
| 17 | +% - reference_frame = one of 'CM' (default) and 'CF'.
|
---|
| 18 | %
|
---|
| 19 | % Example:
|
---|
| 20 | -% love_k=love_numbers('k','CF');
|
---|
| 21 | +% love_k = love_numbers('k');
|
---|
| 22 | +% love_k = love_numbers('k','CF');
|
---|
| 23 | %
|
---|
| 24 |
|
---|
| 25 | - %some checks:
|
---|
| 26 | - if nargin~=2, error('love_numbers error message: wrong usage'); end
|
---|
| 27 | -
|
---|
| 28 | - if ~( strcmpi(type,'h') | strcmpi(type,'k') | strcmpi(type,'l') | strcmpi(type,'gamma') | strcmpi(type,'lambda') ),
|
---|
| 29 | - error('type should be one of ''h'',''k'',''l'',''gamma'' and ''lambda''');
|
---|
| 30 | - end
|
---|
| 31 | -
|
---|
| 32 | +% some checks:
|
---|
| 33 | +if nargin==1,
|
---|
| 34 | + frame='CM';
|
---|
| 35 | + disp('Info: computation is done in Center of Mass (CM) reference frame');
|
---|
| 36 | +elseif nargin==2,
|
---|
| 37 | + frame=reference_frame;
|
---|
| 38 | if ~( strcmpi(reference_frame,'CM') | strcmpi(reference_frame,'CF')),
|
---|
| 39 | error('reference_frame should be one of ''CM'' or ''CF''');
|
---|
| 40 | end
|
---|
| 41 | +else
|
---|
| 42 | + help love_numbers
|
---|
| 43 | + error('bad usage');
|
---|
| 44 | +end
|
---|
| 45 |
|
---|
| 46 | - love_numbers=[...
|
---|
| 47 | +if ~( strcmpi(type,'h') | strcmpi(type,'k') | strcmpi(type,'l') | strcmpi(type,'gamma') | strcmpi(type,'lambda') ),
|
---|
| 48 | + error('type should be one of ''h'',''k'',''l'',''gamma'' and ''lambda''');
|
---|
| 49 | +end
|
---|
| 50 | +
|
---|
| 51 | + love_numbers=[...
|
---|
| 52 | 0 0 0 0 0 0 0
|
---|
| 53 | -1.28740059 -1.00000000 -0.89858519 1.28740059 0.42519882 0.89858519 0.00000000
|
---|
| 54 | -1.00025365 -0.30922675 0.02060926 1.69102690 0.46358648 0.67016399 0.61829668;
|
---|
| 55 | @@ -10040,9 +10051,9 @@
|
---|
| 56 | end
|
---|
| 57 |
|
---|
| 58 | % choose degree 1 term for CF reference system
|
---|
| 59 | - if reference_frame=='CM',
|
---|
| 60 | + if frame=='CM',
|
---|
| 61 | return;
|
---|
| 62 | - elseif reference_frame=='CF', % from Blewitt, 2003, JGR
|
---|
| 63 | + elseif frame=='CF', % from Blewitt, 2003, JGR
|
---|
| 64 | if type=='h',
|
---|
| 65 | series(2,1) = -0.269;
|
---|
| 66 | elseif type=='k',
|
---|
| 67 | @@ -10051,6 +10062,6 @@
|
---|
| 68 | series(2,1) = 0.134;
|
---|
| 69 | end
|
---|
| 70 | else
|
---|
| 71 | - error(['love_numbers error message: unknow reference frame:' reference_frame]);
|
---|
| 72 | + error(['love_numbers error message: unknow reference frame:' frame]);
|
---|
| 73 | end
|
---|
| 74 |
|
---|