Can someone please explain this code to me?
显示 更早的评论
I have this code for a project and the professor is not giving us any explanation on how to manipulate this code or what this does.
clc;
close all;
clear all;
MeanWallShearStress=15;
DynamicViscosity=0.029;
DensityofBlood=1.05;
VelocityMax=40;
Radius=0.55995;
frequency=2*pi;
acceleration=Radius*sqrt((frequency*DensityofBlood)/DynamicViscosity);
a=[20 18 4];
time=[0 0.2 0.3 0.4];
phase=[0 -0.5236 2.618];
diameterRatio=-1:0.0005:1;
saveName = strcat('WomersleyFlow');
saveArray = [];
WFavi = VideoWriter('saveName.avi','MPEG-4');
for jumpA=1:length(a)
MP(jumpA)=a(jumpA)*abs(((i*DynamicViscosity*acceleration^2)/Radius^2)*(besselj(0,(i^1.5)*acceleration))/(1-besselj(0,(i^1.5)*acceleration)));
end
for jumpB=1:length(phase)
PP(jumpA) = phase(jumpA)-angle((Radius^2/(DynamicViscosity*acceleration^2))*(1-besselj(0,acceleration*i^1.5))/besselj(0,(i^1.5)*acceleration));
end
for jumpC=1:length(time)
for jumpD=1:length(diameterRatio)
VelocityEnd(jumpD)=0;
Vel(jumpD)=VelocityMax*(1-diameterRatio(jumpD)^2);
for jumpE=1:length(phase)
velocity(jumpE)=real(((MP(jumpE)*Radius^2/(i*DynamicViscosity*acceleration^2))*((besselj(0,acceleration*diameterRatio(jumpD)*i^1.5)/besselj(0,i^1.5*acceleration))-1)*exp(i*(jumpE*frequency*time(jumpC)+PP(jumpE)))));
VelocityEnd(jumpD)=VelocityEnd(jumpD)+velocity(jumpE);
end
VelocityEnd(jumpD)=VelocityEnd(jumpD)+ Vel(jumpD);
end
figure(jumpC)
plot(diameterRatio, VelocityEnd);
title(strcat('The Velocity Profile at time :',num2str(time(jumpC))));
ylim([-10 50]);
xlabel('Radius');
ylabel('Velocity');
saveArray(jumpC) = jumpC;
WFmovie(jumpC) = getframe(jumpC);
open(WFavi);
for movieFrame=1:6
writeVideo(WFavi,WFmovie(jumpC));
end
end
close(WFavi);
save(strcat(saveName,'.mat'));
for i = 1:length(saveArray);
saveas(i,strcat(saveName,'_for Time t=',num2str(time(i)),'.tif'),'tiff');
end
回答(1 个)
Walter Roberson
2017-11-9
1 个投票
No. We have no idea what your computing skills are or what your experience in MATLAB is, or whether you know anything about mathematics or about the physics the code seems to be modeling. You also gave no indication of what kind of "manipulation" you were thinking of.
Effectively you are asking us to write a minimum of three textbooks: one about MATLAB, one about physics, and one about software engineering. We are not going to do that.
You need to ask specific questions. And the first one thing you should ask should be of the professor, and you should be asking the professor where the comments and documentation for the program are.
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!