From e4eb59bec6b06e2808e3108274e607b2b0db64ac Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 3 May 2018 16:05:00 +0200 Subject: [PATCH] Calcul moving max of pod --- Position_max.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Position_max.m diff --git a/Position_max.m b/Position_max.m new file mode 100644 index 0000000..d079695 --- /dev/null +++ b/Position_max.m @@ -0,0 +1,23 @@ +lmax = 80e-6; + +theta = linspace(0, 2*pi, 100); +phi = linspace(-pi/2 , pi/2, 100); +dmax = zeros(length(theta), length(phi)); + +for i = 1:length(theta) + for j = 1:length(phi) + L = J*[cos(phi(j))*cos(theta(i)) cos(phi(j))*sin(theta(i)) sin(phi(j)) 0 0 0]'; + lmaxbis = max(abs(L)); + dmax(i, j) = lmax/lmaxbis; + end +end + +X = dmax.*cos(repmat(phi,length(theta),1)).*cos(repmat(theta,length(phi),1))'; +Y = dmax.*cos(repmat(phi,length(theta),1)).*sin(repmat(theta,length(phi),1))'; +Z = dmax.*sin(repmat(phi,length(theta),1)); + +figure; +hold on; +mesh(X, Y, Z); +colorbar; +hold off; \ No newline at end of file