rbmatlab 0.10.01
datafunc/velocity/velocity_richards.m
00001 function [vel,lambda] = velocity_richards(glob, params)
00002 %function [vel,lambda] = velocity_richards(glob, params)
00003 %
00004 % function evaluating a function in the list of global coordinates
00005 % specified in the columns of glob. Result is a matrix of velocity
00006 % vectors as columns of vel.
00007 %
00008 %
00009 % Linear combination of components by coefficients then yields the
00010 % complete evaluation.
00011 
00012 % Martin Drohmann 23.9.2009
00013 
00014 % glob column check
00015 if params.debug
00016   if ~isempty(glob) && size(glob,1) < size(glob,2)
00017     warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
00018     if params.debug > 2
00019       keyboard;
00020     end
00021   end
00022 end
00023 X = glob(:,1);
00024 vel = zeros(length(X),2);
00025 
00026 %      p_mu    = spline_select(model);
00027 %      [ breaks, coeffs, pieces, order ] = unmkpp(p_mu);
00028 %      p_mu_d  = mkpp(breaks, coeffs(1:order-1) .* [order-1:-1:1]);
00029 
00030 %      denom = 1 + ppval(p_mu, X);
00031 [res1, res2] = inv_geo_trans_derivative(params,glob,{1,2,[1,1],[1,2]},...
00032                                                     {1,2,[2,1],[2,2]},2);
00033 d1  = res1{3} + res2{3};
00034 d2  = res1{4} + res2{4};
00035 vel(:,1) = ( -params.k .* (res1{1} .* d1 + res1{2} .* d2) );
00036 vel(:,2) = ( -params.k .* (res2{1} .* d1 + res2{2} .* d2) );
00037 
00038 lambda = 0;
00039 %| \docupdate 
All Classes Namespaces Files Functions Variables