rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
velocity_richards.m
1 function [vel,lambda] = velocity_richards(glob, params)
2 %function [vel,lambda] = velocity_richards(glob, params)
3 %
4 % function evaluating a function in the list of global coordinates
5 % specified in the columns of glob. Result is a matrix of velocity
6 % vectors as columns of vel.
7 %
8 %
9 % Linear combination of components by coefficients then yields the
10 % complete evaluation.
11 
12 % Martin Drohmann 23.9.2009
13 
14 % glob column check
15 if params.debug
16  if ~isempty(glob) && size(glob,1) < size(glob,2)
17  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
18  if params.debug > 2
19  keyboard;
20  end
21  end
22 end
23 X = glob(:,1);
24 vel = zeros(length(X),2);
25 
26 % p_mu = spline_select(model);
27 % [ breaks, coeffs, pieces, order ] = unmkpp(p_mu);
28 % p_mu_d = mkpp(breaks, coeffs(1:order-1) .* [order-1:-1:1]);
29 
30 % denom = 1 + ppval(p_mu, X);
31 [res1, res2] = inv_geo_trans_derivative(params,glob,{1,2,[1,1],[1,2]},...
32  {1,2,[2,1],[2,2]},2);
33 d1 = res1{3} + res2{3};
34 d2 = res1{4} + res2{4};
35 vel(:,1) = ( -params.k .* (res1{1} .* d1 + res1{2} .* d2) );
36 vel(:,2) = ( -params.k .* (res2{1} .* d1 + res2{2} .* d2) );
37 
38 lambda = 0;
39 %| \docupdate
function [ P1res , P2res ] = inv_geo_trans_derivative(model, glob, P1derivates, P2derivates, callerid)
computes entries of a geometry transformation function's inverse transposed jacobian ...