Complex Number resulted in DOUBLE cannot convert the input expression into a double array
Mostrar comentarios más antiguos
I have done some digging and searching, but I cannot find solution for the particular error. I suspect it is the i acting as symbolic, but I am not sure. Below shows the code and the output. Please help me resolve this issue! Thank you!
Code:
A = [0 1
-2 -3];
B=[0
1];
tr = 0.5;
po = 0.05;
%zeta, omega, and z, w are to calculate damping and natural frequency
syms zeta omega;
[z, w] = solve([tr == (2.16 * zeta+0.6)/omega, po == exp(-1 * zeta * pi / sqrt(1-zeta^2))], [zeta, omega]);
z = vpa(z,4)
w = vpa(w,4)
Poles = [-z*w+w*sqrt(z^2-1) -z*w-w*sqrt(z^2-1)]
place(A,B,Poles)
Output (error occurs at place):
Error using symengine
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
2 comentarios
Walter Roberson
el 14 de Abr. de 2016
Please show the complete error message.
One thing to remember is that vpa() does not convert the value to double precision, so your z and w stay symbolic after the vpa()
Eric Wang
el 14 de Abr. de 2016
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Numbers and Precision en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!