plot results with small value difference between each data
3 次查看(过去 30 天)
显示 更早的评论
I calculated the convergence results with there a pair of plot. One is for the calculation value and the other is for the increment between the current value to previes value. However, because the difference between each value is to small to show the continue line for the increment plot and calculation value shown in the y-axis with a long floating point number, I would like to ask if there is another appropiate way to show such a long floating point number and make the continuous line of increment. Thank you very much!
clc
clear
v=0.3;
E=(209e+3)*10^6;
G=E/(2*(1+v));
q=-0.1*10^6;
h=15*10^(-3);
D=(E*h^3)/(12*(1-v^2));
I=(h^3)/12;
a=600*(10^-3);b=2400*(10^-3);
syms x y
c=7
for f = 1:c
k=[3:2:1+2*c];
mn{f}= 1:2:k(f)
end
NDAT=[1:c];
DisDAT=0*NDAT;
DDAT=0*NDAT;
x=300*(10^-3);
y=0;
combine_Mx_prime2=sym(zeros(1,c));
for f=1:c
N=NDAT(f);
len=length(mn{f});
rfa_m=zeros(1,len);
for i=1:len
m=mn{f}(i)
rfa_m(i)= (m.*pi*b)./(2*a)
end
Am=zeros(1,len);
for i=1:len
m=mn{f}(i)
Am(i)=-2*(rfa_m(i)*tanh(rfa_m(i))+2)./((pi^5)*(m^5)*cosh(rfa_m(i)))
end
Bm=zeros(1,len);
for i=1:len
m=mn{f}(i)
Bm(i)=2./((pi^5)*(m^5)*cosh(rfa_m(i)))
end
Mx_prime=q*x*(a-x)/2;
Mx_prime2=zeros(1,len);
for i=1:len
m=mn{f}(i)
Mx_prime2(i)=(1-v)*q*(a^2)*(pi^2)*(sum((m.^2).*((Am(i).*cosh(m.*pi.*y/a))+Bm(i).*(((m.*pi.*y/a).*...
(sinh(m.*pi.*y/a)))-(2*v/(1-v))*cosh(m.*pi.*y/a))).*sin(m.*pi.*x/a)))
end
combine_Mx_prime2(f)=sum(Mx_prime2);
Mx=vpa(double((Mx_prime+combine_Mx_prime2)))
if f>1
DDAT(f)=abs(Mx(f)-Mx(f-1))
end
subplot(121);
plot(Mx,'r*-');
xlim([min(NDAT) max(NDAT)]);
xlabel('Number of mn in Series');
ylabel('Mx (N.m/m)');
title({'Convergence of Mx';'At X=0.3(m) Y=0(m)'})
set(gca, 'FontSize', 10);
drawnow
subplot(122);
semilogy(NDAT,DDAT,'b+-');
xlabel('Number of Increments');
ylabel('Increments');
title({'Increments of Mx';'At X=0.3(m) Y=0(m)'})
set(gca,'FontSize', 10);
drawnow
end
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!