Sobol Sensitivity analysis method using Python

Hello everyone,

I’m currently working on integrating the Sobol sensitivity analysis method into my Grasshopper model using Python. The goal is to study the impact of different design parameters on energy performance metrics such as cooling, heating, and daylight.

I’ve created a Python script to perform Sobol sampling, as shown in the image below, and I’m able to generate different parameter sets for each iteration. However, I’m facing a challenge: I want to run a simulation after each iteration/sample and ensure that the output results (cooling, heating, daylight) are recorded before launching the next simulation, I am considering using Colibri to save the results efficiently.

Could someone please advise on the best way to handle this iterative simulation process? Is my current approach suitable, or is there an alternative way to ensure that simulations run sequentially, outputs are saved correctly ?

1 Like

Hi @Chris and team,
Can anyone please help out with this?

I think I have a good solution.

Your approach in using Colibri is suitable. Colibri has an option to save the files in different format. You can use the saved data for the post processing work you have.

1 Like

@safaeOulmouden

Please find the link below, maybe helps

1 Like

The problem is that Colibri runs all the possible iterations. For my case, I want to use the Sobol sampling method to reduce the number of simulations to run. I should modify my Python script to run the simulations automatically.

@MWJ Could you please share your solution ?

The Colibri plug-in itself does record all possible combinations, but sensitivity analysis requires running the specified samples in batches. Iterative running and batch recording are key means to achieve the goal. I have also involved the corresponding running process, and I have also implemented this process. My opinion is that by combining Colibri and the Sea Anemone component, batch loading, batch recording, and the entire process can be automated.

Thank you so much! I’ll try combining Colibri with the Anemone component.

I am also researching this issue. Can I have your file for reference? Thanks.

@BBd I’m still having the same problem. To use Colibri, I need to run all possible combinations, which results in a huge number of simulations. I’m working on a Python script to run only the samples I need and automate the simulations.

1 Like

So, I have a question: can we perform sensitivity analysis using the Sobol method directly in Python within Rhino, or do we need to simulate and obtain the results from Rhino and then run the Sobol calculations in another software?

That’s my question as well. If you have a low number of parameters, you can use Colibri to run all possible combinations, save the results, and then use Python to analyze the data and run the Sobol calculations.

In my case, though, I have a large number of parameters, so using Colibri for all possible combinations isn’t feasible, it would take far too long to complete all the simulations. Instead, I’ve been trying to use Sobol sampling in Python to run a reduced set of simulations. However, I haven’t yet managed to run the simulations one by one for each sample generated.

I don’t know if @chris or @mostapha can help with this?

Hi, you can try using standard GH Data Recorder to record cooling, heating and daylight performance metrics. If you already know the set of experiments to run, then you can have them as a list of inputs in the honeybee components and the results of the simulations will be captured with data recorder.

If you want to vary set of experiments based on the simulation results, then it becomes trickier. You can try looking into Galapagos, which is a GH native optimisation component, but I am not sure if this will be suitable for your task.

Cheers

@dmitry Thank you for the suggestion! I do have a predefined set of experiments to run. Could you please guide me on how to execute these simulations automatically in Grasshopper?