Error in solving an equation

조회 수: 1 (최근 30일)
Shimon Katzman
Shimon Katzman 2019년 11월 21일
답변: Priyanshu Mishra 2019년 11월 25일
Hi everyone,
i would like to solve an equallity of two equations that the varaible is "c".
equation 1 - compression
equation 2 - tension
i would like to solve: tension=compression and find out "c"
Thank You
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
epsc1=min(2.8/1000,0.7*fc^0.31/1000);
epscu=3.5/1000;
k=1.05*Ecm*epsc1/fc;
epscm=1.5/1000;
funC=@(epsc) (k*epsc/epsc1-(epsc/epsc1).^2)./(1+(k-2)*epsc/epsc1);
compression=@(c) b*fc*c/epscm*integral(funC,0,epscm)/1000;
tension=@(c) min(Es*(d-c)/c*epscm,fy);
solx=@(c) compression-tension;
x=solve(solx==0,c)

답변 (1개)

Priyanshu Mishra
Priyanshu Mishra 2019년 11월 25일
Hi Shimon,
For solving the function handles, I would suggest you use fsolve. Following is the code with few changes which might help you:
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
epsc1=min(2.8/1000,0.7*fc^0.31/1000);
epscu=3.5/1000;
k=1.05*Ecm*epsc1/fc;
fy = 1;
epscm=1.5/1000;
funC=@(epsc) (k*epsc/epsc1-(epsc/epsc1).^2)./(1+(k-2)*epsc/epsc1);
compression=@(c) b*fc*c/epscm*integral(funC,0,epscm)/1000;
tension=@(c) min(Es*(d-c)/c*epscm,fy);
solx=@(c) b*fc*c/epscm*integral(funC,0,epscm)/1000 - min(Es*(d-c)/c*epscm,fy);
x=fsolve(solx,0)

카테고리

Help CenterFile Exchange에서 Partial Differential Equation Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by