writing capua model in python