Hello Friends, I am implementing a simple logic as shown in figure below. While executing I am getting error index exceeds the number of array element, index must not exceed 5

2 vues (au cours des 30 derniers jours)
The logic I am trying to implement as shown in figure below is to design a simple model with the objective to keep power given by the source to be constant despite of variation in load resistance. The complementary logic Shown in image is as follows: The main idea is to keep the power at the level of 4kw, The source voltage is 48v and by the formula Power=V^2/R, R should be 0.576ohm. As we are using in total 44 resistances with equal value then each will be having reistance, R=0.576*44=25.344ohm.
Now let us consider out of 44 resistances only 1 is active at a time as per the switching signal data imported from workspace using from workspace block, The current will be I=V/R=48/25.344=1.89A, Which leads the power to be 48*1.89=90.72W but our objective is to keep power constant at 4kw, so the complementary logic will activate a line with the remaining value of resistance in prallel to keep the overall resistance to be 0.576ohm, thus keeping power constant.
But while simulating the logic in simulink, the error displayed on the screen is "Index exceeds the number of array elements. index must not exceed 5". I am unable to figure out the reason for this error, kindly help me with it.

Réponses (1)

Shang-Chuan Lee
Shang-Chuan Lee le 9 Nov 2022
Hi Vageesh,
Thank you for your questions.
The error message you saw is often becasue of input and output signals are not matched with each other. If you are able to turn on the "view signal dimension", it'll be easy to debug which blocks are not matching of index size.
If you won't be able to view signal dimension, I would recommned to contact our technical support for help.
Thanks,
Shang-Chuan Lee

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by