Plot: How to reflect a curve and multiply by another curve to produce 3d plot.

1 次查看(过去 30 天)
Hello,
  1. I am looking to reflect a curve that I have generated (see below for reference) about y=50 ( a vertical line)
Result should be a "U" shaped curve
2. And then multiply that to a generated guassian beam shown below:
= To produce a 3d ( probably a mesh) of the resultant. Expecting a cylinder as the product.
Kindly requesting help with 1 .reflection and 2. multiplication part.
Below is my code of the
1. Curve to be reflected and
2. The guassian beam that should be multipled with the above resulting U shaped curve after reflection.
%% Plotting the curve to be reflected
clc
clear
clear all
clear var
close all
% Known
Io = 1;
z_Cu = 1800; % microns
z_PMMA = 50; % microns
% Absorption coefficient, mu
lamda = 7.1255e-5; %micron
k = (2*pi)/lamda; % (micron)^-1
beta_Cu = 2.590970004E-07; % From https://henke.lbl.gov/optical_constants/
beta_PMMA = 5.03136866E-10; % From https://henke.lbl.gov/optical_constants/
% Absorption coefficient, mu = 2*beta*k
mu_Cu = beta_Cu*2*k; %(micron)^-1
mu_PMMA = beta_PMMA*2*k; %(micron)^-1
% Generating the Curve to be reflected
% I = Io*e −[(µ1+µ1)*(z1+z2)]
start = 0;
End =50;
points = 50 % for micron steps
steps = (z_Cu+z_PMMA)/(points-1);
for i=1:points
% I(i) = Io*exp(-1*(mu_PMMA+mu_Cu)*(steps*(i-1)));
I_wt(i)=Io*exp(-1*(0.025*mu_PMMA+0.975*mu_Cu)*(steps*(i-1)));
end
figure(1)
plot(I_wt,'r')
title(' Transmission Intensity weight composition for Cu wire')
grid on
grid minor
set(gca,'YLim',[0,1]);
yticks(0 :0.1 :1)
set(gca,'XLim',[0,100]);
xticks(0 :10 :100)
%set(gca,'XTick',x)
xlabel('$\Delta z$ (microns)','interpreter','latex');
ylabel('$I$ $\frac{i}{i_0}$ (arb.)','interpreter','latex');
%% Reflection of the above curve
% Reflect the curve y=50
% NEED HELP!!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
%% Generating a Guass beam to multiple with the U shaped resulting curve after refection
clear all
clear
clc
clear var
xrange = 2;
yrange = 2;
xo =1;
yo=1;
xpoints=200;
ypoints=200;
xinc = xrange/(xpoints-1);
yinc = yrange/(ypoints-1);
for ii = 1:xpoints
x(ii)= 1-xrange + xinc*(ii-1);
for jj = 1: ypoints
y(jj) = 1-yrange + yinc*(jj-1);
% z(ii,jj)=((x(ii))^2 + (y(ii))^2);%
z(ii,jj)=x(ii)*y(jj);
I(ii,jj) = exp((-1*z(ii,jj)^2));
% I(ii,jj) = exp(-1*((x(ii) -xo)^2 + (y(ii) - yo)^2));
end
end
%% Plotting the resulting 3d image /mes
% NEED HELP - Would expect a cylindrical image as the result of multiplying
% the above curves

采纳的回答

William Rose
William Rose 2022-5-10
You said you imagine a cylinder. That suggests you want to rotate the reflected 2D curve about its middle. Is that correct? The Gaussian surface covers a square area. How do you want to handle the corners of the square 2D Gaussian? Or, to put it another way, how fdo you want to extend the cylinder obtained by rotating the U into the corners of a square area?
When reflected, the 1D curve will span 100 um. The 2D Gaussian is 50 x 50 um. If you center the 100 um wide cylinder over the 50x50 Gaussian, the edges of the cylinder (the non-zero parts) will be outside the 50x50 um Gaussian. Therefore please clarify how you want to scale the sizes of the two surfaces.
Or do you want a 2D convolution of two 2D functions?
More in a bit.
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by