Hello! I have an integral for a function which I plot in polar coordinates at a fixed polar angle theta (th). How to write a 3D plot for R in polar coordinates (angles a and th changes)? I made it using pol2cart, but this is not the best way to present the result. If somebody can help me to plot using polar3D or something like this, it would be great. Thank you.
NOTE:-
This takes too long to run here (it took 336.315050 seconds — 00:05:36.315049 — just now on MATLAB Online) however it plots the surface on a ‘synthetic’ polar coordinate axis in 3D. It would be relatively straightforward to change the Z axis coordinates (or ellimiinate them entirely). The original problem was that the code for the polar axes was not complete. It now works, as it worked in my earlier code.
Try This:
s = 3; n = 1; p = 0.1; % this is time tv = 0:10:360; %3; % this is angle theta for polar rotation r = 1; a = 0:10:360; a = deg2rad(a); tv = deg2rad(tv); tic for k = 1:numel(tv) t = tv(k) b = sqrt(2*n*p); L = sqrt((4*p+r^2)/3); fun = @(k,u,c,a) ((k.^2).*exp(-1.5*k.^2)).*((u.^2).*(1-u.^2).*exp(-(b.*u).^2).*(cos(s.*k.*u.*cos(a)/L))).*(((cos(c)).^2).*(cos(k.*sqrt(1-u.^2).*(s.*sin(a).*cos(t).*cos(c)+s.*sin(a).*sin(t).*sin(c))/(L)))); f3 = arrayfun(@(a)integral3(@(k,u,c)fun(k,u,c,a),0,Inf,-1,1,0,2*pi),a); B = ((6*sqrt(6)*(b^3))/(erf(b)*(pi^2)))*(1-(3/(2*b^2))*(1-((2*b*exp(-b^2))/(erf(b)*sqrt(pi)))))^(-1); R = B*f3; ta = t*ones(size(tv)); [x,y,z] = pol2cart(a, R, ta); X(k,:) = x; Y(k,:) = y;
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment