Electric Kettle: Model Calibration

Introduction

This model studies how heating and cooling in an electric kettle can be modeled and controlled. In this notebook, the parameters for heating and cooling are fitted to real-world measurements.

Explore the available scenarios by evaluating each cell in order. Evaluation is done by selecting a cell and pressing Shift+Enter.

In order to get the full experience of this example, you need the following:

Wolfram System Modeler; a free trial download is available at www.wolfram.com/system-modeler

The model that came in the same bundle as this notebook

For more information about Wolfram System Modeler, visit www.wolfram.com/system-modeler.

Initialize

Define the model name:

mmodel="IndustryExamples.ConsumerProducts.ElectricKettle.ElectricKettleControl";

Model Calibration

Data

Here is the measured data used to fit parameters in the model:

coolingdata={{0.`,99.`},{60.`,97.`},{120.`,96.`},{180.`,95.`},{240.`,94.`},{300.`,93.`},{360.`,91.`},{420.`,90.`},{480.`,89.`},{540.`,88.`},{600.`,88.`},{660.`,87.`},{720.`,86.`},{780.`,85.`},{900.`,84.`},{1200.`,81.`},{1500.`,78.`},{1800.`,75.`},{2100.`,73.`},{2400.`,71.`},{2700.`,68.`},{3000.`,66.`},{3015.`,66.`}};
heatdata={{0.`,22.`},{15.`,25.`},{30.`,31.`},{45.`,35.`},{60.`,39.`},{75.`,44.`},{90.`,48.`},{105.`,52.`},{120.`,57.`},{135.`,61.`},{150.`,66.`},{165.`,71.`},{180.`,75.`},{195.`,79.`},{210.`,83.`},{225.`,87.`},{240.`,91.`},{255.`,95.`},{265.`,98.`},{270.`,99.`}};
alldata=Join[heatdata,coolingdata+Table[{300,0},{Length[coolingdata]}]];

Convert measurement data to kelvin:

alldataK = {#[[1]],#[[2]]+273.15}&/@alldata;
dataPlot =ListPlot[alldataK]

Calibrate the model

Turn off the heating after 300 seconds to match the measurement data:

sim=SystemModel[mmodel,<|"ParameterValues"-> {"controlTable"-> {{0,1},{300,0}}}|>];

Plot the temperature of water:

plot = SystemModelPlot[sim,"water.T",{0,3600},TargetUnits->None]

Calibrate the model parameters using the experimental data

cmodel =SystemModelCalibrate[<|"water.T"->alldataK|>,sim,{"radiation.Gr",0.01}]

Simulate the calibrated model:

calSim = SystemModelSimulate[cmodel,3600]

Compare the calibrated model results with the measurement data:

cplot = SystemModelPlot[calSim,{"water.T"},3600,PlotRange->All,];
Show[dataPlot,cplot,PlotRange->All]

Terms and Conditions of Use

This domain example is an informational resource made freely available by Wolfram Research.

Use of This Example

• You may not use this example for any purpose that is unlawful or dangerous.
• You assume total responsibility and risk for your use of this example.
• You may not present this example with any alteration to its trade dress, trademarks, or design.

License

All content in this bundle is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. By accessing the content or using it in any way, you accept and agree to be bound by the terms of this license. If you do not agree to these Terms of Use, you may not use this content. Wolfram Research reserves the right to change, modify, add to, or remove portions of these Terms of Use at any time without notice. Please refer back to www.wolfram.com for the latest Terms of Use.

A summary of the licensing terms can be found at:
http://creativecommons.org/licenses/by-nc-sa/3.0

The full legal code can be found at: 
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode