# ERROR : "Input arguments must be convertible to floating-point numbers"

15 ビュー (過去 30 日間)
Shimon Katzman 2019 年 11 月 22 日
Commented: Star Strider 2019 年 11 月 23 日
Hi everyone, im getting this error:
Error using sym/min (line 98)
Input arguments must be convertible to floating-point numbers.
tension= min(Es*(d-c)/c*epscm*As/1000,fy*As/1000);
i guess the problem is that i use "c" before i solved it, how else can i find "c" from the equation compression= tension?
thank you very much.
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
As=2400; %mm^2
fy=400; %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;
syms c
funC=@(epsc) (k*epsc/epsc1-(epsc/epsc1).^2)./(1+(k-2)*epsc/epsc1);
compression= b*fc*c./epscm*integral(funC,0,epscm)/1000;
tension= min(Es*(d-c)/c*epscm*As/1000,fy*As/1000);
solc= compression==tension;
c=solve(solc,c)

#### 1 件のコメント

Shimon Katzman 2019 年 11 月 22 日

サインイン to comment.

### 採用された回答

Walter Roberson 2019 年 11 月 23 日
Replace
tension= min(Es*(d-c)/c*epscm*As/1000,fy*As/1000);
with
tension = piecewise(Es*(d-c)/c*epscm*As/1000<=fy*As/1000,Es*(d-c)/c*epscm*As/1000,fy*As/1000)
Replace
funM=@(epsc)(k*epsc/epsc1-(epsc/epsc1).^2)./(1+(k-2)*epsc/epsc1)*(d-c+(c/epscm)*epsc);
with
funM=@(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c+(c./epscm).*epsc);

#### 3 件のコメント

Shimon Katzman 2019 年 11 月 23 日
Walter hi and thank you.
i replaced funM and it works well but without the loop.
once i add the loop, again it Errors.
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
As=2400; %mm^2
fy=400; %Mpa
epsc1=min(2.8/1000,0.7*fc^0.31/1000);
epscu=3.5/1000;
k=1.05*Ecm*epsc1/fc;
epscmv = linspace(0.05, 3.5, 50)*1E-3;
for i=1:50(epscmv);
epscm = epscmv(i);
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*As/1000,fy*As/1000);
c(i)=fsolve(@(c) compression(c)-tension(c),1);
funM=@(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c+(c./epscm).*epsc);
M(i)=b*fc*c/epscm*integral(funM,0,epscm)/1000000;
end
plot(epscmv, M)
grid on
xlabel('epscm')
ylabel('M')
Error:
Error using .*
Matrix dimensions must agree.
Error in @(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c+(c./epscm).*epsc)
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
M(i)=b*fc*c/epscm*integral(funM,0,epscm)/1000000;
but without the loop:
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
As=2400; %mm^2
fy=400; %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*As/1000,fy*As/1000);
c=fsolve(@(c) compression(c)-tension(c),1);
funM=@(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c+(c./epscm).*epsc);
M=b*fc*c/epscm*integral(funM,0,epscm)/1000000
it works fine:
M =
331.2854
Walter Roberson 2019 年 11 月 23 日
Change
funM=@(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c+(c./epscm).*epsc);
M(i)=b*fc*c/epscm*integral(funM,0,epscm)/1000000;
to
funM=@(epsc)(k*epsc./epsc1-(epsc./epsc1).^2)./(1+(k-2)*epsc./epsc1).*(d-c(i)+(c(i)./epscm).*epsc);
M(i)=b*fc*c(i)/epscm*integral(funM,0,epscm)/1000000;
Shimon Katzman 2019 年 11 月 23 日
THANK YOU VERY MUCH!!!
another question, how do i stop the loop when M(i) gets to the maximum and how can i know what value is the maximum from the graph?

サインイン to comment.

Star Strider 2019 年 11 月 22 日
The min function is not compatible with symbolic objects, for obvious reasons.
b=300; %mm
d=400; %mm
fc=40; %Mpa
Ecm=22*(fc/10)^0.3*10^3; %Mpa
Es=200000; %Mpa
As=2400; %mm^2
fy=400; %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*As/1000,fy*As/1000);
c=fsolve(@(c) compression(c)-tension(c), 1 )
producing (with this initial parameter estimate):
c =
154.2368

#### 6 件のコメント

Star Strider 2019 年 11 月 23 日
I was sleeping when you posted that (night here), and just now saw it.
Oh, well ...
Star Strider 2019 年 11 月 23 日
My pleasure.
I appreciate the reference. I have posted my Answer.

サインイン to comment.

サインイン してこの質問に回答します。

Translated by