Revision history [back]
T-entry Model Help
Hi,
I am currently writing a load model as a coordinated call model. The general structure of the load is as follows:
Generate time-varying signal (e.g. square wave) --> pass signal through various controllers (using the PSSE integrator blocks, for example) --> based on the bus voltage, calculate the load's power and update various STATE variables accordingly --> use the power calculate the current injection.
At the moment, MODE 2 and 3 are essentially identical (except for the different integrator block modes), where there are several nested IF statements that check voltage thresholds and compute different calculations (for example, calculate how much a 'battery' state variable is decreasing by.
I am trying to store the previous P and Q in VARs, and new P and Q in different VARs, then when I enter the T-model, calculate the difference as use this in the current injection calculation. My issue is that the 'old power' VARs are being overwritten somewhere, so the difference between simulation timesteps is zero, and the model does not inject any current.
What is the general structure for a coordinate call model of this type? I understand that in MODE 2, we calculate the derivatives of the STATE variables, and in MODE 3 we set the model outputs. However in my case, I believe that these output values (for example, an internal component load value) are required to calculate the derivatives, hence why I have duplicated the code for both MODEs.
Any help or examples would be greatly appreciated!
T-entry Model Help
Hi,
I am currently writing a load model as a coordinated call model. The general structure of the load is as follows:
Generate time-varying signal Get user-defined load profile (e.g. square wave) wave, already coded in) --> pass signal through various controllers (using the PSSE integrator blocks, for example) --> based on the bus voltage, calculate the load's power and update various STATE variables accordingly --> use the power calculate the current injection.
At the moment, MODE 2 and 3 are essentially identical (except for the different integrator block modes), where there are several nested IF statements that check voltage thresholds and compute different calculations (for example, calculate how much a 'battery' state variable is decreasing by.
I am trying to store the previous P and Q in VARs, and new P and Q in different VARs, then when I enter the T-model, calculate the difference as use this in the current injection calculation. My issue is that the 'old power' VARs are being overwritten somewhere, so the difference between simulation timesteps is zero, and the model does not inject any current.
What is the general structure for a coordinate call model of this type? I understand that in MODE 2, we calculate the derivatives of the STATE variables, and in MODE 3 we set the model outputs. However in my case, I believe that these output values (for example, an internal component load value) are required to calculate the derivatives, hence why I have duplicated the code for both MODEs.
Any help or examples would be greatly appreciated!