]> Creatis software - CreaPhase.git/blobdiff - utilities_LW/Analytical_1D.m
Useful functions for simulations (created by LW, free to use)
[CreaPhase.git] / utilities_LW / Analytical_1D.m
diff --git a/utilities_LW/Analytical_1D.m b/utilities_LW/Analytical_1D.m
new file mode 100644 (file)
index 0000000..0db8f94
--- /dev/null
@@ -0,0 +1,38 @@
+## Copyright (C) 2015 Loriane Weber
+## 
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## Analytical_1D
+
+## Author: Loriane Weber <lweber@gpid16a-1802>
+## Created: 2015-12-04
+
+%% delta : delta corresponding to the wire material
+%% u : abscisse, in um
+%% R : radius of the wire, in um
+%% u0 : wire center
+%% delta : coeff delta
+
+function [ Phi ] = Analytical_1D(delta, u, R, u0)
+
+if(isscalar(delta) && isscalar(u0) && isscalar(R))
+               Phi=zeros(size(u));
+               Phi=2*delta*real(sqrt(R^2-(u-u0).^2));
+else 
+       disp('delta, radius and center position should be scalars')
+end
+
+
+endfunction