How do I assign a complex value into a non-complex location?
Mostrar comentarios más antiguos
I have the following code that will calculate the rotation of a motor based upon an input flux and temperature. The function is being run in Simulink, but I keep getting the error "Cannot assign a complex value into a non-complex location" at the last line in the function (that actually calculates Theta). I can see that theta may be complex due to the feedback loop that was built around the temperature T, but I don't see how to solve it. I have attached a picture of the simulink model as well.
Thanks,
Greg
function Theta = flow_rate(Q,T)
%Calc theta position
Theta=complex(0);
Ti=600; %constant inlet particle temperature (degree C)
%Convert the output of the servo motor (theta) to linear distance, assumes
%3000 counts per turn
slot_length=1.16;% m
%Heat Transfer Model
Cp=1200; %specific heat of the particles
%beverloo Constants and parameters
C1=19;
C2=8.9;
rho_b=2000; %bulk density, kg/m^3
d_p=0.35e-3;%particle diameter, 350 micron
g=9.81; %gravity
Theta=((Q/(C1*rho_b*sqrt(g)*slot_length*Cp*(T-Ti)))^(2/3)+C2*d_p)*3000;
4 comentarios
Archit Yadav
el 24 de Abr. de 2019
Did you get any solution to this problem?
Prateek Tiwari
el 29 de Mayo de 2020
Even I am looking for the answer to this question.
Sergey Kasyanov
el 17 de Ag. de 2020
The same problem.
David Goodmanson
el 17 de Ag. de 2020
For function inputs Q and T, there are going to be problems when Q and (T-Ti) are of opposite sign. Is there any explicit or implied way to prevent this, prior to the function call?
Respuestas (0)
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!