]> Creatis software - CreaPhase.git/blob - utilities_LW/Analytical_1D.m
Useful functions for simulations (created by LW, free to use)
[CreaPhase.git] / utilities_LW / Analytical_1D.m
1 ## Copyright (C) 2015 Loriane Weber
2 ## 
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 3 of the License, or
6 ## (at your option) any later version.
7 ## 
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 ## GNU General Public License for more details.
12 ## 
13 ## You should have received a copy of the GNU General Public License
14 ## along with Octave; see the file COPYING.  If not, see
15 ## <http://www.gnu.org/licenses/>.
16
17 ## Analytical_1D
18
19 ## Author: Loriane Weber <lweber@gpid16a-1802>
20 ## Created: 2015-12-04
21
22 %% delta : delta corresponding to the wire material
23 %% u : abscisse, in um
24 %% R : radius of the wire, in um
25 %% u0 : wire center
26 %% delta : coeff delta
27
28 function [ Phi ] = Analytical_1D(delta, u, R, u0)
29
30 if(isscalar(delta) && isscalar(u0) && isscalar(R))
31                 Phi=zeros(size(u));
32                 Phi=2*delta*real(sqrt(R^2-(u-u0).^2));
33 else 
34         disp('delta, radius and center position should be scalars')
35 end
36
37
38 endfunction