rbmatlab 0.10.01
|
00001 function reaction = reaction_term(X, Y, U, params) 00002 00003 if isfield(params, 'geometry_transformation') 00004 00005 if isequal(params.geometry_transformation, 'spline') 00006 % x_hill = params.geometry_transformation_spline_x; 00007 % y_hill = params.geometry_transformation_spline_y; 00008 % y_hill(2) = params.hill_height; 00009 p_mu = spline_select(params); 00010 [ breaks, coeffs, pieces, order ] = unmkpp(p_mu); 00011 p_mu_d = mkpp(breaks, coeffs(:,1:order-1) .* repmat(order-1:-1:1,pieces,1)); 00012 [ breaks, coeffs, pieces, order ] = unmkpp(p_mu_d); 00013 if order == 1 00014 p_mu_dd = mkpp(breaks, zeros(size(coeffs))); 00015 else 00016 p_mu_dd = mkpp(breaks, coeffs(:,1:order-1) .* repmat(order-1:-1:1,pieces,1)); 00017 end 00018 00019 div = 1 + ppval(p_mu, X); 00020 rec = 2 .* (ppval(p_mu_d,X) ./ div).^2 - ppval(p_mu_dd, X) ./ div; 00021 00022 reaction = 0.001 .* rec .* U; 00023 end 00024 00025 end; 00026 00027 % TO BE ADJUSTED TO NEW SYNTAX 00028 %| \docupdate