How to fix Index exceeds matrix dimensions error?

Kindly have a look at the errors.
Error in expression for 'project_wind/Wind Turbine/wind_speed^3', an input index exceeds its input width of 1
Error in port widths or dimensions. 'Output Port 1' of 'project_wind/Wind Turbine/Wind speed (m//s)' is a [1x1] matrix.

Answers (1)

hello Philip
I corrected some minor bugs in matlab function blocks
also lambda_nom is not initialized so I took lambda_nom = 1 to run the code
last point you have to fix is that when pitch_angle is zero , there are division by zeros in your cp(lambda,beta) block
all the best,
mathieu

13 Comments

Thank you so much. I really appreciate it. Could you kindly export the file to 2020a and upload coz this file isn't opening for me
When I'm calculating the mechanical power manually with the pitch angle = 0, I'm getting the mechanical power to be around 2.32 mW. Any idea where I'm making the mistake?
lambda nom = 8.1
hello
I put some displays everywhere to see the magnitude of signals
again, the output of the cp(lambda,beta) block is very small
and that make the product output (power) also very small
I suspect there is a mistake in the cp(lambda,beta) block
This is the data I used. It's taken from a text book
ok
could you double check that the simulink block output i coherent with a matlab script ?
I made some changes. But still I ain't getting the desired result. It's the error with calculating using the variables I guess. Kindly have a look
hello
I wonder what the lambda and beta value should be in the inputs of that block
lambad is calculated from wind speed (12 m/s) with a gain block (parameter : lambda nom ) and you said that lambda nom = 8.1
so are we right here ? is lambda = lambda nom = 8.1 or lambda = wind speed x lambda nom = 92.7 ?
doing the cp calculation in matlab gives the following results
if lambda = lambda nom = 8.1 and beta = 0, cp = 0.3441
if lambda = wind speed x lambda nom = 92.7 and beta = 0, cp = -1.4944 (?? negative value)
also is beta unit = degrees ?
I used this formula. Lambda nom is considered as the lambda from the equation = 8.1
Ok
so I found the bug in the block cp(lambda,beta) : the indexes of u[ ] were incorrect
the script and simulink gives me now the same values
last point to check : so lambda = 8.1 if wind speed = 12 m/ s ? so i put the gain accordingly - check this please
attached the updated file
This works as I want it to be. Thank you so much for your help .. Really appreciate it

Sign in to comment.

Asked:

on 13 Jan 2021

Commented:

on 14 Jan 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!