Re: 聯立方程式求解

作者: ksr310135 (馨右小小)   2016-10-25 00:58:06
function fuckU
x=fsolve(@myfun,[128 105 104 52]);
plot(x,'o','linewidth',10)
set(gca,'Xtick',[1:4],'XTickLabel',{'P1','P2','P3','P4'})
xlabel('各處')
ylabel('壓力')
title('各處之壓力')
grid on
function F=myfun(P)
F(1)=0.3*sqrt(500-P(1))-0.2*sqrt(P(1)-P(2))-0.2*(P(1)-P(3));
F(2)=0.2*sqrt(P(1)-P(2))-0.1*sqrt(P(2)-P(4))-0.2*sqrt(P(2)-P(3));
F(3)=0.1*sqrt(P(1)-P(3))+0.2*sqrt(P(2)-P(3))-0.1*sqrt(P(3)-P(4));
F(4)=0.1*sqrt(P(2)-P(4))+0.1*sqrt(P(3)-P(4))-0.2*sqrt(P(4));

Links booklink

Contact Us: admin [ a t ] ucptt.com