What is the difference between them?

조회 수: 1 (최근 30일)
zhenyu zeng
zhenyu zeng 2019년 7월 17일
편집: Stephen23 2019년 7월 17일
These code are right:
a=0.336;
Ta=9.476;
Te=1.208;
Tw=1.498;
eqh=[0.661;0.619;0.568];
ex=[-1.24;-1.346;-1.441];
en=-ex;
ey=[0.376;0.705;0.968];
eqx=[-0.309;-0.357;-0.392];
eh=[1.594;1.583;1.545];
eyqh=[0.642;0.78;0.897];
a0=a*Ta*Te^2;
syms bt Td Ki Kp;
a1=[];a2=[];a3=[];a4=[];exqh=[];
for i=1:3
Kp=1/bt;
exqh(i)=en(i)*eqh(i)+eqx(i)*eh(i);
Ki=1/(bt*Td);
a1=Ta*Tw*eqh(i)+a*Te^2*en(i)+a*Te^2*ey(i)*Kp
a1(i)=a1
end
But these code are wrong:
a=0.336;
Ta=9.476;
Te=1.208;
Tw=1.498;
eqh=[0.661;0.619;0.568];
ex=[-1.24;-1.346;-1.441];
en=-ex;
ey=[0.376;0.705;0.968];
eqx=[-0.309;-0.357;-0.392];
eh=[1.594;1.583;1.545];
eyqh=[0.642;0.78;0.897];
a0=a*Ta*Te^2;
syms bt Td Ki Kp;
a1=[];a2=[];a3=[];a4=[];exqh=[];
for i=1:3
Kp=1/bt;
exqh(i)=en(i)*eqh(i)+eqx(i)*eh(i);
Ki=1/(bt*Td);
a1(i)=Ta*Tw*eqh(i)+a*Te^2*en(i)+a*Te^2*ey(i)*Kp
end
The difference between them is
a1=Ta*Tw*eqh(i)+a*Te^2*en(i)+a*Te^2*ey(i)*Kp
a1(i)=a1
and
a1(i)=Ta*Tw*eqh(i)+a*Te^2*en(i)+a*Te^2*ey(i)*Kp

답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by