Home > src > demos > reentry_demo > reentry_f.m

# reentry_f

## PURPOSE

Dynamical model function for reentry problem.

## SYNOPSIS

function x = reentry_f(xw,param)

## DESCRIPTION

``` Dynamical model function for reentry problem.
Discretization is done using a simple Euler
time integration.```

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:
• make_reentry_data Cenerate data of discrete-time re-entry mechanics
• reentry_cond Compute condition numbers of transition matrices
• reentry_demo % Discrete-time reentry dynamics demonstration with non-linear filters
• reentry_if Inverse dynamical function for reentry demo.

## SOURCE CODE

```0001 % Dynamical model function for reentry problem.
0002 % Discretization is done using a simple Euler
0003 % time integration.
0004
0005 %
0006 % Copyright (C) 2005-2006 Simo S�kk�%               2007      Jouni Hartikainen
0007 %
0008 % This software is distributed under the GNU General Public
0009 % Licence (version 2 or later); please refer to the file
0010 % Licence.txt, included with the software, for details.
0011
0012 function x = reentry_f(xw,param)
0013
0014   dt  = param{1};
0015   b0  = param{2};
0016   H0  = param{3};
0017   Gm0 = param{4};
0018   R0  = param{5};
0019
0020   x = xw(1:5,:);
0021
0022   R = sqrt(x(1,:).^2 + x(2,:).^2);
0023   V = sqrt(x(3,:).^2 + x(4,:).^2);
0024   b = b0 * exp(x(5,:));
0025   D = b .* exp((R0-R)/H0) .* V;
0026   G = -Gm0 ./ R.^3;
0027   dot_x = zeros(size(x));
0028   dot_x(1,:) = x(3,:);
0029   dot_x(2,:) = x(4,:);
0030   dot_x(3,:) = D .* x(3,:) + G .* x(1,:);
0031   dot_x(4,:) = D .* x(4,:) + G .* x(2,:);
0032   dot_x(5,:) = zeros(1,size(x,2));
0033
0034   % Euler integration
0035   x = x + dt * dot_x;
0036
0037   % Add process noise if the state is augmented
0038   if size(xw,1) > 5 && length(param) > 5
0039     L   = param{6};
0040     w = xw(size(L,1)+1:size(L,1)+size(L,2),:);
0041     x = x + L * w;
0042   end
0043```

Generated on Fri 12-Aug-2011 15:15:16 by m2html © 2005