empty sym 0-by-1 error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Maya Venugopalan
am 7 Okt. 2020
Bearbeitet: Walter Roberson
am 7 Okt. 2020
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 Kommentare
Walter Roberson
am 7 Okt. 2020
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
Akzeptierte Antwort
Walter Roberson
am 7 Okt. 2020
Bearbeitet: Walter Roberson
am 7 Okt. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!