empty sym 0-by-1 error
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Maya Venugopalan
le 7 Oct 2020
Modifié(e) : Walter Roberson
le 7 Oct 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 commentaires
Walter Roberson
le 7 Oct 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
Réponse acceptée
Walter Roberson
le 7 Oct 2020
Modifié(e) : Walter Roberson
le 7 Oct 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!