Commit 55397e30 authored by Lie-Piang, Anouk's avatar Lie-Piang, Anouk
Browse files

Update 20210525_Formulation_tool_0.1steps_corrected_int_1_PF_zeroboundary.py

parent e95a7ca4
# -*- coding: utf-8 -*-
"""
Product formulator
Formulation tool
"""
#Initially all combinations of components are generated. Then all these values are converted in a csv, which can be used in the ternary plot file
#in R. Later the combinations are subjected to linear regression to obtain all minimal quantity of fractions that adhere to the compositions generated in step 1
#These values are also converted in a list, which can be copied into the output file that calculates the GWP.
#In this file only the fractions are used for the formulation window, so without the pea flour.
#Initially all combinations of components are generated. Later the combinations are subjected to linear programming to obtain all minimal quantity of fractions that adhere to the compositions generated in step 1. These values are also converted in a list, which can be copied into the output file that calculates the GWP.
#Creating all possisbilities for a viscosity range
......@@ -83,7 +80,7 @@ SolutionList = [list(t) for t in SolutionsList_order]
SolutionList.insert(0,['Protein (DM%)', 'Starch (DM%)', 'Fibre (DM%)', 'Rest (DM%)'])
df_comp = pd.DataFrame(SolutionList[1:],columns=SolutionList[0])
df = pd.DataFrame(df_comp.sum(axis = 1))
df_comp.to_csv (r'C:\ModelsLocal\Functionality models\Ternary plots\1500_0.025mPas_0.1step_22%dm2505_zeroboundary.csv', index = False, header=True)
df_comp.to_csv (r'C:\ModelsLocal\Functionality models\Ternary plots\1500_0.025mPas_22%dm.csv', index = False, header=True)
#Creating a 3D scatterplot of all possible combinations of components
......@@ -187,7 +184,7 @@ plot(fig_frac) #online)
fig_frac.show(renderer = 'png') #in python
#Export Optimal Solutions
df_OptimalSolutions.to_csv (r'C:\Users\lie-p001\.spyder-py3\Product formulator\output_1500_var0.025_averaged_formula_22dm%_PF_CORRECTED_zeroboundary.csv', index = False, header=True)
df_OptimalSolutions.to_csv (r'C:\Users\lie-p001\.spyder-py3\Product formulator\ingredient_output_1500_variance_0.025.csv', index = False, header=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment