How to fix Index exceeds matrix dimensions error?
Show older comments
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)
Mathieu NOE
on 13 Jan 2021
0 votes
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
Philip Liju
on 13 Jan 2021
Mathieu NOE
on 13 Jan 2021
here you are
Philip Liju
on 13 Jan 2021
Philip Liju
on 13 Jan 2021
Mathieu NOE
on 14 Jan 2021
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
Philip Liju
on 14 Jan 2021
Mathieu NOE
on 14 Jan 2021
ok
could you double check that the simulink block output i coherent with a matlab script ?
Philip Liju
on 14 Jan 2021
Mathieu NOE
on 14 Jan 2021
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 ?
Philip Liju
on 14 Jan 2021
Mathieu NOE
on 14 Jan 2021
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
Philip Liju
on 14 Jan 2021
Mathieu NOE
on 14 Jan 2021
you 're welcome !
Categories
Find more on Matrix Indexing 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!