7f9976d67c9b413b3a7211bad921b29eac7be179,trunk/SUAVE/Methods/Power/Battery/Sizing/initialize_from_energy_and_power.py,,initialize_from_energy_and_power,#,18

Before Change


    if max=="soft": //use softmax function (makes it differentiable)
        
        min_mass=np.minimum(energy_mass, power_mass)
        mass=mass+np.log(1.+np.exp(min_mass-mass))  //write it this way to prevent overflow
            
    battery.mass_properties.mass=mass
    battery.max_energy=battery.specific_energy*mass

After Change


    power_mass=power/battery.specific_power
    mass=np.maximum(energy_mass, power_mass)
    if max=="soft": //use softmax function (makes it differentiable)
        scaling=10.**(np.floor(np.log10(mass))-1) //make it so the exponentials are taking ~10 (closer numerically, while still differentiable)
        mass=scaling*np.log(np.exp(energy_mass/scaling)+np.exp(power_mass/scaling))  //write it this way to prevent overflow

    battery.mass_properties.mass=mass
    battery.max_energy=battery.specific_energy*mass
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: suavecode/SUAVE
Commit Name: 7f9976d67c9b413b3a7211bad921b29eac7be179
Time: 2016-02-01
Author: jmvegh@stanford.edu
File Name: trunk/SUAVE/Methods/Power/Battery/Sizing/initialize_from_energy_and_power.py
Class Name:
Method Name: initialize_from_energy_and_power


Project Name: SheffieldML/GPy
Commit Name: 841ca66170ecb851d2f1db9df22277318135f12f
Time: 2017-08-10
Author: eero.siivola@aalto.fi
File Name: GPy/likelihoods/binomial.py
Class Name: Binomial
Method Name: logpdf_link


Project Name: ntucllab/libact
Commit Name: e3f85d146653691809ce1a38388c3f199dbe6e7d
Time: 2015-03-03
Author: iamyuanchung@gmail.com
File Name: libact/query_strategies/uncertainty_sampling.py
Class Name: UncertaintySampling
Method Name: make_query