Error in solving an equation

1 次查看(过去 30 天)
Shimon Katzman
Shimon Katzman 2019-11-21
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