//warunki brzegowe
Q=vq*lambda^4/E;
G(1,2)=1; G(1,3)=-2; G(1,4)=1;
G(2,1)=-1; G(2,2)=2; G(2,4)=-2; G(2,5)=1;
Q(2)=2*P1*lambda^3/(E*I1);
//G($-1,81)=-1; G($-1,82)=2; G($-1,84)=-2; G($-1,85)=1;
//Q(83)=0;
//G($,82)=1; G($,83)=-2; G($,84)=1;
G($-1,83)=1;
G($,82)=-1; G($,84)=1;
G(13,:)=0; G(:,13)=0;
Q(13)=0; vk(13)=0; G(13,13)=1;
G(73,:)=0; G(:,73)=0;
Q(73)=0; vk(73)=0; G(73,73)=1;
//Rozwi¹zanie uk³adu równañ
W=inv(G)*Q';
//Obliczenie pozosta³ych wielkoœci
fi=zeros(zakres, 1);
M=zeros(fi);
T=zeros(fi);
R=zeros(fi);
for i=3:(zakres-2) do
fi(i)=(-W(i-1)+W(i+1))/(2*lambda);
M(i)=-E*vJ(i)*(W(i-1)-2*W(i)+W(i+1))/(lambda^2);
T(i)=-E*(-vJ(i-1)*(W(i-2)-2*W(i-1)+W(i))+vJ(i+1)*(W(i)-2*W(i+1)+W(i+2)))/(2*lambda^3);
R(i)=vk(i)*W(i)*wwj(i);
end
fi=fi(3:zakres-2);
M=M(3:zakres-2);
T=T(3:zakres-2);
R=R(3:zakres-2);
//Usuniêcie wszystkich otwartych okien graficznych:
xdel(winsid());
//Wykres ugiêæ:
xinit();
plot2d((0:(zakres-5))*lambda, W(3:(zakres-2)), [1], rect=[0, 1.1*min(W), (zakres-5)*lambda, 1.1*max(W)]);
plot2d((0:(zakres-5))*lambda, zeros(1,(zakres-4)), [1]);
xname("Ugiêcia");
xtitle('Ugiêcia', 'x[m]', 'w[m]');
wy1=gcf();
wy1.children.axes_reverse = ["off","on","off"];
wy1.children.children.children(2).thickness=3;
//Wykres k¹tów obrotu:
xinit();
plot2d((0:(zakres-5))*lambda, fi, [1], rect=[0, 1.1*min(fi), (zakres-5)*lambda, 1.1*max(fi)]);
plot2d((0:(zakres-5))*lambda, zeros(1,(zakres-4)), [1]);
xname("K¹ty obrotu");
xtitle('K¹ty obrotu', 'x[m]', 'fi[rad]');
wy2=gcf();
wy2.children.axes_reverse = ["off","on","off"];
wy2.children.children.children(2).thickness=3;
//Wykres momentów:
xinit();
plot2d((0:(zakres-5))*lambda, M, [1], rect=[0, 1.1*min(M), (zakres-5)*lambda, 1.1*max(M)]);
plot2d((0:(zakres-5))*lambda, zeros(1,(zakres-4)), [1]);
xname("Momenty");
xtitle('Momenty', 'x[m]', 'M[kNm]');
wy3=gcf();
wy3.children.axes_reverse = ["off","on","off"];
wy3.children.children.children(2).thickness=3;
//Wykres tn¹cych:
xinit();
plot2d((0:(zakres-5))*lambda, T, [1], rect=[0, 1.1*min(T), (zakres-5)*lambda, 1.1*max(T)]);
plot2d((0:(zakres-5))*lambda, zeros(1,(zakres-4)), [1]);
xname("Tn¹ce");
xtitle('Tn¹ce', 'x[m]', 'T[kN]');
wy4=gcf();
wy4.children.axes_reverse = ["off","on","off"];
wy4.children.children.children(2).thickness=3;
//Wykres odporu gruntu:
xinit();
plot2d((0:(zakres-5))*lambda, R, [1], rect=[0, 1.1*min(R), (zakres-5)*lambda, 1.1*max(R)]);
plot2d((0:(zakres-5))*lambda, zeros(1,(zakres-4)), [1]);
xname("Odpór gruntu");
xtitle('Odpór gruntu', 'x[m]', 'r[kN/m]');
wy5=gcf();
wy5.children.axes_reverse = ["off","on","off"];
wy5.children.children.children(2).thickness=3;
//Zapisanie wyników do plików:
wyn=[W(3:(zakres-2)), fi, M, T, R];
savematfile('wyniki.txt', 'wyn', '-ascii');