solving 5 nonlinear equations and getting error
显示 更早的评论
so i was solving some equations but i keep getting this error
Error using symengine
DOUBLE cannot convert the input expression into a double array.
Error in sym/double (line 613)
Xstr = mupadmex('symobj::double', S.s, 0);
here is the code:
eq1 = (gcr*10^5)/gamma + z(1) - h2...
- (q3^2 - qt^2)/(2*gravity*A^2) - (0.81*f1*(leqtheo1+sum(l(1:5)))*q1^2)/(gravity*(Di*10^-3)^5);
eq2 = qt - (1+sqrt((leqtheo1+sum(l(1:5)))/(leqtheo2+sum(l))))*q3;
eq3 = v3 - q3/A;
eq4 = re3 - (density*v3*Di*10^-3)/viscosity;
eq5 = f3 - 0.316*re3^-0.25;
x3 = solve(eq1,eq2,eq3,eq4,eq5);
Qtheo(3) = double(x3.qt);
Vtheo(3) = double(x3.v3);
Retheo(3) = double(x3.re3);
Ftheo(3) = double(x3.f3);
1 个评论
John D'Errico
2023-5-23
编辑:John D'Errico
2023-5-23
That is not the code, since we cannot execute it. there are many, many undefined variables. How can we know what is in them? And since some of them may contain symbolic expressions themselves, we cannot easily help you.
Make it easy to get help, not difficult. Unless, of course, that is your goal.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!