How do I create a complex geometry for heat transfer analysis?
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to model heat and mass transfer during transpiration and I'm having trouble creating the geometry of a leaf. I have the following geometry model:
if 0 <= epsilon < 0.015 n = 0.5*(nmax-0.0004)*(1-cos(2*pi*epsilon/0.03))+0.0004 elseif 0.015 <= epsilon <= 0.03 n = nmax*sqrt(1-(4/0.0009)*(epsilon-0.015)^2)
where epsilon is the x axis and n is the y axis. The value of n needs to be plotted + and - to create the leaf shape.
How do I plot this shape? I get an empty figure when I run this code. Thanks in advance for your assistance!
0 个评论
回答(1 个)
Mukul Rao
2017-4-24
编辑:Mukul Rao
2017-4-24
Hi,
Here is a code snippet that shows you how to plot the leaf, essentially you are also plotting the reflection of "n" along the X axis. If you have a parametric equation for the leaf that covers both quadrants, then you need not have any special treatment for the "reflection"
epsilons = linspace(0,0.03,50);
nmax = 1;
n = zeros(length(epsilons),1);
for i = 1:length(epsilons)
epsilon = epsilons(i);
if (0 <= epsilon && epsilon < 0.015)
n(i) = 0.5*(nmax-0.0004)*(1-cos(2*pi*epsilon/0.03))+0.0004;
elseif (0.015 <= epsilon && epsilon <= 0.03)
n(i) = nmax*sqrt(1-(4/0.0009)*(epsilon-0.015)^2);
end
end
plot(epsilons,n,epsilons,-n);
xlabel('epsilon');
ylabel('n');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geometry and Mesh 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!