How to use the pymoca.backends.casadi.api.transfer_model function in pymoca

To help you get started, we’ve selected a few pymoca examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pymoca / pymoca / tools / compiler.py View on Github external
sys.path.append(options.casadi_folder)

    from pymoca.backends.casadi.api import transfer_model
    import casadi as ca

    logger.info("Generating CasADi model")
    
    compiler_options = \
        {'replace_constants': True,
         'replace_parameter_expressions': True,
         'eliminable_variable_expression': r'_\w+',
         'detect_aliases': True,
         'expand': False,
         'cache': True}

    model = transfer_model(model_folder, model_name, compiler_options)
    print(model)