{"id":532,"date":"2016-09-13T20:42:22","date_gmt":"2016-09-13T18:42:22","guid":{"rendered":"http:\/\/www.launet.ch\/blog\/?p=532"},"modified":"2016-09-13T21:07:55","modified_gmt":"2016-09-13T19:07:55","slug":"reverse-engineering-of-a-cake-mix","status":"publish","type":"post","link":"http:\/\/www.launet.ch\/blog\/uncategorized\/reverse-engineering-of-a-cake-mix\/","title":{"rendered":"The reverse engineering of a cake-mix"},"content":{"rendered":"<p class=\"size-medium wp-image-540\">Some time ago I got a mixture for a chocolate-coconut cake. So, my thought: How to bake it again if the cake is deliciouse?<\/p>\n<p>Of course, by reverse engineering the mixture!<\/p>\n<p>The ingredients reading as following:<\/p>\n<figure id=\"attachment_540\" aria-describedby=\"caption-attachment-540\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1b.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-540\" src=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1b-300x225.jpg\" alt=\"Ingredient label\" width=\"300\" height=\"225\" srcset=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1b-300x225.jpg 300w, http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1b-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-540\" class=\"wp-caption-text\">Ingredient label<\/figcaption><\/figure>\n<p><strong>1. Using the lable to identify the different segments:<\/strong><\/p>\n<p>From top to down: Peanuts, coconut rasps, brown sugar, cacao, flour, sugar, vanilla sugar, soda, cinamon, salt.<\/p>\n<p><strong>2. Measure the segment heights and container dimensions<\/strong><\/p>\n<figure id=\"attachment_533\" aria-describedby=\"caption-attachment-533\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-533\" src=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1a-300x225.jpg\" alt=\"Measuring the ingredients heights\" width=\"300\" height=\"225\" srcset=\"http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1a-300x225.jpg 300w, http:\/\/www.launet.ch\/blog\/wp-content\/uploads\/2016\/09\/cake1a-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-533\" class=\"wp-caption-text\">Measuring the ingredients heights<\/figcaption><\/figure>\n<p><strong>3. Calculate the weight of the dry ingredients<\/strong><\/p>\n<p>Lets do some calculation using Scilab:<\/p>\n<pre class=\"brush: matlabkey; title: ; notranslate\" title=\"\">\r\nclear all;\r\nclear;\r\nclc;\r\n\r\n\/\/\/\/ Reverse engineered chocolate-coconut Cacke\r\n\r\n\/\/ Igredient Segments from top to bottom\r\n\r\n\/\/ Segment 1: Peanuts\r\n\/\/ Segment 2: Coconut rasps\r\n\/\/ Segment 3: Brown sugar\r\n\/\/ Segment 4: Cacao\r\n\/\/ Segment 5: Flour\r\n\/\/ Segment 6: Sugar\r\n\/\/ Segment 6: Vanilla sugar\r\n\/\/ Segment 6: Soda\r\n\/\/ Segment 6: Cinamon\r\n\/\/ Segment 6: Salt\r\n\r\n\/\/ Predefinitions\r\n\r\n\/\/ Dimensions in [m]\r\nh_tot = 0.1                                         \/\/ Total fill height\r\nh_1 = h_tot - 0.09                                  \/\/ Peanut segment height\r\nh_1_off = h_tot - h_1                               \/\/ Peanut offset from bottom\r\nh_2 = h_tot - h_1 - 0.078                           \/\/ Coconut segment height\r\nh_2_off = h_tot - h_1 - h_2                         \/\/ Coconut offset from bottom\r\nh_3 = h_tot - h_1 - h_2 - 0.065                     \/\/ Brown sugar segment height\r\nh_3_off = h_tot - h_1 - h_2 - h_3                   \/\/ Brown sugar offset from bottom\r\nh_4 = h_tot - h_1 - h_2 - h_3 -  0.055              \/\/ Cacao segment height\r\nh_4_off = h_tot - h_1 - h_2 - h_3 - h_4             \/\/ Cacao offset from bottom\r\nh_5 = h_tot - h_1 - h_2 - h_3 - h_4 - 0.025         \/\/ Flour segment height\r\nh_5_off = h_tot - h_1 - h_2 - h_3 - h_4 - h_5       \/\/ Flour offset from bottom\r\nh_6 = h_tot - h_1 - h_2 - h_3 - h_4 - h_5 - 0.008   \/\/ Rest of the ingredients height\r\nh_6_off = 0.008                                     \/\/ Offset of the rest from bottom\r\n\r\nr_1 = 0.072;                                        \/\/ Small radius of the container\r\nr_2 = 0.094;                                        \/\/ Big radius of the container\r\n\r\n\/\/ Density in [kg\/m^3]\r\n\/\/   some evaluated, some from here: http:\/\/www.mollet.de\/info\/schuettgutdichte.html\r\n\/\/ [kg]\/([0.001 m^3\/l]*[l]) = [kg]\/[m^3]\r\nroh_1 = 0.500\/(0.001*1.000);    \/\/ Density of peanuts\r\nroh_2 = 0.152\/(0.001*0.440);    \/\/ Density of coconut\r\nroh_3 = 0.176\/(0.001*0.170);    \/\/ Density of brown suger\r\nroh_4 = 0.047\/(0.001*0.100);    \/\/ Density of cacao\r\nroh_5 = 0.220\/(0.001*0.325);    \/\/ Density of flour\r\nroh_6 = 0.259\/(0.001*0.250);    \/\/ Density of the rest...mainly sugar\r\n\r\n\/\/ angle of the jars side walls\r\nalpha = atan((r_2-r_1)\/(2*h_tot));\r\n\r\n\/\/ Calculate mean segment area, using the segment offset and segment height\r\nfunction y=A_segment(h_offset, h_segment)\r\n    h_mean = h_segment\/2+h_offset;\r\n    dia_mean = r_1+2*tan(alpha)*h_mean;\r\n    y = dia_mean^2\/4*%pi;\r\nendfunction\r\n\r\n\/\/ Calculate volume, using mean area and height\r\nfunction y=V_segment(A_seg, h_segment)\r\n    y = A_seg * h_segment;\r\nendfunction\r\n\r\n\/\/ Calculate the weight, using density and volume\r\nfunction y=Weight(V_segment, density)\r\n    y = V_segment * density;\r\nendfunction\r\n\r\n\/\/ Weight calculation\r\nw_1 = Weight(V_segment(A_segment(h_1_off, h_1), h_1), roh_1)\r\nw_2 = Weight(V_segment(A_segment(h_2_off, h_2), h_2), roh_2)\r\nw_3 = Weight(V_segment(A_segment(h_3_off, h_3), h_3), roh_3)\r\nw_4 = Weight(V_segment(A_segment(h_4_off, h_4), h_4), roh_4)\r\nw_5 = Weight(V_segment(A_segment(h_5_off, h_5), h_5), roh_5)\r\nw_6 = Weight(V_segment(A_segment(h_6_off, h_6), h_6), roh_6)\r\n\r\ndisp(w_1, &quot;Peanuts: &quot;)\r\ndisp(w_2, &quot;Coconut rasps: &quot;)\r\ndisp(w_3, &quot;Brown sugar: &quot;)\r\ndisp(w_4, &quot;Cacao: &quot;)\r\ndisp(w_5, &quot;Flour: &quot;)\r\ndisp(w_6, &quot;Sugar...and the rest: &quot;)\r\ndisp(w_1 + w_2 + w_3 + w_4 + w_5 + w_6, &quot;Total weight: &quot;)\r\n<\/pre>\n<p>And the output is (values in kg):<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPeanuts:\r\n    0.0338915\r\nCoconut rasps:\r\n    0.0266543\r\nBrown sugar:\r\n    0.0813567\r\nCacao:\r\n    0.0267958\r\nFlour:\r\n    0.1041294\r\nSugar...and the rest:\r\n    0.0791201\r\nTotal weight:\r\n    0.3519478\r\n<\/pre>\n<pre><\/pre>\n<p>Surprisingly, the calculated weight of about 0.352 kg is pretty close to the one, indicated on the label.<\/p>\n<p>Just add 2 eggs and 120 g butter. The &lt;&lt;rest&gt;&gt; would be about 1 tea-spoon of baking soda, a knife tip of cinnamon and a pinch of salt.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago I got a mixture for a chocolate-coconut cake. So, my thought: How to bake it again if the cake is deliciouse? Of course, by reverse engineering the mixture! The ingredients reading as following: 1. Using the lable to identify the different segments: From top to down: Peanuts, coconut rasps, brown sugar, cacao, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10,14,15],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-absurdity","tag-baking","tag-reverse-engineering"],"_links":{"self":[{"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":16,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":553,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/posts\/532\/revisions\/553"}],"wp:attachment":[{"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.launet.ch\/blog\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}