FAST v8 Test18 - New Simulink model

Dear all,

I’ve tried a new approach to run FAST Simulink models.

Instead of running Run_OpenLoop.m (OpenLoop.mdl) I tried to run Energies.mdl, which I’m sending a picture below:

[url]https://drive.google.com/file/d/1jchpIiEzmUG2-qsOmGkuu-xr91SBnbTq/view[/url]

Although I run this model for Test18.fst and it was working fine for Run_OpenLoop.m (OpenLoop.mdl) , when I tried to run on Energies.mdl it resulted some errors. Please, can you help to identify and fix these erros?

[code]>> RunEnergies


FAST_SFunc certification test for Test18


Error using RunEnergies (line 19)
Error due to multiple causes.

Caused by:
Error using RunEnergies (line 19)
Invalid setting in ‘Energies/FAST Nonlinear Wind Turbine/Demux’ for
parameter ‘Outputs’.
Error using RunEnergies (line 19)
Error evaluating parameter ‘Outputs’ in ‘Energies/FAST Nonlinear
Wind Turbine/Demux’
Error using RunEnergies (line 19)
Undefined function or variable ‘NDOF’.
Error using RunEnergies (line 19)
Error in S-function ‘Energies/Soft Real Time’: S-Function ‘sfun_time’
does not exist[/code]

Best wishes,
Jonathan

Dear Jonathan,

I’m not familiar with RunEnergies.mdl; this doesn’t appear to be a model provided by NREL. Regardless, from the error message, it appears that you must set the NDOF variable before running the RunEnergies.mdl.

Best regards,

Thank you for the fast reply Professor Jonkman,

RunEnergies,mdl it’s not a model provided by NREL. It was created to simulate some turbine controls, as these ones:

[code]if px==1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Optimal control

                Num = 2*r{i}*(u - 2.14*omega_g^2)*(-2*2.14*omega_g) ...
                    +2*q{i}*(Pref - u*omega_g)*(-u);
                DerivCp=geraDerivadaCp(Cp,wind,Pitch,omega_g);
                
                Parte1=r{i}*(u - 2.14*omega_g^2)^2;
                Parte2=q{i}*(Pref - u*omega_g)^2;
                
                Au2=b2*q{i}*omega_g/DerivCp;
                Bu2= -2*b2*r{i}*2.14*omega_g/DerivCp - b2*q{i}*Pref/DerivCp + r{i} + q{i}*omega_g^2;
                Cu2= -( -2*b2*r{i}*2.14^2*omega_g^3/DerivCp + r{i}*2.14*omega_g^2 + q{i}*Pref*omega_g );
                raizes = roots([Au2 Bu2 Cu2]);
                raizMin = min(raizes);
                raizMax = max(raizes);
                if raizMin>0
                    ut3=raizMin;
                else
                    ut3=raizMax;
                end
                u=ut3;
                flag=['markov'];
                if u<0
                    disp('socorro. u negativo')
                end
                flag = ['markov'];
            end
            
            
            
            if px==2
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                % Jockerman interpretado Yolanda
                if (leer<1129)
                    u = 2.14*omega_g^2;
                elseif (leer>1165)
                    u = Pref/omega_g;
                else
                    alpha = -leer/36 + 1165/36;
                    u = alpha*2.14*omega_g^2 + (1-alpha)*Pref/omega_g;
                end
                flag=['jocker'];
            end
            
            
            if px==3
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                % Regra chaveado Chino
                if (wind<11.4)
                    u = 2.14*omega_g^2;
                else
                    u = Pref/omega_g;
                end
                flag=['chino'];
            end[/code]

Despite I have set NDOF variable, another variables needed to be set, and when I set all of them the script run out in another error. I think that’s not a way I can test these controls. Is there any model provided by NREL that I could test these controls?

With gratitude,
Jonathan

Dear Jonathan,

I’m not sure what you mean when you say, “is there any model provided by NREL that I could test these controls?” What controls do you want to test?

Best regards,