empty sym 0-by-1
3 views (last 30 days)
Show older comments
clc;
clear all;
close all;
syms c
a = 13*0.0071;
Re = 5000;
ddU = -1.98;
U = 0.7425;
C = (a*Re*(U-c))/2;
N1 = (a^2/2) + sqrt((a^4/4) + ((C/2) + (0.5*sqrt(C^2 + (a*Re*ddU*1i))))^2);
N2 = (C/2) + sqrt((C/2)^2 + ((a*Re*ddU)/4));
D1 = (a^2/2) + sqrt((a^4/4) + ((C/2) - (0.5*sqrt(C^2 + (a*Re*ddU*1i))))^2);
D2 = (C/2) - sqrt((C/2)^2 + ((a*Re*ddU)/4));
LHS = (N1+(N2*1i))/(D1+(D2*1i));
RHS = sqrt(N1/D1);
eqn = LHS - RHS==0;
vpasolve(simplify(eqn),c)
I'm getting empty sym 0-by-1. How can I correct it?
0 Comments
Answers (1)
Ameer Hamza
on 17 Oct 2020
It means that the symbolic toolbox is unable to find a solution (even a numeric one). An altenative is to use optimization toolbox.
clc;
clear all;
close all;
syms c
a = 13*0.0071;
Re = 5000;
ddU = -1.98;
U = 0.7425;
C = (a*Re*(U-c))/2;
N1 = (a^2/2) + sqrt((a^4/4) + ((C/2) + (0.5*sqrt(C^2 + (a*Re*ddU*1i))))^2);
N2 = (C/2) + sqrt((C/2)^2 + ((a*Re*ddU)/4));
D1 = (a^2/2) + sqrt((a^4/4) + ((C/2) - (0.5*sqrt(C^2 + (a*Re*ddU*1i))))^2);
D2 = (C/2) - sqrt((C/2)^2 + ((a*Re*ddU)/4));
LHS = (N1+(N2*1i))/(D1+(D2*1i));
RHS = sqrt(N1/D1);
eqn = LHS - RHS==0;
eqn_fun = matlabFunction(LHS - RHS);
sol = fsolve(eqn_fun, 1)
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!