Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update problem size table #45

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

ZedongPeng
Copy link
Member

@ZedongPeng ZedongPeng commented Aug 3, 2024

Fixes #46

This pull request updates the problem size table for each model in the README.md.
The stranded_gas , modprodnet and mod_hens problems have multiple formulations, and assistance is needed with them.

  • mod_hens
  • stranded_gas
  • modprodnet

@ZedongPeng
Copy link
Member Author

ZedongPeng commented Aug 7, 2024

We should also come up with a way to use the different formulations of models, like stranded_gas, modprodnet and mod_hens.

@AlbertLee125
Copy link
Member

In this case, for the Mod HENS, it consist of the common code and there variations. I think it would be good to split the common codes into other variations and make them separately.

@bernalde
Copy link
Member

I agree with Albert, split into three models, maybe using common functions, and report them separately

@ZedongPeng
Copy link
Member Author

In the old readme file, there are 7 models instead of 3.
image

Personally, I don't suggest splitting them into different models or folders since they are different formulations of the same problem. We should do something clever, like using an arg to determine which formulation to use.

@ZedongPeng ZedongPeng mentioned this pull request Aug 18, 2024
3 tasks
@ZedongPeng
Copy link
Member Author

ZedongPeng commented Aug 18, 2024

This PR is ready for review, except for the stranded_gas problem. @bernalde

For the stranded_gas problem, the setup for cases like Gas_100, Gas_250, Gas_500, Gas_small, and Gas_large remains unclear, even after reading the code.

Could you please update the README.md file with a detailed example of how to properly use these cases? @AlbertLee125

@AlbertLee125
Copy link
Member

For the stranded_gas problem, the way how the problem is formulated is explained on below code.

if __name__ == "__main__":
    m = build_model()
    # m.module_types.pprint()
    # m.well_clusters.pprint()

    # Restrict number of module types; A, R, S, U
    # valid_modules = ['A500', 'A1000', 'A2000', 'A5000']
    # valid_modules = ['A500', 'R500', 'A5000', 'R5000']
    # valid_modules = ['U500', 'U5000']
    # valid_modules = ['U100', 'U250']
    # valid_modules = ['U1000']
    # valid_modules = ['U500']
    
    # valid_modules = ['U250']
    valid_modules = ['U100']
    for mtype in m.module_types - valid_modules:
        m.gas_consumption[:, mtype, :].fix(0)
        m.num_modules[mtype, :, :].fix(0)
        m.modules_transferred[mtype, :, :, :].fix(0)
        m.modules_purchased[mtype, :, :].fix(0)
        m.mtype_exists[mtype].deactivate()
        m.mtype_absent[mtype].binary_indicator_var.fix(1)

Given the code. The way that only specific units are activated is that the other units that are not valid are deactivated passing through the for loop.

I obtained the data before running the optimization by searching component_data_objeccts but the numbers of variables I got seems incorrect.

Number of variables: 57618
Number of Boolean variables: 0
Number of binary variables: 0
Number of integer variables: 45360
Number of continuous variables: 12258
Number of constraints: 14791
Number of nonlinear constraints: 0
Number of disjuncts: 175
Number of disjunctions: 96
Number of binary variables after transformation: 175
Problem vars Bool bin int cont cons nl disj disjtn
Gas_100 8816 158 0 2520 6138 14925 1 158 96

I got this table from README.md

@ZedongPeng
Copy link
Member Author

I noticed a significant difference between your results and the ones presented in the README.md. Could you help clarify why there’s such a large discrepancy? @AlbertLee125

Is it possible to integrate the fix() and deactivate() code in the build_model() function? (currently in the main function) Otherwise, it might be too complicated for users to create this model. Any ideas? @bernalde @AlbertLee125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple formulations and instances handling
4 participants