Wolfram for Food Science | Things to Try
Wolfram for Food Science | Things to Try
Make edits and run any piece of code by clicking inside the code and pressing .
+
Analyze Food Chemistry
Analyze Food Chemistry
Generate a 3D plot for the biomolecule alpha-lactalbumin, a major whey protein found in foods made from animal milk: |
In[]:=
BioMoleculePlot3D[BioMolecule[ExternalIdentifier["PDBStructureID","1F6S"]]]
Compare the molecular structure of a monounsaturated fatty acid (one double bond) to a saturated fatty acid (no double bonds): |
In[]:=
MoleculePlot/@,
Create a tree of all 20 amino acids grouped by the similarities of their molecular structures: |
In[]:=
ClusteringTreeEntityList,DistanceFunction->MoleculeFeatureDistance
See why the caffeine molecule can cross the blood-brain barrier and act as a stimulant (due to three methyl groups in its molecular structure) versus the minimal stimulant effect from chocolate (with just two methyl groups in chocolate’s theobromine molecule): |
In[]:=
MoleculePlot[#,{MoleculePattern["C"]}]&/@,
Plot the conjugated system of alternating single and double bonds that gives turmeric, saffron and paprika their vibrant colors: |
In[]:=
colorfulSpicesAssoc=<|"turmeric"->,"saffron"->,"paprika"->|>;KeyValueMap[{MoleculePlot[#2,{{MoleculePattern["[#6]:[#6]"],MoleculePattern["[#6]-[#6]=[#6,#8]"]}}],#2}&,colorfulSpicesAssoc]//Thread//Grid
Get the approximate pH of acidic foods: |
In[]:=
acidicFoodNames={"lemon","lime","tomato","apple","orange","pineapple","vinegar","sauerkraut"};pH=AssociationThreadacidicFoodNames,EntityValueInterpreter["Food"][acidicFoodNames],
Plot the pH: |
In[]:=
ListPlot[Values[pH]]
Model Physical and Chemical Properties
Model Physical and Chemical Properties
Compare the melting points of triglycerides formed with monounsaturated fats versus saturated fats: |
In[]:=
DatasetEntityValue,,{"Phase","MeltingPoint"},"EntityPropertyAssociation"
Calculate when visible crust color begins to develop for a loaf of bread baking at 180°C: |
In[]:=
maillardReactionVariables={QuantityVariable["T","Temperature"]->Quantity[180,"DegreesCelsius"],QuantityVariable[Subscript["E","a"],"ActivationEnergy"]->Quantity[64.151,"Kilojoules"/"Moles"],QuantityVariable["A","FirstOrderArrheniusFactor"]->Quantity[42000,"PerSecond"]};firstOrderRateConstant=FormulaData["FirstOrderArrheniusEquation",maillardReactionVariables];UnitConvert[1/firstOrderRateConstant[[2]],"Minutes"]
Get the thermal conductivity of frying pan materials to see how well they conduct heat: |
In[]:=
panMaterials={"copper","aluminum","iron","carbon steel","stainless steel"};thermalConductivities=AssociationThread[panMaterials,WolframAlpha["thermal conductivity "<>#,{{"Result",1},"Plaintext"}]&/@panMaterials];Grid[Prepend[List@@@Normal[thermalConductivities],{"Material","Thermal Conductivity"}],Frame->All,Spacings->{2,1}]
Explore temperature-viscosity models: |
In[]:=
ResourceData["Demonstration: Parameterizing Temperature-Viscosity Relations"]
Ensure Food Safety
Ensure Food Safety
Get the maximum recommended refrigerated and frozen storage times for raw ground beef: |
In[]:=
EntityValueInterpreter["Food"]["raw ground beef"],,,"PropertyAssociation"
Visualize the 3D biomolecule structure of the peanut allergen Ara h 2: |
In[]:=
BioMoleculePlot3D[BioMolecule[ExternalIdentifier["PDBStructureID","3OB4"]],ColorRules->"Residues"]
Compare different models for microbial thermal inactivation: |
In[]:=
ResourceData["Demonstration: Weibullian versus Log-Linear Microbial Survival Models"]
Recipe & Nutrition Analysis
Recipe & Nutrition Analysis
Get a compass plot of the macronutrients in 200g of oats as a percent of recommended daily value: |
In[]:=
EntityValueEntityInstanceEntity["Food",{EntityProperty["Food","FoodType"]->ContainsExactly[{Entity["FoodType","Oat"]}],EntityProperty["Food","AddedFoodTypes"]->ContainsExactly[{}]}],,"CompassPlot"
See the surprising result when comparing iron content in bivalves (mussels, clams and oysters) with the iron per gram in red meat: |
In[]:=
bivalvesAndBeefNames={"clams","mussels","oysters","beef"};bivalvesAndBeefInterpret=AssociationThread[bivalvesAndBeefNames,(Interpreter["Food"][#1]&)/@bivalvesAndBeefNames];ironData=;ironDataSorted=ReverseSortBy[ironData,#["RelativeIronContent"]&];bivalveLabels=Keys[ironDataSorted];customColors=;BarChartironDataSorted,
Plot the linear relationship between the amount of fat and calories in meats: |
In[]:=
meats=Interpreter["Food"][{"bacon","beef","chicken","chorizo","duck","ham","mutton","sausage","steak","turkey","goat","hot dog","bison","prosciutto","pastrami","bratwurst"}];meatsFat=NQuantityMagnitudeEntityValuemeats,;meatsCalories=NQuantityMagnitudeEntityValuemeats,;meatsFatCaloriesPairs=Transpose[{meatsFat,meatsCalories}];ListPlotmeatsFatCaloriesPairs,
Use linear regression to model the relationship between fat and calories in meats: |
In[]:=
ListFitPlot[meatsFatCaloriesPairs,PlotStyle->Red,AxesLabel->{"Fat g/g","Cal/g"},PlotFit->"Linear",PlotFitElements->{"DataPoints","BandCurves"}]
Show the strong positive correlation between the amount of fat and calories in meats with smooth 2D and 3D histograms: |
In[]:=
Row[{SmoothHistogram[meatsFatCaloriesPairs,ImageSize->Medium],SmoothHistogram3D[meatsFatCaloriesPairs,ImageSize->Medium]}]
Create an interactive bar chart of amino acid content for a list of high-protein foods: |
In[]:=
ResourceFunction["AminoAcidsBarChart"][{"beef","chicken","eggs","pork","tempeh"}]
Get the omega-3 fatty acids content in 4oz salmon: |
In[]:=
EntityValueEntityInstance,,,,,"PropertyAssociation"
Access Real-World Data Instantly
Access Real-World Data Instantly
Get a list of branded foods that contain high fructose corn syrup: |
In[]:=
RandomEntity,10
Compare the average alcohol content in a glass of wine versus a pint of beer: |
In[]:=
EntityValueEntityInstance,,EntityInstance,,"AbsoluteAlcoholContent"
Focus on Sustainability
Focus on Sustainability
Computation for Foodies
Computation for Foodies

