10f95c7c122a9c48f10369adfaf5775e89912c7b,trunk/SUAVE/Methods/Propulsion/electric_motor_sizing.py,,optimize_kv,#,130
Before Change
bnds = [(lb,ub)]
// constraints
cons = ({"type": "ineq", "fun": lambda x: ((v-omeg/x[0])*(1.-etam*v*x[0]/omeg))/io - 0.001}) // Added a tolerance on resistance, cant be less than 0.001 ohms
// solve
sol = minimize(objective,(0.5), method = "SLSQP",bounds = bnds, constraints = cons )
After Change
cons1 = [{"type":"eq", "fun": constraint_1,"args": args},
{"type":"eq", "fun": constraint_2,"args": args}]
cons2 = [{"type":"eq", "fun": constraint_2,"args": args}]
bnds = ((0.001, 100), (0.001, 10))
sol = minimize(objective, [0.5, 0.1], args=(v , omeg, etam , Q , io) , method="SLSQP", bounds=bnds, tol=1e-6, constraints=cons1)
if sol.success == False:
sol = minimize(objective, [0.5, 0.1], args=(v , omeg, etam , Q , io) , method="SLSQP", bounds=bnds, tol=1e-6, constraints=cons2)
return sol.x
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: suavecode/SUAVE
Commit Name: 10f95c7c122a9c48f10369adfaf5775e89912c7b
Time: 2020-09-01
Author: mclarke2@stanford.edu
File Name: trunk/SUAVE/Methods/Propulsion/electric_motor_sizing.py
Class Name:
Method Name: optimize_kv
Project Name: suavecode/SUAVE
Commit Name: 647c40d3314a0ca90eb4b3ad9ab7791215e49792
Time: 2020-09-28
Author: mclarke2@stanford.edu
File Name: trunk/SUAVE/Methods/Propulsion/electric_motor_sizing.py
Class Name:
Method Name: optimize_kv
Project Name: jnothman/UpSetPlot
Commit Name: f2f419b89221602dc31c69de32df1cba281db481
Time: 2019-05-30
Author: joel.nothman@gmail.com
File Name: upsetplot/tests/test_data.py
Class Name:
Method Name: test_from_contents