empty sym 0-by-1 error
조회 수: 11 (최근 30일)
이전 댓글 표시
syms c
delta = 0.0158;
alp = 6;
a = alp*delta;
Re = 1000;
y = 0.5;
y1 = y*delta;
U = (-357554.879*y1^2 + 11298.734*y1)/89.26;
ddU = -2;
l3 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))+((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
l4 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))-((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
eqn = subs((U-c)*((l3^2*exp(l3*y) - l4^2*exp(l4*y)) - (a^2*(exp(l3*y)-exp(l4*y))))-(ddU*(exp(l3*y)-exp(l4*y)))-((1/(a*Re*1i))*(((l3^4*exp(l3*y))-(l4^4*exp(l4*y)))-(2*a^2*(l3^2*exp(l3*y) - l4^2*exp(l4*y))) + a^4*(exp(l3*y)-exp(l4*y)))));
answer = vpasolve(eqn,c)
In this particular code, for alp = 6,8,12,13,, the output is an error, "empty sym 0-by-1". But for alp values like 1,2,3,4,5,7,..I am getting values of c. I actualy want all the values of c when alp varies from 1 to 20
Can somebody help me with the solution?
Thank you!!
댓글 수: 4
Walter Roberson
2020년 10월 7일
syms c
delta = 0.0158;
alp = 6;
a = alp*delta;
Re = 1000;
y = 0.5;
y1 = y*delta;
U = (-357554.879*y1^2 + 11298.734*y1)/89.26;
ddU = -2;
l3 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))+((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
l4 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))-((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
eqn = subs((U-c)*((l3^2*exp(l3*y) - l4^2*exp(l4*y)) - (a^2*(exp(l3*y)-exp(l4*y))))-(ddU*(exp(l3*y)-exp(l4*y)))-((1/(a*Re*1i))*(((l3^4*exp(l3*y))-(l4^4*exp(l4*y)))-(2*a^2*(l3^2*exp(l3*y) - l4^2*exp(l4*y))) + a^4*(exp(l3*y)-exp(l4*y)))));
answer = vpasolve(simplify(eqn),c)
Which release are you using? It works in R2020a and R2020b
채택된 답변
Walter Roberson
2020년 10월 7일
편집: Walter Roberson
2020년 10월 7일
syms c
delta = 0.0158;
alp = 6;
a = alp*delta;
Re = 1000;
y = 0.5;
y1 = y*delta;
U = (-357554.879*y1^2 + 11298.734*y1)/89.26;
ddU = -2;
l3 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))+((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
l4 = -((-((a*Re*c*1i)-(2*a^2)-(a*Re*U*1i))-((2*a^2*Re^2*U*c)-(a^2*Re^2*(U^2+c^2))-(4*a*Re*ddU*1i))^(1/2))/2)^(1/2);
eqn = subs((U-c)*((l3^2*exp(l3*y) - l4^2*exp(l4*y)) - (a^2*(exp(l3*y)-exp(l4*y))))-(ddU*(exp(l3*y)-exp(l4*y)))-((1/(a*Re*1i))*(((l3^4*exp(l3*y))-(l4^4*exp(l4*y)))-(2*a^2*(l3^2*exp(l3*y) - l4^2*exp(l4*y))) + a^4*(exp(l3*y)-exp(l4*y)))));
answer = vpasolve(simplify(eqn),c)
Note: my research suggested that there might be up to three solutions, with the real and imaginary parts all within +/- 2 . It was difficult to tell whether some of the locations reached zero or just came close to zero.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!