Main Content

plot

R2026b

Plot measured and simulated voltage for pulse at specific index

Since R2025a

Description

plot(circuitModel) plots the measured and simulated voltage for all pulses inside the ECM object, cicuitModel. The ECM object retains or saves a copy of the pulse data which you can then use for comparison purposes. The function obtains the simulated voltage by running a MATLAB®-based battery equivalent circuit model (ECM). This model is stored in the simulateCurrentPulse function of the ECM object.

plot(circuitModel,pulseIds) plots the measured and simulated voltage for the pulses inside the ECM object, cicuitModel, at the indices specified by pulseIds.

example

plot(circuitModel,pulseIds,timeStep) plots the measured and simulated voltage for the pulses inside the ECM object, cicuitModel, at the indices specified by pulseIds. The function simulates the ECM current pulses using the time step specified by timeStep.

plot(___,Name=Value) also specifies options using one or more name-value arguments.

chart = plot(___) returns a VoltageVerificationChart object.

Examples

collapse all

This example shows how to plot the measured and simulated voltage of a specific pulse inside an ECM object.

Open the DownloadBatteryData example and load the required HPPC data obtained for a BAK 2.9 Ah battery cell at 25 °C. This data consists of a table with three columns. The columns of the table refer to time, voltage, and current values, respectively.

openExample("simscapebattery/DownloadBatteryDataExample")
load("testDataBAKcells/hppcDataBAKcell25degC.mat")

Store the HPPC data inside an HPPCTest object by using the hppcTest function. The HPPC data is a table, so you must also specify each column name by using the TimeVariable, VoltageVariable, and CurrentVariable arguments. These names must match the names of the columns in the hppcData table.

hppcExp = hppcTest(hppcData,...
    TimeVariable="time (s)",...
    VoltageVariable="voltage (V)",...
    CurrentVariable="current (A)");

Fit the HPPC data in the hppcExp object to a battery equivalent circuit model (ECM). To fit the data and create an ECM object, use the fitECM function.

batteryEcm = fitECM(hppcExp);

Analyze how the function performed the fit on the ECM for the fourth pulse in the HPPC data by using the plot function.

plot(batteryEcm,4)

Plot of the simulated and measured pulse voltage. The X axis represents time, in minutes. The Y axis represents the voltage, in volts.

Input Arguments

collapse all

Equivalent circuit model used to plot the simulated voltage of a specific pulse, specified as an ECM object.

Indices of the tabulated pulse inside the ParameterSummary property table of the ECM object, specified as a nonnegative scalar or vector of nonnegative values.

Data Types: double

Simulation time step, in seconds, that the function uses when simulating the ECM current pulses specified in the pulseIds argument, specified as a positive scalar. Specify this argument only when the time series data has not been sampled at regular time intervals.

Data Types: double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: plot(myTest,SimulatedVoltageVisible="on")

Visibility of the simulation voltage, specified as "off", "on", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Visibility of the chart axes, specified as "off", "on", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Since R2026b

Visibility of chart axes toolbar, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • "on" — Display the toolbar.

  • "off" — Do not display the toolbar.

The plot function also accepts all properties of the ChartContainer class as name-value arguments. For a list of these properties, see matlab.graphics.chartcontainer.ChartContainer.

Output Arguments

collapse all

Chart for visualizing the measured and simulated voltage in a voltage plot, returned as a VoltageVerificationChart object.

Version History

Introduced in R2025a

expand all