how can i solve this error
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
i writed this code and i want to integral the sum of Egb and Egs but i get this error
Error using integral (line 82)
First input argument must be a function handle.
and this error
Error in figure (line 28)
Eg=integral(Egs+Egb,0,TETAmax,TETA);
this is the code
clc
clear all
syms TETA
S0=613e9;
Sp=3.7e9;
Rin=27.5e-3;
Rout=31.5e-3;
h=15e-3;
for t=0.001:0.0001:0.0014;
TETAmax=-3.661*((h/t)^-1.14)+2.589;
DELTAmax=h-t-(h/(2*TETAmax));
R=Rin+(t/2);
Egb=pi*S0*(t^2)*((TETA*4*R)+h-(h*cos(TETA)))/((3^(0.5))*(TETA))
Egs=pi*S0*(h^2)*t*(TETA*sin(TETA)+cos(TETA)-1)/(2*(TETA)^2)
Eg=integral(Egs+Egb,0,TETAmax,TETA);
end
what is wrong?thank you for your help.
채택된 답변
Walter Roberson
2020년 8월 2일
0 개 추천
integral() is reserved for numeric integration. You are doing integration of symbolic expression. You need to use int() or vpaintegral() for that.
댓글 수: 12
sajjad barzigar
2020년 8월 2일
편집: sajjad barzigar
2020년 8월 2일
i changed the code and now i am getting this error .what is the problem now?
Attempt to reference field of non-structure array.
Error in isAllVars (line 9)
res = strcmp(mupadmex('symobj::isAllVars',expr.s,0),'TRUE');
Error in sym/int (line 150)
if ~isscalar(x) || ~isAllVars(x)
Error in figure (line 32)
Eg=int(Es,0,TETAmax,TETA)
this is the code:
clc
clear all
syms TETA
S0=613e9;
Sp=3.7e9;
Rin=27.5e-3;
Rout=31.5e-3;
h=15e-3;
for t=0.001:0.0001:0.0014;
TETAmax=-3.661*((h/t)^-1.14)+2.589;
DELTAmax=h-t-(h/(2*TETAmax));
R=Rin+(t/2);
Egb=pi*S0*(t^2)*((TETA*4*R)+h-(h*cos(TETA)))/((3^(0.5))*(TETA));
Egbs=simplify(Egb);
Egs=pi*S0*(h^2)*t*(TETA*sin(TETA)+cos(TETA)-1)/(2*(TETA)^2);
Egss=simplify(Egs);
E=Egbs+Egss;
Es=simplify(E)
Eg=int(Es,0,TETAmax,TETA)
end
please help me .ty
Eg=int(Es, TETA, 0, TETAmax)
sajjad barzigar
2020년 8월 3일
thanks
i want to plot the change in Eg base on the change in t and i used a for loop but it only shows me the Eg fot t=0.0014 but i need a vector so i can plot it.how can i solve this?
clc
clear all
syms TETA
S0=613e9;
Sp=3.7e9;
Rin=27.5e-3;
Rout=31.5e-3;
h=15e-3;
for t=0.001:0.0001:0.0014;
TETAmax=-3.661*((h/t)^-1.14)+2.589;
DELTAmax=h-t-(h/(2*TETAmax));
R=Rin+(t/2);
eg=pi*S0*t*(((3^0.5)*h^2)+2*h*t+4*pi*R*t)/(2*(3^0.5));
pg=eg/(h-2*t);
et=eg+pi*((Rin)^2)*Sp*(h-2*t);
pt=pg+pi*((Rin)^2)*Sp;
Egb=pi*S0*(t^2)*((TETA*4*R)+h-(h*cos(TETA)))/((3^(0.5))*(TETA));
Egbs=simplify(Egb);
Egs=pi*S0*(h^2)*t*(TETA*sin(TETA)+cos(TETA)-1)/(2*(TETA)^2);
Egss=simplify(Egs);
E=Egbs+Egss;
Es=simplify(E);
Eg=int(Es,TETA,0,TETAmax);
end
plot(t,Eg,'g')
grid on
thank you so much for your help
syms TETA
S0=613e9;
Sp=3.7e9;
Rin=27.5e-3;
Rout=31.5e-3;
h=15e-3;
tvals=0.001:0.0001:0.0014; %note this is only 5 values
num_t = length(tvals);
Eg = zeros(1, num_t, 'sym');
for tidx = 1 : num_t
t = tvals(tidx);
TETAmax=-3.661*((h/t)^-1.14)+2.589;
DELTAmax=h-t-(h/(2*TETAmax));
R=Rin+(t/2);
eg=pi*S0*t*(((3^0.5)*h^2)+2*h*t+4*pi*R*t)/(2*(3^0.5));
pg=eg/(h-2*t);
et=eg+pi*((Rin)^2)*Sp*(h-2*t);
pt=pg+pi*((Rin)^2)*Sp;
Egb=pi*S0*(t^2)*((TETA*4*R)+h-(h*cos(TETA)))/((3^(0.5))*(TETA));
Egbs=simplify(Egb);
Egs=pi*S0*(h^2)*t*(TETA*sin(TETA)+cos(TETA)-1)/(2*(TETA)^2);
Egss=simplify(Egs);
E=Egbs+Egss;
Es=simplify(E);
Eg(tidx) = int(Es,TETA,0,TETAmax);
end
Egn = double(Eg);
plot(tvals, Egn, 'g')
grid on
I would recommend that you consider using vpaintegral() instead of int(), and that you consider using more time points
sajjad barzigar
2020년 8월 4일
THANK YOU SO MUCH.
sajjad barzigar
2020년 8월 4일
i want to solve this equation and find teta as a function of t and h.how should i do this?
this is the equation:
(h/t)-(2*teta/(2*sin(teta)-1))=0
i should get this answer from matlab(TETA=-3.661*((h/t)^-1.14)+2.589).how can i get this answer from matlab?
Walter Roberson
2020년 8월 4일
Let h/t = 2 . Then your expression would give -3.661*(2)^-1.14)+2.589 which is about 0.927786186 .
However, 2-(2*teta/(2*sin(teta)-1)) does not have any root near 0.92: the only real root for it is -2.380061273 approximately.
Therefore you should not get that expression, whatever you do get.
sajjad barzigar
2020년 8월 4일
i got this equation and the answer from this article(experimental and theoretical investigations on axial crushing of aluminum foam-filled grooved tube(Yao2019))which you can easily find in google scholar.
in this article in equation 5 and 6 you can see that the authur mentions that the answer to the equation is the answer that i mentioned before.i dont know i am wrong or they are because thats an approved and published article.they said by using matlab you can solve the equation and find the answer below.
(TETA=-3.661*((h/t)^-1.14)+2.589).
are they wrong or i am ?
Walter Roberson
2020년 8월 4일
What is the valid range of values for h/t ? Sometimes equations are approximately valid within a particular range of interest while being too wrong outside of the area of interest.
sajjad barzigar
2020년 8월 4일
normaly between 12 to 20 i think.but they didnt mention any kind of valid range for the answer.
sajjad barzigar
2020년 8월 4일
any way thank you for every thing :)
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
