plz help me in resolving the error.
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
42 views (last 30 days)
Show older comments
MANSOOR SOOMRO
on 20 Jul 2020
Commented: Azariah Seblu
on 19 Jul 2021
Error evaluating 'InitFcn' callback of block_diagram 'DFIG_SMC'. Callback string is '% Parametrs for DFIG with SMC
% Parametrs for DFIG with SMC
f=50;
Ps=2e6;
n=1500;
Vs=690;
Is=1760;
Tem=12732;
Vr=2070;
p=2;
u=1/3;
smax=1/3;
Vr_stator=(Vr*smax)*u;
Rs=2.6e-3;
Ls=2.587e-3;
Rr'=26.1e-3;
Lr'=2.587e-3;
Lm=2.51e-3;
Rm=1.0805e6;
Vbus=Vr_stator*sqrt(2);
sigma=(1-Lm^2)/(Ls*Lr);
Vs=690*sqrt(2/3);
ws=f*2*pi;
J=127/2;
D=1e-3;
fsw=4e3;
Ts=1/fsw/50;
F=0.058;
%% Maximum and Minimum wind speeds
wt_nom=18;
wt_min=9;
%% Three Blade wind turbine model
N=100;
Radio=42;
ro=1.225;
%% Cp and Ct curves
beta=0;
ind2=1;
%% Kopt for MPPT
Cp_max=0.44;
lambda_opt=7.2;
Kopt=((0.5*rho*pi(Radio^5)*Cp_max)/(lambda_opt^3));
%% Torque and speed inputs
Temm=Torque/N;
wmm=wt*(50/2/pi)*N;
sss=(1500-wmm)/1500;
%% Grid side converter
Cbus=80e-3;
Cg=20e-6;
Lg=400e-6;
Kpg=1/(1.5*Vs*sqrt(2/3));
Kqg=-Kpg;
%% Mechanical Inputs
Theta=20;
Speed=1500;
Caused by:
- Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
5 Comments
Azariah Seblu
on 19 Jul 2021
Thank you @John D'Errico for the excellent, detailed response. You are very good with MATLAB! Hope to see you around the forum in the future!
Accepted Answer
Walter Roberson
on 20 Jul 2020
Rr'=26.1e-3;
Apostrophe cannot be part of a variable name in MATLAB Function Block or Callbacks.
More Answers (1)
John D'Errico
on 20 Jul 2020
A simple rule in MATLAB: You cannot assign a result to a result.
What is Rr' then? This is the conjugate transpose of the array or vector Rr. MATLAB does not truly care that Rr is apparently a scalar.
Rr'=26.1e-3;
Lr'=2.587e-3;
My guess is you wanted to name a variable like that. Sorry, but Rr' is not a valid variable name. So, what error arises? MATLAB thinks the left hand side is the conjugate transpose of something called Rr, that is, it sees the result of an operation. Therefore, it thinks you may want to compare the two results for equality, thus the error message.
See Also
Categories
Find more on Startup and Shutdown 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!