/*
 * lib_drive_cycle.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 16 2026, 15:51 by COMSOL 6.4.0.422. */
public class lib_drive_cycle {

  public static Model run() {
    Model model = ModelUtil.create("Model");

//    From the File menu, choose Application Libraries.
//    In the Application Libraries window, select Battery Design Module > Lithium-Ion Batteries, Performance > lib_base_model_1d in the tree.
//    Click Open.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 1);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").physics().create("liion", "LithiumIonBatteryMPH", "geom1");

    model.study().create("std1");
    model.study("std1").create("cdi", "CurrentDistributionInitialization");
    model.study("std1").feature("cdi").set("solnum", "auto");
    model.study("std1").feature("cdi").set("notsolnum", "auto");
    model.study("std1").feature("cdi").set("outputmap", new String[]{});
    model.study("std1").feature("cdi").set("ngenAUX", "1");
    model.study("std1").feature("cdi").set("goalngenAUX", "1");
    model.study("std1").feature("cdi").set("ngenAUX", "1");
    model.study("std1").feature("cdi").set("goalngenAUX", "1");
    model.study("std1").create("time", "Transient");
    model.study("std1").feature("time").set("initialtime", "0");
    model.study("std1").feature("time").set("solnum", "auto");
    model.study("std1").feature("time").set("notsolnum", "auto");
    model.study("std1").feature("time").set("outputmap", new String[]{});

//    To import content from file, use:
//    model.param().loadFile("FILENAME");
    model.param().set("epss_neg", "0.6", "Active electrode volume fraction, negative");
    model.param().set("epss_pos", "0.6", "Active electrode volume fraction, positive");
    model.param().set("epss_binder_neg", "0.1", "Binder volume fraction, negative");
    model.param().set("epss_binder_pos", "0.1", "Binder volume fraction, positive");
    model.param().set("epsl_neg", "1-epss_neg-epss_binder_neg", "Electrolyte volume fraction, negative");
    model.param().set("epsl_sep", "0.4", "Separator volume fraction");
    model.param().set("epsl_pos", "1-epss_pos-epss_binder_pos", "Electrolyte volume fraction, positive");
    model.param().set("sigmas_neg", "1[S/m]", "Effective electrode conductivity, negative");
    model.param().set("sigmas_pos", "1[S/m]", "Effective electrode conductivity, positive");
    model.param().set("rp_neg", "6[um]", "Electrode particle radius, negative");
    model.param().set("rp_pos", "5[um]", "Electrode particle radius, positive");
    model.param().set("cs_max_neg", "31507[mol/m^3]", "Maximum concentration, negative");
    model.param().set("cs_max_pos", "49000[mol/m^3]", "Maximum concentration, positive");
    model.param().set("i0_ref_neg", "10[A/m^2]", "Exchange current density at 50% lithiation, negative");
    model.param().set("i0_ref_pos", "10[A/m^2]", "Exchange current density at 50% lithiation, positive");
    model.param().set("L_sep", "20[um]", "Separator thickness");
    model.param().set("L_pos", "45[um]", "Positive electrode thickness");
    model.param()
         .set("L_neg", "(1-0.1)*epss_pos*cs_max_pos*L_pos/(0.8*epss_neg*cs_max_neg)", "Negative electrode thickness");
    model.param().set("L_ccs", "10[um]", "Thickness of current collectors");
    model.param().set("V_cell", "90[%]*(10.5[mm])^2*pi*70[mm]", "Active cell volume");
    model.param().set("A_cell", "V_cell/(L_neg+L_sep+L_pos+L_ccs/2)", "Cell area");
    model.param().set("soc_init", "0", "Initial SOC");
    model.param().set("T", "25[degC]", "Temperature");

    model.component("comp1").material().create("mat1", "Common");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("an1", "Analytic");
    model.component("comp1").material("mat1").propertyGroup()
         .create("ElectrolyteConductivity", "ElectrolyteConductivity", "Electrolyte conductivity");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func()
         .create("an1", "Analytic");
    model.component("comp1").material("mat1").propertyGroup()
         .create("SpeciesProperties", "SpeciesProperties", "Species properties");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func().create("an1", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int1", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int2", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int3", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func().create("an2", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int4", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int5", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func()
         .create("int6", "Interpolation");
    model.component("comp1").material("mat1").propertyGroup()
         .create("ElectrolyteSaltConcentration", "ElectrolyteSaltConcentration", "Electrolyte salt concentration");
    model.component("comp1").material("mat1").label("LiPF6 in 3:7 EC:EMC (Liquid, Li-ion Battery)");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("funcname", "Dl");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("expr", "1.01e3*exp(1.01*c)*exp(-1.56e3/T)*exp(-4.87e2/T*c)*1e-6");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("args", new String[]{"c", "T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("fununit", "cm^2/s");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("argunit", new String[]{"mol/L", "K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotaxis", new String[]{"on", "on"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotfixedvalue", new String[]{"0", "0"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotargs", new String[][]{{"c", "0", "3000"}, {"T", "263.15[K]", "263.15[K]"}});
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("diffusion", new String[]{"Dl(min(max(c,eps),3[M]),min(max(T,-10[degC]),50[degC]))", "0", "0", "0", "Dl(min(max(c,eps),3[M]),min(max(T,-10[degC]),50[degC]))", "0", "0", "0", "Dl(min(max(c,eps),3[M]),min(max(T,-10[degC]),50[degC]))"});
    model.component("comp1").material("mat1").propertyGroup("def")
         .setPropertyInfo("diffusion", "Johannes Landesfeind and Hubert A. Gasteiger, Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes, Journal of The Electrochemical Society, 166 (14) A3079-A3097 (2019)");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("concentration");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("funcname", "sigmal");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("expr", "5.21e-1*(1+(T-2.28e2))*c*(1-1.06*sqrt(c)+3.53e-1*(1-3.59e-3*exp(1000/T))*c)/(1+c^4*1.48e-3*(exp(1000/T)))");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("args", new String[]{"c", "T"});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("fununit", "mS/cm");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("argunit", new String[]{"mol/L", "K"});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("plotaxis", new String[]{"on", "on"});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("plotfixedvalue", new String[]{"0", "0"});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").func("an1")
         .set("plotargs", new String[][]{{"c", "0", "5000"}, {"T", "-10[degC]", "50[degC]"}});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity")
         .set("sigmal", new String[]{"sigmal(max(c,eps),min(max(T,-10[degC]),50[degC]))", "0", "0", "0", "sigmal(max(c,eps),min(max(T,-10[degC]),50[degC]))", "0", "0", "0", "sigmal(max(c,eps),min(max(T,-10[degC]),50[degC]))"});
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity")
         .setPropertyInfo("sigmal", "Johannes Landesfeind and Hubert A. Gasteiger, Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes, Journal of The Electrochemical Society, 166 (14) A3079-A3097 (2019)");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").addInput("concentration");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteConductivity").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1").set("funcname", "TDF");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("expr", "p1_TDF(T)*c^2+p2_TDF(T)*c+p3_TDF(T)");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("args", new String[]{"c", "T"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1").set("fununit", "1");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("argunit", new String[]{"mol/L", "K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("plotaxis", new String[]{"on", "on"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("plotfixedvalue", new String[]{"0", "0"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an1")
         .set("plotargs", new String[][]{{"c", "0", "3000"}, {"T", "-10[degC]", "50[degC]"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int1")
         .set("funcname", "p1_TDF");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int1")
         .set("table", new String[][]{{"263.15", "2.45e-1"}, 
         {"273.15", "7.23e-1"}, 
         {"283.15", "7.36e-1"}, 
         {"293.15", "6.65e-1"}, 
         {"303.15", "3.7e-1"}, 
         {"313.15", "1.85e-2"}, 
         {"323.15", "-3.92e-2"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int1")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int1")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int2")
         .set("funcname", "p2_TDF");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int2")
         .set("table", new String[][]{{"263.15", "4.49e-1"}, 
         {"273.15", "9.8e-2"}, 
         {"283.15", "-1.55e-1"}, 
         {"293.15", "-2.57e-1"}, 
         {"303.15", "7.6e-1"}, 
         {"313.15", "1.75"}, 
         {"323.15", "1.76"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int2")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int2")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int3")
         .set("funcname", "p3_TDF");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int3")
         .set("table", new String[][]{{"263.15", "3.41e-1"}, 
         {"273.15", "5e-1"}, 
         {"283.15", "8.63e-1"}, 
         {"293.15", "1.03"}, 
         {"303.15", "7.17e-1"}, 
         {"313.15", "4.8e-1"}, 
         {"323.15", "6.75e-1"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int3")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int3")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("funcname", "tplus");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("expr", "p1_tplus(T)*c^2+p2_tplus(T)*c+p3_tplus(T)");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("args", new String[]{"c", "T"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2").set("fununit", "1");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("argunit", new String[]{"mol/L", "K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("plotaxis", new String[]{"on", "on"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("plotfixedvalue", new String[]{"0", "0"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("an2")
         .set("plotargs", new String[][]{{"c", "0", "3000"}, {"T", "-10[degC]", "50[degC]"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int4")
         .set("funcname", "p1_tplus");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int4")
         .set("table", new String[][]{{"263.15", "4.1e-2"}, 
         {"273.15", "1.04e-1"}, 
         {"283.15", "1.09e-1"}, 
         {"293.15", "1.4e-1"}, 
         {"303.15", "2.97e-2"}, 
         {"313.15", "-1.39e-2"}, 
         {"323.15", "-5.87e-3"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int4")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int4")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int5")
         .set("funcname", "p2_tplus");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int5")
         .set("table", new String[][]{{"263.15", "-3.63e-1"}, 
         {"273.15", "-3.38e-1"}, 
         {"283.15", "-4.12e-1"}, 
         {"293.15", "-5.74e-1"}, 
         {"303.15", "-2.1e-1"}, 
         {"313.15", "-9.01e-2"}, 
         {"323.15", "-1.3e-1"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int5")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int5")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int6")
         .set("funcname", "p3_tplus");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int6")
         .set("table", new String[][]{{"263.15", "-9.17e-2"}, 
         {"273.15", "2.13e-1"}, 
         {"283.15", "3.98e-1"}, 
         {"293.15", "5.57e-1"}, 
         {"303.15", "4.92e-1"}, 
         {"313.15", "5.26e-1"}, 
         {"323.15", "6.12e-1"}});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int6")
         .set("fununit", new String[]{"1"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").func("int6")
         .set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties")
         .set("transpNum", "tplus(min(max(c,eps),3[M]),min(max(T,-10[degC]),50[degC]))");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties")
         .setPropertyInfo("transpNum", "Johannes Landesfeind and Hubert A. Gasteiger, Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes, Journal of The Electrochemical Society, 166 (14) A3079-A3097 (2019)");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties")
         .set("fcl", "TDF(min(max(c,eps),3[M]),min(max(T,-10[degC]),50[degC]))-1");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties")
         .setPropertyInfo("fcl", "Johannes Landesfeind and Hubert A. Gasteiger, Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes, Journal of The Electrochemical Society, 166 (14) A3079-A3097 (2019)");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").addInput("concentration");
    model.component("comp1").material("mat1").propertyGroup("SpeciesProperties").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteSaltConcentration").identifier("cElsalt");
    model.component("comp1").material("mat1").propertyGroup("ElectrolyteSaltConcentration")
         .set("cElsalt", "1200[mol/m^3]");

    model.component("comp1").geom("geom1").run();

    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("int1", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("int2", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("int3", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("int4", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup()
         .create("ElectrodePotential", "ElectrodePotential", "Equilibrium potential");
    model.component("comp1").material("mat2").propertyGroup()
         .create("OperationalSOC", "OperationalSOC", "Operational electrode state of charge");
    model.component("comp1").material("mat2").propertyGroup().create("ic", "ic", "Intercalation strain");
    model.component("comp1").material("mat2").propertyGroup("ic").func().create("int1", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup()
         .create("EquilibriumConcentration", "EquilibriumConcentration", "Equilibrium concentration");
    model.component("comp1").material("mat2").propertyGroup()
         .create("EquilibriumPotentialWithDOCInput", "EquilibriumPotentialWithDOCInput", "Equilibrium potential (using degree of conversion as model input)");
    model.component("comp1").material("mat2").propertyGroup()
         .create("EquilibriumDegreeOfConversion", "EquilibriumDegreeOfConversion", "Equilibrium degree of conversion");
    model.component("comp1").material("mat2").label("Graphite, LixC6 MCMB (Negative, Li-ion Battery)");
    model.component("comp1").material("mat2").propertyGroup("def").func("int1").set("funcname", "E_int");
    model.component("comp1").material("mat2").propertyGroup("def").func("int1")
         .set("table", new String[][]{{"0", "32.47"}, {"0.333", "28.56"}, {"0.5", "58.06"}, {"1", "108.67"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("int1").set("fununit", new String[]{"GPa"});
    model.component("comp1").material("mat2").propertyGroup("def").func("int1").set("argunit", new String[]{"1"});
    model.component("comp1").material("mat2").propertyGroup("def").func("int2").set("funcname", "nu_int");
    model.component("comp1").material("mat2").propertyGroup("def").func("int2")
         .set("table", new String[][]{{"0", "0.32"}, {"0.333", "0.39"}, {"0.5", "0.34"}, {"1", "0.24"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("int2").set("fununit", new String[]{""});
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("funcname", "Eeq");
    model.component("comp1").material("mat2").propertyGroup("def").func("int3")
         .set("table", new String[][]{{"0", "2.781186612"}, 
         {"0.01", "1.520893224"}, 
         {"0.02", "0.893922607"}, 
         {"0.03", "0.581284406"}, 
         {"0.04", "0.42452844"}, 
         {"0.05", "0.344895805"}, 
         {"0.06", "0.303146342"}, 
         {"0.07", "0.279578072"}, 
         {"0.08", "0.264093089"}, 
         {"0.09", "0.251347845"}, 
         {"0.1", "0.238588379"}, 
         {"0.11", "0.224803164"}, 
         {"0.12", "0.210294358"}, 
         {"0.13", "0.196408586"}, 
         {"0.14", "0.184624188"}, 
         {"0.15", "0.175188157"}, 
         {"0.16", "0.167373311"}, 
         {"0.17", "0.160452107"}, 
         {"0.18", "0.154025412"}, 
         {"0.19", "0.147948522"}, 
         {"0.2", "0.142214997"}, 
         {"0.21", "0.13688271"}, 
         {"0.22", "0.132033114"}, 
         {"0.23", "0.127747573"}, 
         {"0.24", "0.124091616"}, 
         {"0.25", "0.121103387"}, 
         {"0.26", "0.11878567"}, 
         {"0.27", "0.117102317"}, 
         {"0.28", "0.115980205"}, 
         {"0.29", "0.115317054"}, 
         {"0.3", "0.114993965"}, 
         {"0.31", "0.114890105"}, 
         {"0.32", "0.114886278"}, 
         {"0.33", "0.114884619"}, 
         {"0.34", "0.114873068"}, 
         {"0.35", "0.114824904"}, 
         {"0.36", "0.114644725"}, 
         {"0.37", "0.114372614"}, 
         {"0.38", "0.114017954"}, 
         {"0.39", "0.11359371"}, 
         {"0.4", "0.11311133"}, 
         {"0.41", "0.112575849"}, 
         {"0.42", "0.111980245"}, 
         {"0.43", "0.111297682"}, 
         {"0.44", "0.110470149"}, 
         {"0.45", "0.109393081"}, 
         {"0.46", "0.107900592"}, 
         {"0.47", "0.10576964"}, 
         {"0.48", "0.102783317"}, 
         {"0.49", "0.09889031"}, 
         {"0.5", "0.094391564"}, 
         {"0.51", "0.089921069"}, 
         {"0.52", "0.086112415"}, 
         {"0.53", "0.083265315"}, 
         {"0.54", "0.081326247"}, 
         {"0.55", "0.080074892"}, 
         {"0.56", "0.07928329"}, 
         {"0.57", "0.078778765"}, 
         {"0.58", "0.078447703"}, 
         {"0.59", "0.078220432"}, 
         {"0.6", "0.078055641"}, 
         {"0.61", "0.077929111"}, 
         {"0.62", "0.077826563"}, 
         {"0.63", "0.077739397"}, 
         {"0.64", "0.077662227"}, 
         {"0.65", "0.077591472"}, 
         {"0.66", "0.077524557"}, 
         {"0.67", "0.077459463"}, 
         {"0.68", "0.077394455"}, 
         {"0.69", "0.077327934"}, 
         {"0.7", "0.077258337"}, 
         {"0.71", "0.077184077"}, 
         {"0.72", "0.077103499"}, 
         {"0.73", "0.077014851"}, 
         {"0.74", "0.076916258"}, 
         {"0.75", "0.07680571"}, 
         {"0.76", "0.07668104"}, 
         {"0.77", "0.07653992"}, 
         {"0.78", "0.076379839"}, 
         {"0.79", "0.076198086"}, 
         {"0.8", "0.075991699"}, 
         {"0.81", "0.075757371"}, 
         {"0.82", "0.075491288"}, 
         {"0.83", "0.075188813"}, 
         {"0.84", "0.07484398"}, 
         {"0.85", "0.074448647"}, 
         {"0.86", "0.07399118"}, 
         {"0.87", "0.073454466"}, 
         {"0.88", "0.072812991"}, 
         {"0.89", "0.072028722"}, 
         {"0.9", "0.071045433"}, 
         {"0.91", "0.069780996"}, 
         {"0.92", "0.068116222"}, 
         {"0.93", "0.065874599"}, 
         {"0.94", "0.062770873"}, 
         {"0.95", "0.058253898"}, 
         {"0.96", "0.051075794"}, 
         {"0.97", "0.038790069"}, 
         {"0.98", "0.020172191"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("extrap", "linear");
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("fununit", new String[]{"V"});
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("argunit", new String[]{""});
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("defineinv", true);
    model.component("comp1").material("mat2").propertyGroup("def").func("int3").set("funcinvname", "Eeq_inv");
    model.component("comp1").material("mat2").propertyGroup("def").func("int4").set("funcname", "dEeqdT");
    model.component("comp1").material("mat2").propertyGroup("def").func("int4")
         .set("table", new String[][]{{"0", "3.0e-4"}, 
         {"0.17", "0"}, 
         {"0.24", "-6e-5"}, 
         {"0.28", "-1.6e-4"}, 
         {"0.5", "-1.6e-4"}, 
         {"0.54", "-9e-5"}, 
         {"0.71", "-9e-5"}, 
         {"0.85", "-1.0e-4"}, 
         {"1.0", "-1.2e-4"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("int4").set("fununit", new String[]{"V/K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("int4").set("argunit", new String[]{""});
    model.component("comp1").material("mat2").propertyGroup("def").set("youngsmodulus", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("poissonsratio", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("youngsmodulus", "E_int(c/csmax)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("youngsmodulus", "Yue Qi et al 2010 J. Electrochem. Soc. 157 A558");
    model.component("comp1").material("mat2").propertyGroup("def").set("poissonsratio", "nu_int(c/csmax)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("poissonsratio", "Yue Qi et al 2010 J. Electrochem. Soc. 157 A558");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"100[S/m]", "0", "0", "0", "100[S/m]", "0", "0", "0", "100[S/m]"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("electricconductivity", "V. Srinivasan, and J. Newman, \u201cDesign and Optimization of a Natural Graphite/Iron Phosphate Lithium Ion Cell,\u201d J. Electrochem. Soc., vol. 151, p. 1530, 2004.");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("diffusion", new String[]{"1.4523e-13*exp(68025.7/8.314*(1/(T_ref/1[K])-1/(T2/1[K])))[m^2/s]", "0", "0", "0", "1.4523e-13*exp(68025.7/8.314*(1/(T_ref/1[K])-1/(T2/1[K])))[m^2/s]", "0", "0", "0", "1.4523e-13*exp(68025.7/8.314*(1/(T_ref/1[K])-1/(T2/1[K])))[m^2/s]"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("diffusion", "K. Kumaresan, G. Sikha, and R. E. White, \u201cThermal Model for a Li-Ion Cell,\u201d J. Electrochem. Soc., vol. 155, p. A164, 2008.");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalconductivity", new String[]{"1[W/(m*K)]", "0", "0", "0", "1[W/(m*K)]", "0", "0", "0", "1[W/(m*K)]"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("thermalconductivity", "S. Chen, C. Wan, and Y. Wang, J. Power Sources, 140, 111 (2005).");
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", "750[J/(kg*K)]");
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("heatcapacity", "SI Chemical Data, John Wiley & Sons, 1994");
    model.component("comp1").material("mat2").propertyGroup("def").set("density", "2300[kg/m^3]");
    model.component("comp1").material("mat2").propertyGroup("def")
         .setPropertyInfo("density", "SI Chemical Data, John Wiley & Sons, 1994");
    model.component("comp1").material("mat2").propertyGroup("def").set("csmax", "31507[mol/m^3]");
    model.component("comp1").material("mat2").propertyGroup("def").descr("csmax", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("T_ref", "318[K]");
    model.component("comp1").material("mat2").propertyGroup("def").descr("T_ref", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("T2", "min(393.15,max(T,223.15))");
    model.component("comp1").material("mat2").propertyGroup("def").descr("T2", "");
    model.component("comp1").material("mat2").propertyGroup("def").addInput("temperature");
    model.component("comp1").material("mat2").propertyGroup("def").addInput("concentration");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").identifier("eeq");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential")
         .set("Eeq", "def.Eeq(doc)+def.dEeqdT(doc)*(T-298[K])");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential")
         .setPropertyInfo("Eeq", "D. P Karthikeyan, G. Sikha, and R. E. White, \u201cThermodynamic model development for lithium intercalation electrodes,\u201d J. Power Sources, vol. 185, p. 1398, 2008.");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").set("dEeqdT", "def.dEeqdT(doc)");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential")
         .setPropertyInfo("dEeqdT", "K. E. Thomas, and J. Newman, \u201cHeats of mixing and of entropy in porous insertion electrodes,\u201d J. Power Sources., vol. 119-121, p. 844, 2003.");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").set("cEeqref", "def.csmax");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").set("doc", "c/cEeqref");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential")
         .descr("doc", "Degree of conversion (state of lithiation)");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").addInput("concentration");
    model.component("comp1").material("mat2").propertyGroup("ElectrodePotential").addInput("temperature");
    model.component("comp1").material("mat2").propertyGroup("OperationalSOC").identifier("opsoc");
    model.component("comp1").material("mat2").propertyGroup("OperationalSOC").set("socmax", "def.Eeq_inv(E_min)");
    model.component("comp1").material("mat2").propertyGroup("OperationalSOC").set("socmin", "def.Eeq_inv(E_max)");
    model.component("comp1").material("mat2").propertyGroup("OperationalSOC").set("E_max", "1[V]");
    model.component("comp1").material("mat2").propertyGroup("OperationalSOC").set("E_min", "0.075[V]");
    model.component("comp1").material("mat2").propertyGroup("ic").func("int1").set("funcname", "dVOLdSOL");
    model.component("comp1").material("mat2").propertyGroup("ic").func("int1")
         .set("table", new String[][]{{"0", "0"}, 
         {"0.006802721088435382", "0.12500000000000178"}, 
         {"0.06316812439261421", "1.2736486486486491"}, 
         {"0.11175898931000966", "2.523648648648649"}, 
         {"0.17978620019436342", "3.5709459459459474"}, 
         {"0.2400388726919339", "4.449324324324325"}, 
         {"0.2905733722060252", "5.192567567567568"}, 
         {"0.3566569484936831", "5.66554054054054"}, 
         {"0.4188532555879494", "5.969594594594595"}, 
         {"0.48104956268221566", "6.10472972972973"}, 
         {"0.5432458697764819", "6.173648648648647"}, 
         {"0.58600583090379", "6.306081081081081"}, 
         {"0.6112730806608356", "7.726351351351352"}, 
         {"0.6443148688046647", "8.570945945945946"}, 
         {"0.694849368318756", "9.449324324324323"}, 
         {"0.7414965986394557", "10.29391891891892"}, 
         {"0.7764820213799805", "10.902027027027025"}, 
         {"0.8231292517006802", "11.543918918918918"}, 
         {"0.8542274052478133", "12.152027027027026"}, 
         {"0.8833819241982507", "12.827702702702702"}, 
         {"0.9183673469387755", "12.996621621621621"}, 
         {"0.9494655004859086", "13.16554054054054"}});
    model.component("comp1").material("mat2").propertyGroup("ic").func("int1").set("extrap", "linear");
    model.component("comp1").material("mat2").propertyGroup("ic").func("int1").set("fununit", new String[]{"%"});

    return model;
  }

  public static Model run2(Model model) {
    model.component("comp1").material("mat2").propertyGroup("ic").func("int1").set("argunit", new String[]{"1"});
    model.component("comp1").material("mat2").propertyGroup("ic").identifier("is");
    model.component("comp1").material("mat2").propertyGroup("ic").set("dvol", "dVOLdSOL(c/def.csmax)");
    model.component("comp1").material("mat2").propertyGroup("ic")
         .setPropertyInfo("dvol", "S. Schweidler, L. de Biasi, A. Schiele, P. Hartmann, T. Brezesinski and J. Janek, \"Volume Changes of Graphite Anodes Revisited: A Combined Operando X-Ray Diffraction and In Situ Pressure Analysis Study\", J. Phys. Chem. C, 2018, 122, 8829\u20138835");
    model.component("comp1").material("mat2").propertyGroup("ic").addInput("concentration");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumConcentration")
         .set("csEq", "def.csmax*def.Eeq_inv(V)");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumConcentration")
         .addInput("electricpotential");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumPotentialWithDOCInput")
         .set("Eeq", "def.Eeq(doc)+def.dEeqdT(doc)*(T-298[K])");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumPotentialWithDOCInput")
         .set("dEeqdT", "def.dEeqdT(doc)");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumPotentialWithDOCInput")
         .addInput("degreeofconversion");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumPotentialWithDOCInput")
         .addInput("temperature");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumDegreeOfConversion")
         .set("docEq", "def.Eeq_inv(V)");
    model.component("comp1").material("mat2").propertyGroup("EquilibriumDegreeOfConversion")
         .addInput("electricpotential");
    model.component("comp1").material().create("mat3", "Common");
    model.component("comp1").material("mat3").propertyGroup("def").func().create("int1", "Interpolation");
    model.component("comp1").material("mat3").propertyGroup()
         .create("ElectrodePotential", "ElectrodePotential", "Equilibrium potential");
    model.component("comp1").material("mat3").propertyGroup()
         .create("OperationalSOC", "OperationalSOC", "Operational electrode state of charge");
    model.component("comp1").material("mat3").propertyGroup().create("ic", "ic", "Intercalation strain");
    model.component("comp1").material("mat3").propertyGroup("ic").func().create("int1", "Interpolation");
    model.component("comp1").material("mat3").propertyGroup()
         .create("EquilibriumConcentration", "EquilibriumConcentration", "Equilibrium concentration");
    model.component("comp1").material("mat3").propertyGroup()
         .create("EquilibriumPotentialWithDOCInput", "EquilibriumPotentialWithDOCInput", "Equilibrium potential (using degree of conversion as model input)");
    model.component("comp1").material("mat3").propertyGroup()
         .create("EquilibriumDegreeOfConversion", "EquilibriumDegreeOfConversion", "Equilibrium degree of conversion");
    model.component("comp1").material("mat3").propertyGroup().create("pg1", "def", "Electric conductivity");
    model.component("comp1").material("mat3").propertyGroup("pg1").func().create("int1", "Interpolation");
    model.component("comp1").material("mat3").label("NMC 111, LiNi0.33Mn0.33Co0.33O2 (Positive, Li-ion Battery)");
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("funcname", "Eeq");
    model.component("comp1").material("mat3").propertyGroup("def").func("int1")
         .set("table", new String[][]{{"0", "4.44"}, 
         {"0.032", "4.34"}, 
         {"0.102", "4.23"}, 
         {"0.187", "4.13"}, 
         {"0.289", "4.025"}, 
         {"0.38", "3.945"}, 
         {"0.543", "3.835"}, 
         {"0.775", "3.71"}, 
         {"0.872", "3.62"}, 
         {"0.925", "3.51"}, 
         {"0.943", "3.42"}, 
         {"0.957", "3.30"}, 
         {"0.966", "3.165"}, 
         {"0.970", "3.02"}, 
         {"0.972", "2.90"}, 
         {"0.975", "2.688"}});
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("extrap", "linear");
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("fununit", new String[]{"V"});
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("argunit", new String[]{""});
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("defineinv", true);
    model.component("comp1").material("mat3").propertyGroup("def").func("int1").set("funcinvname", "Eeq_inv");
    model.component("comp1").material("mat3").propertyGroup("def").set("poissonsratio", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("youngsmodulus", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("thermalconductivity", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("thermalexpansioncoefficient", "");
    model.component("comp1").material("mat3").propertyGroup("def").set("poissonsratio", "0.25");
    model.component("comp1").material("mat3").propertyGroup("def")
         .setPropertyInfo("poissonsratio", "Mechanical and physical properties of LiNi0.33Mn0.33Co0.33O2 (NMC),\nE Cheng, K. Hong, N. Taylor, H. Choe,\nJ. Wolfenstinec, J. Sakamotoa,\nJournal of the European Ceramic Society 37 (2017) 3213\u20133217");
    model.component("comp1").material("mat3").propertyGroup("def").set("youngsmodulus", "199[GPa]");
    model.component("comp1").material("mat3").propertyGroup("def")
         .setPropertyInfo("youngsmodulus", "Mechanical and physical properties of LiNi0.33Mn0.33Co0.33O2 (NMC),\nE Cheng, K. Hong, N. Taylor, H. Choe,\nJ. Wolfenstinec, J. Sakamotoa,\nJournal of the European Ceramic Society 37 (2017) 3213\u20133217");
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("thermalconductivity", new String[]{"3.6[W/(m*K)]", "0", "0", "0", "3.6[W/(m*K)]", "0", "0", "0", "3.6[W/(m*K)]"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .setPropertyInfo("thermalconductivity", "Mechanical and physical properties of LiNi0.33Mn0.33Co0.33O2 (NMC),\nE Chenga, K. Hong, N. Taylor, H. Choe,\nJ. Wolfenstinec, J. Sakamotoa,\nJournal of the European Ceramic Society 37 (2017) 3213\u20133217");
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"1.2e-5[1/K]", "0", "0", "0", "1.2e-5[1/K]", "0", "0", "0", "1.2e-5[1/K]"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .setPropertyInfo("thermalexpansioncoefficient", "Mechanical and physical properties of LiNi0.33Mn0.33Co0.33O2 (NMC),\nE Chenga, K. Hong, N. Taylor, H. Choe,\nJ. Wolfenstinec, J. Sakamotoa,\nJournal of the European Ceramic Society 37 (2017) 3213\u20133217");
    model.component("comp1").material("mat3").propertyGroup("def")
         .set("diffusion", new String[]{"1e-14[m^2/s]", "0", "0", "0", "1e-14[m^2/s]", "0", "0", "0", "1e-14[m^2/s]"});
    model.component("comp1").material("mat3").propertyGroup("def")
         .setPropertyInfo("diffusion", "Jing Ying Ko et al, J. Electrochem. Soc., 166, A2939");
    model.component("comp1").material("mat3").propertyGroup("def").set("csmax", "49000[mol/m^3]");
    model.component("comp1").material("mat3").propertyGroup("def").descr("csmax", "");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential").identifier("eeq");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .set("Eeq", "def.Eeq(doc)+dEeqdT*(T-298[K])");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .setPropertyInfo("Eeq", "W. Zheng, M. Shui, J. Shu, S. Gao, D. Xu, L. Chen, L. Feng and Y. Ren, \" GITT studies on oxide cathode LiNi1/3Co1/3Mn1/3O2 synthesized by citric acid assisted high-energy ball milling\", Bull. Mater. Sci., vol. 36, p. A495, 2013");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .set("dEeqdT", "-10[J/mol/K]/F_const");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .setPropertyInfo("dEeqdT", "V Viswanathan, D Choi, D Wang, W Xu, S Towne, R Williford, JG Zhang, J Liu and Z Yang \"Effect of entropy change on lithium intercalation in cathodes and anodes on Li-ion battery thermal management\", Journal of Power Sources 195 (2010) 3720-3729");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential").set("cEeqref", "def.csmax");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .setPropertyInfo("cEeqref", "W. Zheng, M. Shui, J. Shu, S. Gao, D. Xu, L. Chen, L. Feng and Y. Ren, \" GITT studies on oxide cathode LiNi1/3Co1/3Mn1/3O2 synthesized by citric acid assisted high-energy ball milling\", Bull. Mater. Sci., vol. 36, p. A495, 2013");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential").set("doc", "c/cEeqref");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential")
         .descr("doc", "Degree of conversion (state of lithiation)");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential").addInput("concentration");
    model.component("comp1").material("mat3").propertyGroup("ElectrodePotential").addInput("temperature");
    model.component("comp1").material("mat3").propertyGroup("OperationalSOC").identifier("opsoc");
    model.component("comp1").material("mat3").propertyGroup("OperationalSOC").set("socmax", "def.Eeq_inv(E_min)");
    model.component("comp1").material("mat3").propertyGroup("OperationalSOC").set("socmin", "def.Eeq_inv(E_max)");
    model.component("comp1").material("mat3").propertyGroup("OperationalSOC").set("E_max", "4.4[V]");
    model.component("comp1").material("mat3").propertyGroup("OperationalSOC").set("E_min", "3.3[V]");
    model.component("comp1").material("mat3").propertyGroup("ic").func("int1").set("funcname", "dVOLdSOL");
    model.component("comp1").material("mat3").propertyGroup("ic").func("int1")
         .set("table", new String[][]{{"1", "0"}, 
         {"0.9260263416001121", "-0.010256410256411108"}, 
         {"0.8670351688384477", "-0.1948717948717955"}, 
         {"0.8113086731119519", "-0.27692307692307727"}, 
         {"0.7506669468964551", "-0.37948717948718036"}, 
         {"0.6949460557657279", "-0.502564102564103"}, 
         {"0.628563822334314", "-0.5846153846153856"}, 
         {"0.55562421185372", "-0.6666666666666674"}, 
         {"0.501531455793751", "-0.7076923076923083"}, 
         {"0.4441600112091916", "-0.7487179487179496"}, 
         {"0.3851716407454113", "-0.953846153846154"}, 
         {"0.3278338237354632", "-1.241025641025642"}, 
         {"0.2737943113352951", "-1.671794871794872"}, 
         {"0.24269440941572107", "-2.0205128205128213"}});
    model.component("comp1").material("mat3").propertyGroup("ic").func("int1").set("extrap", "linear");
    model.component("comp1").material("mat3").propertyGroup("ic").func("int1").set("fununit", new String[]{"%"});
    model.component("comp1").material("mat3").propertyGroup("ic").func("int1").set("argunit", new String[]{"1"});
    model.component("comp1").material("mat3").propertyGroup("ic").identifier("is");
    model.component("comp1").material("mat3").propertyGroup("ic").set("dvol", "dVOLdSOL(c/def.csmax)");
    model.component("comp1").material("mat3").propertyGroup("ic")
         .setPropertyInfo("dvol", "R. Koerver and others, \u201cChemo-mechanical expansion of lithium electrode materials \u2014 on the route to mechanically optimized all-solid-state batteries,\u201d Energy Environ. Sci., vol. 11, pp. 2142\u20132158, 201");
    model.component("comp1").material("mat3").propertyGroup("ic").addInput("concentration");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumConcentration")
         .set("csEq", "def.csmax*def.Eeq_inv(V)");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumConcentration")
         .addInput("electricpotential");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumPotentialWithDOCInput")
         .set("Eeq", "def.Eeq(doc)+dEeqdT*(T-298[K])");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumPotentialWithDOCInput")
         .set("dEeqdT", "-10[J/mol/K]/F_const");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumPotentialWithDOCInput")
         .addInput("degreeofconversion");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumPotentialWithDOCInput")
         .addInput("temperature");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumDegreeOfConversion")
         .set("docEq", "def.Eeq_inv(V)");
    model.component("comp1").material("mat3").propertyGroup("EquilibriumDegreeOfConversion")
         .addInput("electricpotential");
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("source", "file");
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("importedname", "NMC_333.txt");
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("importeddim", "2D");
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1")
         .set("funcnametable", new String[][]{{"log_sigmas", "1"}});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("filecolumns", 3);
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1")
         .set("columnKeys", new String[]{"col1", "col2", "col3"});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1")
         .set("columnType", new String[]{"col1", "arg", "col2", "arg", "col3", "value"});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1")
         .set("funcnames", new String[]{"col1", "int1", "col2", "int1", "col3", "log_sigmas"});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("fununit", new String[]{""});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1")
         .set("argunit", new String[]{"1", "1/K"});
    model.component("comp1").material("mat3").propertyGroup("pg1").func("int1").set("sourcetype", "model");
    model.component("comp1").material("mat3").propertyGroup("pg1")
         .set("electricconductivity", new String[]{"10^log_sigmas(x,1000/T)[S/cm]", "0", "0", "0", "10^log_sigmas(x,1000/T)[S/cm]", "0", "0", "0", "10^log_sigmas(x,1000/T)[S/cm]"});
    model.component("comp1").material("mat3").propertyGroup("pg1")
         .setPropertyInfo("electricconductivity", "Ruhul Amin and Yet-Ming Chiang 2016 J. Electrochem. Soc. 163 A1512");
    model.component("comp1").material("mat3").propertyGroup("pg1").set("x", "min(max(1-c/def.csmax,0),1)");
    model.component("comp1").material("mat3").propertyGroup("pg1").descr("x", "Degree of delithiation");
    model.component("comp1").material("mat3").propertyGroup("pg1").addInput("temperature");
    model.component("comp1").material("mat3").propertyGroup("pg1").addInput("concentration");

    model.component("comp1").geom("geom1").create("i1", "Interval");
    model.component("comp1").geom("geom1").feature("i1").set("specify", "len");
    model.component("comp1").geom("geom1").feature("i1").setIndex("len", "L_neg", 0);
    model.component("comp1").geom("geom1").feature("i1").setIndex("len", "L_sep", 1);
    model.component("comp1").geom("geom1").feature("i1").setIndex("len", "L_pos", 2);
    model.component("comp1").geom("geom1").run("i1");
    model.component("comp1").geom("geom1").run();

    model.component("comp1").material("mat1").selection().set(2);

    model.component("comp1").selection().create("sel1", "Explicit");
    model.component("comp1").selection("sel1").geom(1);
    model.component("comp1").selection("sel1").label("Separator");
    model.component("comp1").selection("sel1").set(2);

    model.component("comp1").material("mat1").selection().named("sel1");
    model.component("comp1").material("mat2").selection().set(1);

    model.component("comp1").selection().create("sel2", "Explicit");
    model.component("comp1").selection("sel2").geom(1);
    model.component("comp1").selection("sel2").label("Negative Electrode");
    model.component("comp1").selection("sel2").set(1);

    model.component("comp1").material("mat2").selection().named("sel2");
    model.component("comp1").material("mat3").selection().set(3);

    model.component("comp1").selection().create("sel3", "Explicit");
    model.component("comp1").selection("sel3").geom(1);
    model.component("comp1").selection("sel3").label("Positive Electrode");
    model.component("comp1").selection("sel3").set(3);

    model.component("comp1").material("mat3").selection().named("sel3");

    model.component("comp1").physics("liion").prop("Ac").set("Ac", "A_cell");
    model.component("comp1").physics("liion").prop("CellSettings").set("CellSOCandInitialChargeInventory", true);
    model.component("comp1").physics("liion").feature("socicd1").set("SOC_init", "soc_init");
    model.component("comp1").physics("liion").feature("socicd1").feature("neges1").selection().named("sel2");
    model.component("comp1").physics("liion").feature("socicd1").feature("poses1").selection().named("sel3");
    model.component("comp1").physics("liion").feature("sep1").set("epsl", "epsl_sep");
    model.component("comp1").physics("liion").create("pce1", "PorousElectrode", 1);
    model.component("comp1").physics("liion").feature("pce1").label("Porous Electrode - Negative");
    model.component("comp1").physics("liion").feature("pce1").selection().named("sel2");
    model.component("comp1").physics("liion").feature("pce1").set("ElectrolyteMaterial", "mat1");
    model.component("comp1").physics("liion").feature("pce1")
         .set("sigma", new String[]{"sigmas_neg", "0", "0", "0", "sigmas_neg", "0", "0", "0", "sigmas_neg"});
    model.component("comp1").physics("liion").feature("pce1").set("epss", "epss_neg");
    model.component("comp1").physics("liion").feature("pce1").set("epsl", "epsl_neg");
    model.component("comp1").physics("liion").feature("pce1").set("ElectricCorrModel", "NoCorr");
    model.component("comp1").physics("liion").feature("pce1").feature("pin1").set("rp", "rp_neg");
    model.component("comp1").physics("liion").feature("pce1").feature("per1").set("i0_ref", "i0_ref_neg");
    model.component("comp1").physics("liion").feature().duplicate("pce2", "pce1");
    model.component("comp1").physics("liion").feature("pce2").label("Porous Electrode - Positive");
    model.component("comp1").physics("liion").feature("pce2").selection().named("sel3");
    model.component("comp1").physics("liion").feature("pce2")
         .set("sigma", new String[]{"sigmas_pos", "0", "0", "0", "sigmas_pos", "0", "0", "0", "sigmas_pos"});
    model.component("comp1").physics("liion").feature("pce2").set("epss", "epss_pos");
    model.component("comp1").physics("liion").feature("pce2").set("epsl", "epsl_pos");
    model.component("comp1").physics("liion").feature("pce2").feature("pin1").set("rp", "rp_pos");
    model.component("comp1").physics("liion").feature("pce2").feature("per1").set("i0_ref", "i0_ref_pos");
    model.component("comp1").physics("liion").create("egnd1", "ElectricGround", 0);
    model.component("comp1").physics("liion").feature("egnd1").selection().set(1);

    model.component("comp1").selection().create("sel4", "Explicit");
    model.component("comp1").selection("sel4").geom(0);
    model.component("comp1").selection("sel4").label("Negative CC");
    model.component("comp1").selection("sel4").set(1);

    model.component("comp1").physics("liion").feature("egnd1").selection().named("sel4");
    model.component("comp1").physics("liion").create("lc1", "LoadCycle", 0);
    model.component("comp1").physics("liion").feature("lc1").selection().set(4);
    model.component("comp1").physics("liion").feature("lc1").set("LoadType", "Galvanostatic");
    model.component("comp1").physics("liion").feature("lc1").set("VoltageProbe", true);
    model.component("comp1").physics("liion").feature("lc1").create("crate1", "CRate", -1);
    model.component("comp1").physics("liion").feature("lc1").feature("crate1").set("setVal", 1);

    model.common("cminpt").set("modified", new String[][]{{"temperature", "T"}});

    model.component("comp1").variable().create("var1");

//    To import content from file, use:
//    model.component("comp1").variable("var1").loadFile("FILENAME");
    model.component("comp1").variable("var1")
         .set("sol_neg", "liion.soc_average_pce1", "Degree of lithiation, negative");
    model.component("comp1").variable("var1")
         .set("sol_pos", "liion.soc_average_pce2", "Degree of lithiation, positive");
    model.component("comp1").variable("var1").set("soc_cell", "liion.SOC_cell", "Battery cell state of charge");
    model.component("comp1").variable("var1")
         .set("E_ocp_neg", "mat2.def.Eeq(sol_neg)", "Open-circuit potential in negative electrode");
    model.component("comp1").variable("var1")
         .set("E_ocp_pos", "mat3.def.Eeq(sol_pos)", "Open-circuit potential in positive electrode");
    model.component("comp1").variable("var1").set("E_ocv_cell", "E_ocp_pos-E_ocp_neg", "Open-circuit cell voltage");
    model.component("comp1").variable("var1").set("E_cell", "liion.lc1.E_app", "Cell voltage");
    model.component("comp1").variable("var1")
         .set("E_pol_tot", "E_cell-E_ocv_cell", "Total battery cell polarization");
    model.component("comp1").variable("var1")
         .set("I_1C", "liion.I_1C_cell/A_cell", "1 h charge/discharge current density");

    model.component("comp1").probe("liion_lc1_volt").set("descractive", true);
    model.component("comp1").probe("liion_lc1_volt").set("descr", "Cell voltage");

    model.result().table().create("tbl1", "Table");

    model.component("comp1").probe("liion_lc1_volt").set("table", "tbl1");

    model.result().table("tbl1").label("Cell Voltage Probe Data");

    model.study("std1").feature("time").set("tunit", "h");
    model.study("std1").feature("time").set("tlist", "range(0,0.1,0.9)");
    model.study("std1").createAutoSequences("all");

    model.component("comp1").probe("liion_lc1_volt").genResult("none");

    model.sol("sol1").runAll();

    model.result().create("pg2", "PlotGroup1D");
    model.result("pg2").set("data", "dset1");
    model.result("pg2").label("Boundary Electrode Potential with Respect to Ground (liion)");
    model.result("pg2").set("titletype", "none");
    model.result("pg2").set("legendpos", "middleright");
    model.result("pg2").create("glob1", "Global");
    model.result("pg2").feature("glob1").set("unit", new String[]{""});
    model.result("pg2").feature("glob1").set("expr", new String[]{"liion.lc1.E_app"});
    model.result("pg2").feature("glob1").set("descr", new String[]{"Applied voltage"});
    model.result("pg2").feature("glob1").set("xdatasolnumtype", "level1");
    model.result("pg2").feature("glob1").set("legend", true);
    model.result("pg2").feature("glob1").set("autosolution", false);
    model.result("pg2").feature("glob1").set("autodescr", true);
    model.result("pg2").set("legendpos", "middleright");
    model.result("pg2").create("glob2", "Global");
    model.result("pg2").feature("glob2").set("unit", new String[]{""});
    model.result("pg2").feature("glob2").set("expr", new String[]{"liion.lc1.I_app"});
    model.result("pg2").feature("glob2").set("descr", new String[]{"Applied current"});
    model.result("pg2").feature("glob2").set("xdatasolnumtype", "level1");
    model.result("pg2").feature("glob2").set("legend", true);
    model.result("pg2").feature("glob2").set("autosolution", false);
    model.result("pg2").feature("glob2").set("autodescr", true);
    model.result("pg2").set("twoyaxes", true);
    model.result("pg2").setIndex("plotonsecyaxis", true, 1, 1);
    model.result().create("pg3", "PlotGroup1D");
    model.result("pg3").set("data", "dset1");
    model.result("pg3").set("ylabel", "SOC (1)");
    model.result("pg3").set("titletype", "none");
    model.result("pg3").set("legendpos", "middleleft");
    model.result("pg3").label("Cell and Average Electrode Cell State of Charge (liion)");
    model.result("pg3").create("glob1", "Global");
    model.result("pg3").feature("glob1").set("unit", new String[]{""});
    model.result("pg3").feature("glob1").set("expr", new String[]{"liion.SOC_cell"});
    model.result("pg3").feature("glob1").set("descr", new String[]{"Cell state of charge"});
    model.result("pg3").feature("glob1").set("xdatasolnumtype", "level1");
    model.result("pg3").feature("glob1").set("legend", true);
    model.result("pg3").feature("glob1").set("autosolution", false);
    model.result("pg3").feature("glob1").set("autodescr", true);
    model.result("pg3").create("glob2", "Global");
    model.result("pg3").feature("glob2").set("unit", new String[]{"", ""});
    model.result("pg3").feature("glob2")
         .set("expr", new String[]{"liion.soc_average_pce1", "liion.soc_average_pce2"});
    model.result("pg3").feature("glob2")
         .set("descr", new String[]{"Average SOC, Porous Electrode - Negative", "Average SOC, Porous Electrode - Positive"});
    model.result("pg3").feature("glob2").set("xdatasolnumtype", "level1");
    model.result("pg3").feature("glob2").set("legend", true);
    model.result("pg3").feature("glob2").set("autosolution", false);
    model.result("pg3").feature("glob2").set("autodescr", true);
    model.result("pg3").feature("glob2").set("linestyle", "dashed");
    model.result().create("pg4", "PlotGroup1D");
    model.result("pg4").set("data", "dset1");
    model.result("pg4").label("Electrode Potential with Respect to Adjacent Reference (liion)");
    model.result("pg4").create("lngr1", "LineGraph");
    model.result("pg4").feature("lngr1").set("xdata", "expr");
    model.result("pg4").feature("lngr1").set("xdataexpr", "x");
    model.result("pg4").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg4").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg4").feature("lngr1").set("expr", new String[]{"liion.Evsref"});
    model.result("pg4").feature("lngr1").set("resolution", "norefine");
    model.result("pg4").feature("lngr1").create("col1", "Color");
    model.result("pg4").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg4").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg4").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg4").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg4").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg4").set("showlegendstitle", true);
    model.result("pg4").set("showlegendsunit", true);
    model.result("pg4").set("titletype", "manual");
    model.result("pg4").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg4").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg4").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");
    model.result("pg4").create("lngr2", "LineGraph");
    model.result("pg4").feature("lngr2").set("xdata", "expr");
    model.result("pg4").feature("lngr2").set("xdataexpr", "x");
    model.result("pg4").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg4").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg4").feature("lngr2").set("expr", new String[]{"liion.Evsref"});
    model.result("pg4").feature("lngr2").create("filt1", "LineGraphFilter");
    model.result("pg4").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg4").feature("lngr2").create("col1", "Color");
    model.result("pg4").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg4").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg4").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg4").feature("lngr2").set("linestyle", "dashed");
    model.result("pg4").feature("lngr2").set("resolution", "norefine");
    model.result("pg4").set("ylabelactive", true);
    model.result("pg4").set("ylabel", "Negative electrode potential (V)");
    model.result("pg4").set("twoyaxes", true);
    model.result("pg4").setIndex("plotonsecyaxis", true, 1, 1);
    model.result("pg4").set("yseclabelactive", true);
    model.result("pg4").set("yseclabel", "Positive electrode potential (V)");
    model.result().create("pg5", "PlotGroup1D");
    model.result("pg5").set("data", "dset1");
    model.result("pg5").label("Electrolyte Salt Concentration (liion)");
    model.result("pg5").set("titletype", "none");
    model.result("pg5").create("lngr1", "LineGraph");
    model.result("pg5").feature("lngr1").set("xdata", "expr");
    model.result("pg5").feature("lngr1").set("xdataexpr", "x");
    model.result("pg5").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg5").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg5").feature("lngr1").set("expr", new String[]{"cl"});
    model.result("pg5").feature("lngr1").create("col1", "Color");
    model.result("pg5").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg5").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg5").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg5").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg5").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg5").set("showlegendstitle", true);
    model.result("pg5").set("showlegendsunit", true);
    model.result().create("pg6", "PlotGroup1D");
    model.result("pg6").set("data", "dset1");
    model.result("pg6").label("Volumetric Current Density (liion)");
    model.result("pg6").set("titletype", "none");
    model.result("pg6").create("lngr1", "LineGraph");
    model.result("pg6").feature("lngr1").set("xdata", "expr");
    model.result("pg6").feature("lngr1").set("xdataexpr", "x");
    model.result("pg6").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg6").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg6").feature("lngr1").set("expr", new String[]{"liion.ivtot"});
    model.result("pg6").feature("lngr1").set("resolution", "norefine");
    model.result("pg6").feature("lngr1").create("col1", "Color");
    model.result("pg6").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg6").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg6").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg6").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg6").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg6").set("showlegendstitle", true);
    model.result("pg6").set("showlegendsunit", true);
    model.result("pg6").set("titletype", "manual");
    model.result("pg6").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg6").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg6").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");
    model.result("pg6").create("lngr2", "LineGraph");
    model.result("pg6").feature("lngr2").set("xdata", "expr");
    model.result("pg6").feature("lngr2").set("xdataexpr", "x");
    model.result("pg6").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg6").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg6").feature("lngr2").set("expr", new String[]{"liion.ivtot"});
    model.result("pg6").feature("lngr2").create("filt1", "LineGraphFilter");

    return model;
  }

  public static Model run3(Model model) {
    model.result("pg6").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg6").feature("lngr2").create("col1", "Color");
    model.result("pg6").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg6").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg6").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg6").feature("lngr2").set("linestyle", "dashed");
    model.result("pg6").feature("lngr2").set("resolution", "norefine");
    model.result("pg6").set("ylabelactive", true);
    model.result("pg6").set("ylabel", "Negative electrode volumetric current density (A/m<sup>3</sup>)");
    model.result("pg6").set("twoyaxes", true);
    model.result("pg6").setIndex("plotonsecyaxis", true, 1, 1);
    model.result("pg6").set("yseclabelactive", true);
    model.result("pg6").set("yseclabel", "Positive electrode volumetric current density (A/m<sup>3</sup>)");
    model.result().create("pg7", "PlotGroup1D");
    model.result("pg7").set("data", "dset1");
    model.result("pg7").label("Particle Surface State of Charge (liion)");
    model.result("pg7").create("lngr1", "LineGraph");
    model.result("pg7").feature("lngr1").set("xdata", "expr");
    model.result("pg7").feature("lngr1").set("xdataexpr", "x");
    model.result("pg7").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg7").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg7").feature("lngr1").set("expr", new String[]{"liion.socloc_surface"});
    model.result("pg7").feature("lngr1").set("resolution", "norefine");
    model.result("pg7").feature("lngr1").create("col1", "Color");
    model.result("pg7").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg7").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg7").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg7").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg7").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg7").set("showlegendstitle", true);
    model.result("pg7").set("showlegendsunit", true);
    model.result("pg7").set("titletype", "manual");
    model.result("pg7").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg7").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg7").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");
    model.result("pg7").create("lngr2", "LineGraph");
    model.result("pg7").feature("lngr2").set("xdata", "expr");
    model.result("pg7").feature("lngr2").set("xdataexpr", "x");
    model.result("pg7").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg7").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg7").feature("lngr2").set("expr", new String[]{"liion.socloc_surface"});
    model.result("pg7").feature("lngr2").create("filt1", "LineGraphFilter");
    model.result("pg7").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg7").feature("lngr2").create("col1", "Color");
    model.result("pg7").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg7").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg7").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg7").feature("lngr2").set("linestyle", "dashed");
    model.result("pg7").feature("lngr2").set("resolution", "norefine");
    model.result("pg7").set("ylabelactive", true);
    model.result("pg7").set("ylabel", "Particle surface state of charge (1)");
    model.result("pg2").run();

    model.sol().remove("sol1");
    model.sol().remove("sol2");

    model.result("pg1").set("window", "window1");
    model.result("pg1").run();
    model.result().remove("pg1");

    model.title("Lithium-Ion Battery Base Model in 1D");

    model
         .description("This is a template base model containing the physics, geometry and mesh of a lithium-ion battery, defined in 1D.\n\nThe model makes use of four lithiation parameters which are used to define the relative balancing of the negative and positive electrodes, as well as global cell state of charge (SOC) variable. In addition, a cell cross-sectional capacity parameter is used to define the electrode thicknesses.\n\nThe base model is used by various tutorials in the Battery Design Module Application library.");

    model.label("lib_base_model_1d.mph");

//    In this tutorial, we will run the battery model you just loaded versus a specified drive cycle. First for 60 s, then for 600 s.
//    In the Model Builder window, expand the Component 1 (comp1) > Lithium-Ion Battery (liion) node, then click Load Cycle 1.
//    In the Settings window for Load Cycle, locate the Continuation Conditions section.
//    Select the Use elapsed time only checkbox.

    model.component("comp1").physics("liion").feature("lc1").set("useTimeConditionsOnly", true);

//    In the Model Builder window, expand the Load Cycle 1 node, then click C Rate 1.
//    In the Settings window for C Rate, locate the C-Rate Multiple section.
//    From the Input type list, select Step sequence.

    model.component("comp1").physics("liion").feature("lc1").feature("crate1").set("InputType", "StepSequence");

//    Click Load from File.
//    Browse to the model's Application Library folder and double-click the file lib_drive_cycle_data.txt.

    model.component("comp1").physics("liion").feature("lc1").feature("crate1")
         .set("TimeColumnValue", new double[]{0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 24, 24.5, 25, 25.5, 26, 26.5, 27, 27.5, 28, 28.5, 29, 29.5, 30, 30.5, 31, 31.5, 32, 32.5, 33, 33.5, 34, 34.5, 35, 35.5, 36, 36.5, 37, 37.5, 38, 38.5, 39, 39.5, 40, 40.5, 41, 41.5, 42, 42.5, 43, 43.5, 44, 44.5, 45, 45.5, 46, 46.5, 47, 47.5, 48, 48.5, 49, 49.5, 50, 50.5, 51, 51.5, 52, 52.5, 53, 53.5, 54, 54.5, 55, 55.5, 56, 56.5, 57, 57.5, 58, 58.5, 59, 59.5, 60, 60.5, 61, 61.5, 62, 62.5, 63, 63.5, 64, 64.5, 65, 65.5, 66, 66.5, 67, 67.5, 68, 68.5, 69, 69.5, 70, 70.5, 71, 71.5, 72, 72.5, 73, 73.5, 74, 74.5, 75, 75.5, 76, 76.5, 77, 77.5, 78, 78.5, 79, 79.5, 80, 80.5, 81, 81.5, 82, 82.5, 83, 83.5, 84, 84.5, 85, 85.5, 86, 86.5, 87, 87.5, 88, 88.5, 89, 89.5, 90, 90.5, 91, 91.5, 92, 92.5, 93, 93.5, 94, 94.5, 95, 95.5, 96, 96.5, 97, 97.5, 98, 98.5, 99, 99.5, 100, 100.5, 101, 101.5, 102, 102.5, 103, 103.5, 104, 104.5, 105, 105.5, 106, 106.5, 107, 107.5, 108, 108.5, 109, 109.5, 110, 110.5, 111, 111.5, 112, 112.5, 113, 113.5, 114, 114.5, 115, 115.5, 116, 116.5, 117, 117.5, 118, 118.5, 119, 119.5, 120, 120.5, 121, 121.5, 122, 122.5, 123, 123.5, 124, 124.5, 125, 125.5, 126, 126.5, 127, 127.5, 128, 128.5, 129, 129.5, 130, 130.5, 131, 131.5, 132, 132.5, 133, 133.5, 134, 134.5, 135, 135.5, 136, 136.5, 137, 137.5, 138, 138.5, 139, 139.5, 140, 140.5, 141, 141.5, 142, 142.5, 143, 143.5, 144, 144.5, 145, 145.5, 146, 146.5, 147, 147.5, 148, 148.5, 149, 149.5, 150, 150.5, 151, 151.5, 152, 152.5, 153, 153.5, 154, 154.5, 155, 155.5, 156, 156.5, 157, 157.5, 158, 158.5, 159, 159.5, 160, 160.5, 161, 161.5, 162, 162.5, 163, 163.5, 164, 164.5, 165, 165.5, 166, 166.5, 167, 167.5, 168, 168.5, 169, 169.5, 170, 170.5, 171, 171.5, 172, 172.5, 173, 173.5, 174, 174.5, 175, 175.5, 176, 176.5, 177, 177.5, 178, 178.5, 179, 179.5, 180, 180.5, 181, 181.5, 182, 182.5, 183, 183.5, 184, 184.5, 185, 185.5, 186, 186.5, 187, 187.5, 188, 188.5, 189, 189.5, 190, 190.5, 191, 191.5, 192, 192.5, 193, 193.5, 194, 194.5, 195, 195.5, 196, 196.5, 197, 197.5, 198, 198.5, 199, 199.5, 200, 200.5, 201, 201.5, 202, 202.5, 203, 203.5, 204, 204.5, 205, 205.5, 206, 206.5, 207, 207.5, 208, 208.5, 209, 209.5, 210, 210.5, 211, 211.5, 212, 212.5, 213, 213.5, 214, 214.5, 215, 215.5, 216, 216.5, 217, 217.5, 218, 218.5, 219, 219.5, 220, 220.5, 221, 221.5, 222, 222.5, 223, 223.5, 224, 224.5, 225, 225.5, 226, 226.5, 227, 227.5, 228, 228.5, 229, 229.5, 230, 230.5, 231, 231.5, 232, 232.5, 233, 233.5, 234, 234.5, 235, 235.5, 236, 236.5, 237, 237.5, 238, 238.5, 239, 239.5, 240, 240.5, 241, 241.5, 242, 242.5, 243, 243.5, 244, 244.5, 245, 245.5, 246, 246.5, 247, 247.5, 248, 248.5, 249, 249.5, 250, 250.5, 251, 251.5, 252, 252.5, 253, 253.5, 254, 254.5, 255, 255.5, 256, 256.5, 257, 257.5, 258, 258.5, 259, 259.5, 260, 260.5, 261, 261.5, 262, 262.5, 263, 263.5, 264, 264.5, 265, 265.5, 266, 266.5, 267, 267.5, 268, 268.5, 269, 269.5, 270, 270.5, 271, 271.5, 272, 272.5, 273, 273.5, 274, 274.5, 275, 275.5, 276, 276.5, 277, 277.5, 278, 278.5, 279, 279.5, 280, 280.5, 281, 281.5, 282, 282.5, 283, 283.5, 284, 284.5, 285, 285.5, 286, 286.5, 287, 287.5, 288, 288.5, 289, 289.5, 290, 290.5, 291, 291.5, 292, 292.5, 293, 293.5, 294, 294.5, 295, 295.5, 296, 296.5, 297, 297.5, 298, 298.5, 299, 299.5, 300, 300.5, 301, 301.5, 302, 302.5, 303, 303.5, 304, 304.5, 305, 305.5, 306, 306.5, 307, 307.5, 308, 308.5, 309, 309.5, 310, 310.5, 311, 311.5, 312, 312.5, 313, 313.5, 314, 314.5, 315, 315.5, 316, 316.5, 317, 317.5, 318, 318.5, 319, 319.5, 320, 320.5, 321, 321.5, 322, 322.5, 323, 323.5, 324, 324.5, 325, 325.5, 326, 326.5, 327, 327.5, 328, 328.5, 329, 329.5, 330, 330.5, 331, 331.5, 332, 332.5, 333, 333.5, 334, 334.5, 335, 335.5, 336, 336.5, 337, 337.5, 338, 338.5, 339, 339.5, 340, 340.5, 341, 341.5, 342, 342.5, 343, 343.5, 344, 344.5, 345, 345.5, 346, 346.5, 347, 347.5, 348, 348.5, 349, 349.5, 350, 350.5, 351, 351.5, 352, 352.5, 353, 353.5, 354, 354.5, 355, 355.5, 356, 356.5, 357, 357.5, 358, 358.5, 359, 359.5, 360, 360.5, 361, 361.5, 362, 362.5, 363, 363.5, 364, 364.5, 365, 365.5, 366, 366.5, 367, 367.5, 368, 368.5, 369, 369.5, 370, 370.5, 371, 371.5, 372, 372.5, 373, 373.5, 374, 374.5, 375, 375.5, 376, 376.5, 377, 377.5, 378, 378.5, 379, 379.5, 380, 380.5, 381, 381.5, 382, 382.5, 383, 383.5, 384, 384.5, 385, 385.5, 386, 386.5, 387, 387.5, 388, 388.5, 389, 389.5, 390, 390.5, 391, 391.5, 392, 392.5, 393, 393.5, 394, 394.5, 395, 395.5, 396, 396.5, 397, 397.5, 398, 398.5, 399, 399.5, 400, 400.5, 401, 401.5, 402, 402.5, 403, 403.5, 404, 404.5, 405, 405.5, 406, 406.5, 407, 407.5, 408, 408.5, 409, 409.5, 410, 410.5, 411, 411.5, 412, 412.5, 413, 413.5, 414, 414.5, 415, 415.5, 416, 416.5, 417, 417.5, 418, 418.5, 419, 419.5, 420, 420.5, 421, 421.5, 422, 422.5, 423, 423.5, 424, 424.5, 425, 425.5, 426, 426.5, 427, 427.5, 428, 428.5, 429, 429.5, 430, 430.5, 431, 431.5, 432, 432.5, 433, 433.5, 434, 434.5, 435, 435.5, 436, 436.5, 437, 437.5, 438, 438.5, 439, 439.5, 440, 440.5, 441, 441.5, 442, 442.5, 443, 443.5, 444, 444.5, 445, 445.5, 446, 446.5, 447, 447.5, 448, 448.5, 449, 449.5, 450, 450.5, 451, 451.5, 452, 452.5, 453, 453.5, 454, 454.5, 455, 455.5, 456, 456.5, 457, 457.5, 458, 458.5, 459, 459.5, 460, 460.5, 461, 461.5, 462, 462.5, 463, 463.5, 464, 464.5, 465, 465.5, 466, 466.5, 467, 467.5, 468, 468.5, 469, 469.5, 470, 470.5, 471, 471.5, 472, 472.5, 473, 473.5, 474, 474.5, 475, 475.5, 476, 476.5, 477, 477.5, 478, 478.5, 479, 479.5, 480, 480.5, 481, 481.5, 482, 482.5, 483, 483.5, 484, 484.5, 485, 485.5, 486, 486.5, 487, 487.5, 488, 488.5, 489, 489.5, 490, 490.5, 491, 491.5, 492, 492.5, 493, 493.5, 494, 494.5, 495, 495.5, 496, 496.5, 497, 497.5, 498, 498.5, 499, 499.5, 500, 500.5, 501, 501.5, 502, 502.5, 503, 503.5, 504, 504.5, 505, 505.5, 506, 506.5, 507, 507.5, 508, 508.5, 509, 509.5, 510, 510.5, 511, 511.5, 512, 512.5, 513, 513.5, 514, 514.5, 515, 515.5, 516, 516.5, 517, 517.5, 518, 518.5, 519, 519.5, 520, 520.5, 521, 521.5, 522, 522.5, 523, 523.5, 524, 524.5, 525, 525.5, 526, 526.5, 527, 527.5, 528, 528.5, 529, 529.5, 530, 530.5, 531, 531.5, 532, 532.5, 533, 533.5, 534, 534.5, 535, 535.5, 536, 536.5, 537, 537.5, 538, 538.5, 539, 539.5, 540, 540.5, 541, 541.5, 542, 542.5, 543, 543.5, 544, 544.5, 545, 545.5, 546, 546.5, 547, 547.5, 548, 548.5, 549, 549.5, 550, 550.5, 551, 551.5, 552, 552.5, 553, 553.5, 554, 554.5, 555, 555.5, 556, 556.5, 557, 557.5, 558, 558.5, 559, 559.5, 560, 560.5, 561, 561.5, 562, 562.5, 563, 563.5, 564, 564.5, 565, 565.5, 566, 566.5, 567, 567.5, 568, 568.5, 569, 569.5, 570, 570.5, 571, 571.5, 572, 572.5, 573, 573.5, 574, 574.5, 575, 575.5, 576, 576.5, 577, 577.5, 578, 578.5, 579, 579.5, 580, 580.5, 581, 581.5, 582, 582.5, 583, 583.5, 584, 584.5, 585, 585.5, 586, 586.5, 587, 587.5, 588, 588.5, 589, 589.5, 590, 590.5, 591, 591.5, 592, 592.5, 593, 593.5, 594, 594.5, 595, 595.5, 596, 596.5, 597, 597.5, 598, 598.5, 599, 599.5, 600});
    model.component("comp1").physics("liion").feature("lc1").feature("crate1")
         .set("SetColumnValue", new double[]{15, 20, 20, 20, 20, 20, 20, 20, 18, 18, 12, 12, 10, 10, 12, 12, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 5, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 1.5, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, -5, -5, -5, -5, -5, -5, -5, -8, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, -0.5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.5, 2.5, 5, 5, 5, 5, 5, 5, 5, -1, 0.5, 0.5, 0.5, 0.5, 5, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 1.5, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, -15, -15, -15, -13, -13, -13, -12, -12, -5, -5, -5, -5, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 20, 20, 20, 20, 20, 20, 20, 18, 18, 12, 12, 10, 10, 12, 12, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 5, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 1.5, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, -5, -5, -5, -5, -5, -5, -5, -8, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, -0.5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.5, 2.5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 10, 10, 10, 10, 10, 12, 12, 0, 0, 0, 0, -12, -12, -15, -15, -15, -15, -15, -15, -13, -13, -13, -12, -12, -5, -5, -5, -5, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 10, 10, 10, 10, 10, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 20, 20, 20, 20, 20, 20, 20, 18, 18, 12, 12, 10, 10, 12, 12, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 10, 10, 10, 10, 10, 12, 12, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, -5, -5, -5, -5, -5, -5, -5, -8, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, -0.5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.5, 2.5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 10, 10, 10, 10, 10, 12, 12, 0, 0, 0, 0, -12, -12, -15, -15, -15, -15, -15, -15, -13, -13, -13, -12, -12, -5, -5, -5, -5, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 12, 12, 0, 0, 0, 0, -12, -12, -15, -15, -15, -15, -15, -15, -13, -13, -13, 0, 0, 0, 0, 0, 0, 0, 15, 20, 20, 20, 20, 20, 20, 20, 18, 18, 12, 12, 10, 10, 12, 12, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 5, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 1.5, 1.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, -5, -5, -5, -5, -5, -5, -5, -8, -8, -8, -8, -8, -10, -10, -10, -10, -10, -10, -5, -5, -5, -5, -5, -5, -5, -2, -2, -0.5, -0.5, -0.5, -0.5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.5, 2.5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, 10, 10, 10, 10, 10, 12, 12, 0, 0, 0, 0, -12, -12, -15, -15, -15, -15, -15, -15, -13, -13, -13, -12, -12, -5, -5, -5, -5, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});

//    In the <l>Particle Intercalation</l> nodes of the <l>Porous Electrode</l> features, it is useful to enable fast assembly in the particle dimension option. This option enables an alternative method for assembling of the diffusion equation in the particle dimension, that typically decreases computation time for 1D models (for this model by about 20%). Note that the same diffusion equations are solved for regardless of assembly method.
//    In the Model Builder window, expand the Porous Electrode - Negative node, then click Particle Intercalation 1.
//    In the Settings window for Particle Intercalation, click to expand the Particle Discretization section.
//    Select the Fast assembly in particle dimension checkbox.

    model.component("comp1").physics("liion").feature("pce1").feature("pin1").set("FastAssembly", true);

//    In the Model Builder window, expand the Porous Electrode - Positive node, then click Particle Intercalation 1.
//    In the Settings window for Particle Intercalation, locate the Particle Discretization section.
//    Select the Fast assembly in particle dimension checkbox.

    model.component("comp1").physics("liion").feature("pce2").feature("pin1").set("FastAssembly", true);

//    Modify the parameter for the initial state of charge of the battery. This will impact the initial solid concentration levels (degrees of lithiation) defined in the <l>Particle Intercalation</l> child nodes to the <l>Porous Electrode</l> nodes.
//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, locate the Parameters section.
//    In the table, enter the following settings:

    model.param().set("soc_init", "0.25");

//    The model is now ready for solving. First set the solver to run a simulation 60 s of cycling time only.
//    In the Model Builder window, expand the Study 1 node, then click Step 2: Time Dependent.
//    In the Settings window for Time Dependent, locate the Study Settings section.
//    From the Time unit list, select s.

    model.study("std1").feature("time").set("tunit", "s");

//    In the Output times text field, type range(0,1,60).

    model.study("std1").feature("time").set("tlist", "range(0,1,60)");

//    The problem is now ready for solving.
//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.component("comp1").probe("liion_lc1_volt").genResult("none");

    model.sol("sol1").runAll();

    model.result().create("pg2", "PlotGroup1D");
    model.result("pg2").set("data", "dset1");
    model.result("pg2").label("Boundary Electrode Potential with Respect to Ground (liion)");
    model.result("pg2").set("titletype", "none");
    model.result("pg2").set("legendpos", "middleright");
    model.result("pg2").create("glob1", "Global");
    model.result("pg2").feature("glob1").set("unit", new String[]{""});
    model.result("pg2").feature("glob1").set("expr", new String[]{"liion.lc1.E_app"});
    model.result("pg2").feature("glob1").set("descr", new String[]{"Applied voltage"});
    model.result("pg2").feature("glob1").set("xdatasolnumtype", "level1");
    model.result("pg2").feature("glob1").set("legend", true);
    model.result("pg2").feature("glob1").set("autosolution", false);
    model.result("pg2").feature("glob1").set("autodescr", true);
    model.result("pg2").set("legendpos", "middleright");
    model.result("pg2").create("glob2", "Global");
    model.result("pg2").feature("glob2").set("unit", new String[]{""});
    model.result("pg2").feature("glob2").set("expr", new String[]{"liion.lc1.I_app"});
    model.result("pg2").feature("glob2").set("descr", new String[]{"Applied current"});
    model.result("pg2").feature("glob2").set("xdatasolnumtype", "level1");
    model.result("pg2").feature("glob2").set("legend", true);
    model.result("pg2").feature("glob2").set("autosolution", false);
    model.result("pg2").feature("glob2").set("autodescr", true);
    model.result("pg2").set("twoyaxes", true);
    model.result("pg2").setIndex("plotonsecyaxis", true, 1, 1);
    model.result().create("pg3", "PlotGroup1D");
    model.result("pg3").set("data", "dset1");
    model.result("pg3").set("ylabel", "SOC (1)");
    model.result("pg3").set("titletype", "none");
    model.result("pg3").set("legendpos", "middleleft");
    model.result("pg3").label("Cell and Average Electrode Cell State of Charge (liion)");
    model.result("pg3").create("glob1", "Global");
    model.result("pg3").feature("glob1").set("unit", new String[]{""});
    model.result("pg3").feature("glob1").set("expr", new String[]{"liion.SOC_cell"});
    model.result("pg3").feature("glob1").set("descr", new String[]{"Cell state of charge"});
    model.result("pg3").feature("glob1").set("xdatasolnumtype", "level1");
    model.result("pg3").feature("glob1").set("legend", true);
    model.result("pg3").feature("glob1").set("autosolution", false);
    model.result("pg3").feature("glob1").set("autodescr", true);
    model.result("pg3").create("glob2", "Global");
    model.result("pg3").feature("glob2").set("unit", new String[]{"", ""});
    model.result("pg3").feature("glob2")
         .set("expr", new String[]{"liion.soc_average_pce1", "liion.soc_average_pce2"});
    model.result("pg3").feature("glob2")
         .set("descr", new String[]{"Average SOC, Porous Electrode - Negative", "Average SOC, Porous Electrode - Positive"});
    model.result("pg3").feature("glob2").set("xdatasolnumtype", "level1");
    model.result("pg3").feature("glob2").set("legend", true);
    model.result("pg3").feature("glob2").set("autosolution", false);
    model.result("pg3").feature("glob2").set("autodescr", true);
    model.result("pg3").feature("glob2").set("linestyle", "dashed");
    model.result().create("pg4", "PlotGroup1D");
    model.result("pg4").set("data", "dset1");
    model.result("pg4").label("Electrode Potential with Respect to Adjacent Reference (liion)");
    model.result("pg4").create("lngr1", "LineGraph");
    model.result("pg4").feature("lngr1").set("xdata", "expr");
    model.result("pg4").feature("lngr1").set("xdataexpr", "x");
    model.result("pg4").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg4").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg4").feature("lngr1").set("expr", new String[]{"liion.Evsref"});
    model.result("pg4").feature("lngr1").set("resolution", "norefine");
    model.result("pg4").feature("lngr1").create("col1", "Color");
    model.result("pg4").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg4").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg4").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg4").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg4").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg4").set("showlegendstitle", true);
    model.result("pg4").set("showlegendsunit", true);
    model.result("pg4").set("titletype", "manual");
    model.result("pg4").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg4").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg4").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");
    model.result("pg4").create("lngr2", "LineGraph");
    model.result("pg4").feature("lngr2").set("xdata", "expr");
    model.result("pg4").feature("lngr2").set("xdataexpr", "x");
    model.result("pg4").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg4").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg4").feature("lngr2").set("expr", new String[]{"liion.Evsref"});
    model.result("pg4").feature("lngr2").create("filt1", "LineGraphFilter");
    model.result("pg4").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg4").feature("lngr2").create("col1", "Color");
    model.result("pg4").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg4").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg4").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg4").feature("lngr2").set("linestyle", "dashed");
    model.result("pg4").feature("lngr2").set("resolution", "norefine");
    model.result("pg4").set("ylabelactive", true);
    model.result("pg4").set("ylabel", "Negative electrode potential (V)");
    model.result("pg4").set("twoyaxes", true);
    model.result("pg4").setIndex("plotonsecyaxis", true, 1, 1);
    model.result("pg4").set("yseclabelactive", true);
    model.result("pg4").set("yseclabel", "Positive electrode potential (V)");
    model.result().create("pg5", "PlotGroup1D");
    model.result("pg5").set("data", "dset1");
    model.result("pg5").label("Electrolyte Salt Concentration (liion)");
    model.result("pg5").set("titletype", "none");
    model.result("pg5").create("lngr1", "LineGraph");
    model.result("pg5").feature("lngr1").set("xdata", "expr");
    model.result("pg5").feature("lngr1").set("xdataexpr", "x");
    model.result("pg5").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg5").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg5").feature("lngr1").set("expr", new String[]{"cl"});
    model.result("pg5").feature("lngr1").create("col1", "Color");
    model.result("pg5").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg5").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg5").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg5").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg5").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg5").set("showlegendstitle", true);
    model.result("pg5").set("showlegendsunit", true);
    model.result().create("pg6", "PlotGroup1D");
    model.result("pg6").set("data", "dset1");
    model.result("pg6").label("Volumetric Current Density (liion)");
    model.result("pg6").set("titletype", "none");
    model.result("pg6").create("lngr1", "LineGraph");
    model.result("pg6").feature("lngr1").set("xdata", "expr");
    model.result("pg6").feature("lngr1").set("xdataexpr", "x");
    model.result("pg6").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg6").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg6").feature("lngr1").set("expr", new String[]{"liion.ivtot"});
    model.result("pg6").feature("lngr1").set("resolution", "norefine");
    model.result("pg6").feature("lngr1").create("col1", "Color");
    model.result("pg6").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg6").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg6").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg6").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg6").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg6").set("showlegendstitle", true);
    model.result("pg6").set("showlegendsunit", true);
    model.result("pg6").set("titletype", "manual");
    model.result("pg6").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg6").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg6").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");
    model.result("pg6").create("lngr2", "LineGraph");
    model.result("pg6").feature("lngr2").set("xdata", "expr");
    model.result("pg6").feature("lngr2").set("xdataexpr", "x");
    model.result("pg6").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg6").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg6").feature("lngr2").set("expr", new String[]{"liion.ivtot"});
    model.result("pg6").feature("lngr2").create("filt1", "LineGraphFilter");
    model.result("pg6").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg6").feature("lngr2").create("col1", "Color");
    model.result("pg6").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg6").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg6").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg6").feature("lngr2").set("linestyle", "dashed");
    model.result("pg6").feature("lngr2").set("resolution", "norefine");
    model.result("pg6").set("ylabelactive", true);
    model.result("pg6").set("ylabel", "Negative electrode volumetric current density (A/m<sup>3</sup>)");
    model.result("pg6").set("twoyaxes", true);
    model.result("pg6").setIndex("plotonsecyaxis", true, 1, 1);
    model.result("pg6").set("yseclabelactive", true);
    model.result("pg6").set("yseclabel", "Positive electrode volumetric current density (A/m<sup>3</sup>)");
    model.result().create("pg7", "PlotGroup1D");
    model.result("pg7").set("data", "dset1");
    model.result("pg7").label("Particle Surface State of Charge (liion)");
    model.result("pg7").create("lngr1", "LineGraph");
    model.result("pg7").feature("lngr1").set("xdata", "expr");
    model.result("pg7").feature("lngr1").set("xdataexpr", "x");
    model.result("pg7").feature("lngr1").selection().geom("geom1", 1);
    model.result("pg7").feature("lngr1").selection().set(1, 2, 3);
    model.result("pg7").feature("lngr1").set("expr", new String[]{"liion.socloc_surface"});
    model.result("pg7").feature("lngr1").set("resolution", "norefine");
    model.result("pg7").feature("lngr1").create("col1", "Color");
    model.result("pg7").feature("lngr1").feature("col1").set("expr", "t");
    model.result("pg7").feature("lngr1").feature("col1").set("colorlegend", true);
    model.result("pg7").feature("lngr1").feature("col1").set("colortable", "Viridis");
    model.result("pg7").feature("lngr1").feature("col1").set("legendtitle", "Time");
    model.result("pg7").feature("lngr1").feature("col1").set("unit", "min");
    model.result("pg7").set("showlegendstitle", true);
    model.result("pg7").set("showlegendsunit", true);
    model.result("pg7").set("titletype", "manual");
    model.result("pg7").set("title", "Solid lines: Negative electrode, Dashed lines: Positive electrode");
    model.result("pg7").feature("lngr1").create("filt1", "LineGraphFilter");
    model.result("pg7").feature("lngr1").feature("filt1").set("expr", "isdefined(root.comp1.liion.isNegative)");

    return model;
  }

  public static Model run4(Model model) {
    model.result("pg7").create("lngr2", "LineGraph");
    model.result("pg7").feature("lngr2").set("xdata", "expr");
    model.result("pg7").feature("lngr2").set("xdataexpr", "x");
    model.result("pg7").feature("lngr2").selection().geom("geom1", 1);
    model.result("pg7").feature("lngr2").selection().set(1, 2, 3);
    model.result("pg7").feature("lngr2").set("expr", new String[]{"liion.socloc_surface"});
    model.result("pg7").feature("lngr2").create("filt1", "LineGraphFilter");
    model.result("pg7").feature("lngr2").feature("filt1").set("expr", "isdefined(root.comp1.liion.isPositive)");
    model.result("pg7").feature("lngr2").create("col1", "Color");
    model.result("pg7").feature("lngr2").feature("col1").set("expr", "t");
    model.result("pg7").feature("lngr2").feature("col1").set("colorlegend", false);
    model.result("pg7").feature("lngr2").feature("col1").set("colortable", "Viridis");
    model.result("pg7").feature("lngr2").set("linestyle", "dashed");
    model.result("pg7").feature("lngr2").set("resolution", "norefine");
    model.result("pg7").set("ylabelactive", true);
    model.result("pg7").set("ylabel", "Particle surface state of charge (1)");
    model.result("pg2").run();
    model.result("pg1").set("window", "window1");
    model.result("pg1").run();

//    A probe plot of the battery voltage versus time is plotted automatically during the simulation:
//    In the Model Builder window, under Results, click Probe Plot Group 1.
//    In the Probe Plot Group 1 toolbar, click Plot.

    model.result("pg1").set("window", "window1");
    model.result("pg1").run();

//    Create a plot of the cell voltage and corresponding current load as follows:
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg8", "PlotGroup1D");
    model.result("pg8").run();

//    In the Settings window for 1D Plot Group, type Cell Voltage and Load in the Label text field.

    model.result("pg8").label("Cell Voltage and Load");

//    Right-click Cell Voltage and Load and choose Global.

    model.result("pg8").create("glob1", "Global");
    model.result("pg8").feature("glob1").set("markerpos", "datapoints");
    model.result("pg8").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > E_cell - Cell voltage - V.

    model.result("pg8").feature("glob1").set("expr", new String[]{"E_cell"});
    model.result("pg8").feature("glob1").set("descr", new String[]{"Cell voltage"});
    model.result("pg8").feature("glob1").set("unit", new String[]{"V"});

//    Locate the y-Axis Data section.
//    In the table, enter the following settings:
//    Click Add Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > E_ocv_cell - Open-circuit cell voltage - V.

    model.result("pg8").feature("glob1").set("expr", new String[]{"E_cell", "E_ocv_cell"});
    model.result("pg8").feature("glob1").set("descr", new String[]{"Cell voltage", "Open-circuit cell voltage"});

//    Click to expand the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select Cycle.

    model.result("pg8").feature("glob1").set("linestyle", "cycle");

//    Click to expand the Legends section.
//    From the Legends list, select Manual.

    model.result("pg8").feature("glob1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg8").feature("glob1").setIndex("legends", "E<sub>cell</sub>", 0);
    model.result("pg8").feature("glob1").setIndex("legends", "E<sub>OCV</sub>", 1);
    model.result("pg8").run();

//    In the Model Builder window, right-click Cell Voltage and Load and choose Global.

    model.result("pg8").create("glob2", "Global");
    model.result("pg8").feature("glob2").set("markerpos", "datapoints");
    model.result("pg8").feature("glob2").set("linewidth", "preference");

//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Lithium-Ion Battery > Load Cycle 1 > liion.lc1.C_app - C rate - 1.

    model.result("pg8").feature("glob2").set("expr", new String[]{"liion.lc1.C_app"});
    model.result("pg8").feature("glob2").set("descr", new String[]{"C rate"});
    model.result("pg8").feature("glob2").set("unit", new String[]{"1"});

//    Locate the Coloring and Style section.
//    From the Color list, select Red.

    model.result("pg8").feature("glob2").set("linecolor", "red");
    model.result("pg8").run();

//    In the Model Builder window, click Cell Voltage and Load.
//    In the Settings window for 1D Plot Group, click to expand the Title section.
//    From the Title type list, select None.

    model.result("pg8").set("titletype", "none");

//    Locate the Plot Settings section.
//    Select the Two y-axes checkbox.

    model.result("pg8").set("twoyaxes", true);

//    Select the y-axis label checkbox.

    model.result("pg8").set("ylabelactive", true);

//    In the associated text field, type Voltage (V).

    model.result("pg8").set("ylabel", "Voltage (V)");

//    Select the Secondary y-axis label checkbox.

    model.result("pg8").set("yseclabelactive", true);

//    In the associated text field, type Current (C-rate).

    model.result("pg8").set("yseclabel", "Current (C-rate)");

//    In the table, enter the following settings:

    model.result("pg8").setIndex("plotonsecyaxis", true, 1, 1);

//    In the Cell Voltage and Load toolbar, click Plot.

    model.result("pg8").run();

//    Duplicate this plot and modify it slightly to create a plot of the total polarization.
//    Right-click Cell Voltage and Load and choose Duplicate.

    model.result().duplicate("pg9", "pg8");
    model.result("pg9").run();

//    In the Model Builder window, click Cell Voltage and Load 1.
//    In the Settings window for 1D Plot Group, type Total Polarization and Load in the Label text field.

    model.result("pg9").label("Total Polarization and Load");

//    Locate the Plot Settings section.
//    In the y-axis label text field, type Polarization Voltage (V).

    model.result("pg9").set("ylabel", "Polarization Voltage (V)");
    model.result("pg9").run();

//    In the Model Builder window, click Global 1.
//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > E_pol_tot - Total battery cell polarization - V.

    model.result("pg9").feature("glob1").set("expr", new String[]{"E_pol_tot"});
    model.result("pg9").feature("glob1").set("descr", new String[]{"Total battery cell polarization"});
    model.result("pg9").feature("glob1").set("unit", new String[]{"V"});

//    Locate the Legends section.
//    In the table, enter the following settings:

    model.result("pg9").feature("glob1").setIndex("legends", "E <sub>pol</sub>", 0);

//    In the Total Polarization and Load toolbar, click Plot.

    model.result("pg9").run();

//    Create also a plot of the state of charge and the corresponding lithiation levels of the electrodes.
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg10", "PlotGroup1D");
    model.result("pg10").run();

//    In the Settings window for 1D Plot Group, type State of charge and average lithiation levels in the Label text field.

    model.result("pg10").label("State of charge and average lithiation levels");

//    Locate the Title section.
//    From the Title type list, select Label.

    model.result("pg10").set("titletype", "label");

//    Locate the Plot Settings section.
//    Select the y-axis label checkbox.

    model.result("pg10").set("ylabelactive", true);

//    In the associated text field, type SOC or SOL (1).

    model.result("pg10").set("ylabel", "SOC or SOL (1)");

//    Right-click State of charge and average lithiation levels and choose Global.

    model.result("pg10").create("glob1", "Global");
    model.result("pg10").feature("glob1").set("markerpos", "datapoints");
    model.result("pg10").feature("glob1").set("linewidth", "preference");

//    In the Settings window for Global, click Replace Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > soc_cell - Battery cell state of charge - 1.

    model.result("pg10").feature("glob1").set("expr", new String[]{"soc_cell"});
    model.result("pg10").feature("glob1").set("descr", new String[]{"Battery cell state of charge"});
    model.result("pg10").feature("glob1").set("unit", new String[]{"1"});

//    Click Add Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > sol_pos - Degree of lithiation, positive - 1.

    model.result("pg10").feature("glob1").set("expr", new String[]{"soc_cell", "sol_pos"});
    model.result("pg10").feature("glob1")
         .set("descr", new String[]{"Battery cell state of charge", "Degree of lithiation, positive"});

//    Click Add Expression in the upper-right corner of the y-Axis Data section.
//    From the menu, choose Component 1 (comp1) > Definitions > Variables > sol_neg - Degree of lithiation, negative - 1.

    model.result("pg10").feature("glob1").set("expr", new String[]{"soc_cell", "sol_pos", "sol_neg"});
    model.result("pg10").feature("glob1")
         .set("descr", new String[]{"Battery cell state of charge", "Degree of lithiation, positive", "Degree of lithiation, negative"});

//    Locate the Legends section.
//    From the Legends list, select Manual.

    model.result("pg10").feature("glob1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg10").feature("glob1").setIndex("legends", "SOC", 0);
    model.result("pg10").feature("glob1").setIndex("legends", "SOL<sub>pos</sub>", 1);
    model.result("pg10").feature("glob1").setIndex("legends", "SOL<sub>neg</sub>", 2);

//    In the State of charge and average lithiation levels toolbar, click Plot.

    model.result("pg10").run();

//    Now plot the electrode potentials in the positive electrode as follows:
//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg11", "PlotGroup1D");
    model.result("pg11").run();

//    In the Settings window for 1D Plot Group, type Positive Electrode Potentials in the Label text field.

    model.result("pg11").label("Positive Electrode Potentials");

//    Locate the Title section.
//    From the Title type list, select Label.

    model.result("pg11").set("titletype", "label");

//    Locate the Plot Settings section.
//    Select the Two y-axes checkbox.

    model.result("pg11").set("twoyaxes", true);

//    Select the y-axis label checkbox.

    model.result("pg11").set("ylabelactive", true);

//    In the associated text field, type Electrode Potential vs. Li/Li<sup>+</sup>.

    model.result("pg11").set("ylabel", "Electrode Potential vs. Li/Li<sup>+</sup>");

//    Select the Secondary y-axis label checkbox.

    model.result("pg11").set("yseclabelactive", true);

//    In the associated text field, type Current (C-rate).

    model.result("pg11").set("yseclabel", "Current (C-rate)");

//    Locate the Legend section.
//    From the Position list, select Upper right.
//    Right-click Positive Electrode Potentials and choose Point Graph.

    model.result("pg11").create("ptgr1", "PointGraph");
    model.result("pg11").feature("ptgr1").set("markerpos", "datapoints");
    model.result("pg11").feature("ptgr1").set("linewidth", "preference");

//    Select Boundaries 3, 4.

    model.result("pg11").feature("ptgr1").selection().set(3, 4);

//    In the Settings window for Point Graph, locate the y-Axis Data section.
//    In the Expression text field, type phis-phil.

    model.result("pg11").feature("ptgr1").set("expr", "phis-phil");

//    Click to expand the Legends section.
//    Select the Show legends checkbox.

    model.result("pg11").feature("ptgr1").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg11").feature("ptgr1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg11").feature("ptgr1").setIndex("legends", "E<sub>pos,sep</sub>", 0);
    model.result("pg11").feature("ptgr1").setIndex("legends", "E<sub>pos,cc</sub>", 1);
    model.result("pg9").run();

//    In the Model Builder window, right-click Results > Total Polarization and Load > Global 2 and choose Copy.

    model.result("pg11").run();

//    In the Model Builder window, right-click Positive Electrode Potentials and choose Paste Global.

    model.result("pg11").feature().copy("glob2", "pg9/glob2");
    model.result("pg11").run();

//    In the Positive Electrode Potentials toolbar, click Plot.

    model.result("pg11").run();

//    The potentials versus Li/Li+ are generally varying more at the electrode-separator boundary compared to the electrode-current collector boundary. This is due to an uneven current distribution in the cell.

    model.result("pg11").run();

//    Right-click Positive Electrode Potentials and choose Duplicate.

    model.result().duplicate("pg12", "pg11");
    model.result("pg12").run();

//    In the Settings window for 1D Plot Group, type Negative Electrode Potentials in the Label text field.

    model.result("pg12").label("Negative Electrode Potentials");
    model.result("pg12").run();

//    In the Model Builder window, expand the Negative Electrode Potentials node, then click Point Graph 1.
//    In the Settings window for Point Graph, locate the Selection section.
//    Click Clear Selection.

    model.result("pg12").feature("ptgr1").selection().set();

//    Select Boundaries 1, 2.

    model.result("pg12").feature("ptgr1").selection().set(1, 2);

//    Click to expand the Legends section.
//    In the table, enter the following settings:

    model.result("pg12").feature("ptgr1").setIndex("legends", "E<sub>neg,cc</sub>", 0);
    model.result("pg12").feature("ptgr1").setIndex("legends", "E<sub>neg,sep</sub>", 1);

//    In the Negative Electrode Potentials toolbar, click Plot.

    model.result("pg12").run();

//    The negative potential reaching levels below 0 V versus Li/Li+ at the separator-electrode boundary is problematic since this may result in lithium plating in the cell. Making the electrodes thinner will make the battery more power optimized. Reduce the positive electrode thickness. The negative electrode thickness is automatically reduced based on the correlation defined in the <l>Parameters 1</l> node.
//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, locate the Parameters section.
//    In the table, enter the following settings:

    model.param().set("L_pos", "25[um]");

//    Now increase the solver time to 600 s and recompute.
//    In the Model Builder window, under Study 1, click Step 2: Time Dependent.
//    In the Settings window for Time Dependent, locate the Study Settings section.
//    In the Output times text field, type range(0,1,600).

    model.study("std1").feature("time").set("tlist", "range(0,1,600)");

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.component("comp1").probe("liion_lc1_volt").genResult("none");

    model.sol("sol1").runAll();

    model.result("pg2").run();

//    You may now compare the plots with the corresponding figures of the Results and Discussion section above.

    model.result("pg8").run();

//    In the Model Builder window, under Results, click Cell Voltage and Load.
//    In the Settings window for 1D Plot Group, locate the Legend section.
//    From the Position list, select Lower left.

    model.result("pg8").set("legendpos", "lowerleft");

//    In the Cell Voltage and Load toolbar, click Plot.

    model.result("pg8").run();
    model.result("pg9").run();

//    In the Model Builder window, click Total Polarization and Load.
//    In the Settings window for 1D Plot Group, locate the Legend section.
//    From the Position list, select Lower left.

    model.result("pg9").set("legendpos", "lowerleft");

//    In the Total Polarization and Load toolbar, click Plot.

    model.result("pg9").run();
    model.result("pg10").run();

//    In the Model Builder window, click State of charge and average lithiation levels.
//    In the Settings window for 1D Plot Group, locate the Legend section.
//    From the Position list, select Middle left.

    model.result("pg10").set("legendpos", "middleleft");

//    In the State of charge and average lithiation levels toolbar, click Plot.

    model.result("pg10").run();
    model.result("pg11").run();

//    In the Model Builder window, click Positive Electrode Potentials.
//    In the Positive Electrode Potentials toolbar, click Plot.

    model.result("pg11").run();
    model.result("pg12").run();

//    In the Model Builder window, click Negative Electrode Potentials.
//    In the Settings window for 1D Plot Group, locate the Legend section.
//    From the Position list, select Upper right.
//    In the Negative Electrode Potentials toolbar, click Plot.

    model.result("pg12").run();

//    Plating potentials (below 0 V) in the negative electrode are seen during the largest charge pulses. A more power-optimized battery (for instance using thinner electrodes) would be required in order to avoid plating entirely.

    model.result("pg1").set("window", "window1");
    model.result("pg1").run();
    model.result("pg1").label("Cell Voltage Probe");
    model.result().create("pg13", "PlotGroup1D");
    model.result("pg13").run();
    model.result("pg13").create("glob1", "Global");
    model.result("pg13").feature("glob1").set("markerpos", "datapoints");
    model.result("pg13").feature("glob1").set("linewidth", "preference");
    model.result("pg13").feature("glob1").set("expr", new String[]{"liion.lc1.C_app"});
    model.result("pg13").feature("glob1").set("descr", new String[]{"C rate"});
    model.result("pg13").feature("glob1").set("unit", new String[]{"1"});
    model.result("pg13").run();
    model.result("pg13").feature("glob1").set("legend", false);
    model.result("pg13").feature("glob1").set("titletype", "none");
    model.result("pg13").run();
    model.result("pg13").run();
    model.result().remove("pg13");

    model.title("1D Lithium-Ion Battery Drive-Cycle Monitoring");

    model
         .description("This example demonstrates the Lithium-Ion Battery interface, computing several key properties of a battery during a load cycle that is typical for a hybrid electric vehicle. The properties are for instance cell voltage, open-circuit cell voltage, electrode potential, state of charge, and voltage losses.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    model = run2(model);
    model = run3(model);
    run4(model);
  }

}
