|
C_GetRecommendedTimeSteps |
C_GetRecommendedTimeSteps gets the recommended simulation time steps for a model. This function must be called immediately following a successful call to C_CalculateStatics.
void C_GetRecommendedTimeSteps(
);
The handle of the model.
Points to a structure in which the recommended time steps will be returned.
Before calling the C_GetRecommendedTimeSteps function, set the Size member of the TTimeSteps structure to sizeof(TTimeSteps).
Points to a variable in which the status result for the function call will be returned.
If the call to C_GetRecommendedTimeSteps is successful then you can call C_SetDataDouble to set the time steps to the recommended values and then start the simulation. For example:
TTimeSteps TimeSteps;
TimeSteps.Size = sizeof(TTimeSteps);
C_GetRecommendedTimeSteps(ModelHandle, &TimeSteps, &Status);
CheckStatus(Status);
C_SetDataDouble(GeneralHandle, "InnerTimeStep", 0, TimeSteps.InnerTimeStep, &Status);
CheckStatus(Status);
C_SetDataDouble(GeneralHandle, "OuterTimeStep", 0, TimeSteps.OuterTimeStep, &Status);
CheckStatus(Status);
C_RunSimulation2(ModelHandle, NULL, NULL, &Status);
CheckStatus(Status);
C_CalculateStatics, C_RunSimulation2, C_SetDataDouble, TTimeSteps.