Jump to content

Wzór matematyczny na nagazowanie piwa w butelkach


Jozzek

Recommended Posts

Witam, jestem w trakcie tworzenia rozbudowanego kalkulatora piwowarskiego(udostępnie go za darmo na forum.) Potrzebuje wzór na nagazowanie piwa w butelkach. Szukam juz z 5h i niemoge znaleźć. Proszę o pomoc.

 

Wysłano z Galaxy S7

Link to comment
Share on other sites

Ja to zrobiłem tak:

 

public static double CalculateCo2Units(Recipe recipe) {
            double co2 = (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume;
            double celsius = recipe.Fermentation.SecondaryTemperature; ;
            double fahrenheit = Converter.Celsius2Fahrenheit(celsius);
            double residualCo2 = 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit);
            return co2 + residualCo2;
        }
 
Zawsze zresztą można zrobić reverse engineering BrewTargeta.
Link to comment
Share on other sites

Ja to zrobiłem tak:

 

public static double CalculateCo2Units(Recipe recipe) {

double co2 = (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume;

double celsius = recipe.Fermentation.SecondaryTemperature; ;

double fahrenheit = Converter.Celsius2Fahrenheit(celsius);

double residualCo2 = 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit);

return co2 + residualCo2;

}

 

Zawsze zresztą można zrobić reverse engineering BrewTargeta.

A napiałbyś to jako wzór ? Nie kapuje tego jezyka zabardzo, ja pisze w Delphi.

 

Wysłano z Galaxy S7

Link to comment
Share on other sites

a co tu jest do rozumienia? Język jak język.

Mój pascal jest bardzo zardzewiały, ale proszę:

 

function CalculateCo2Units(Recipe recipe): real;

var co2, celsius, fahrenheit, residualCo2: real;
begin
co2 := (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume;
celsius := recipe.Fermentation.SecondaryTemperature;

fahrenheit := Converter.Celsius2Fahrenheit(celsius);
residualCo2 := 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit);
CalculateCo2Units := co2 + residualCo2;
end;

Edited by dirk gently
Link to comment
Share on other sites

a co tu jest do rozumienia? Język jak język.

Mój pascal jest bardzo zardzewiały, ale proszę:

 

function CalculateCo2Units(Recipe recipe): real;

var co2, celsius, fahrenheit, residualCo2: real;

begin

co2 := (recipe.Fermentation.RefermentationSugar / 4) / recipe.BatchVolume;

celsius := recipe.Fermentation.SecondaryTemperature;

fahrenheit := Converter.Celsius2Fahrenheit(celsius);

residualCo2 := 3.0378 - (0.050062 * fahrenheit) + (0.00026555 * fahrenheit * fahrenheit);

CalculateCo2Units := co2 + residualCo2;

end;

Dziękuje.

 

Wysłano z Galaxy S7

Link to comment
Share on other sites

 

Zawsze zresztą można zrobić reverse engineering BrewTargeta.

 

 

Źródełka brewtargeta wiszą sobie na githubie. Oni liczą tak:

https://github.com/Brewtarget/brewtarget/blob/develop/src/PrimingDialog.cpp

 

Przy okazji cześć wszystkim jako, że to mój pierwszy post na forum :)

Link to comment
Share on other sites

Z pierwszej zmiennej odcinamy "recipe.Fermentation.", z drugiej "recipe." i mamy przejrzyście jak diabli. Już pomijając, że Pascal nagle pasował autorowi wątku, czego nie rozumiem, bo same wzory są praktycznie niezmienne. Składnia języka się zmieniła - jasne, ale to nie są różnice jak między angielskim, a japońskim! W minutę można to przepisać do bieda języka PHP, czy totalnego wariactwa jakim jest JavaScript (choć JS lubię odkąd zacząłem się bawić z NodeJS xD). Pewnie znajdą się wariaci, co zapiszą to w BrainF**ku :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.