createSankeyPlot
Description
The createSankeyPlot( method
creates a Sankey diagram of the energy in a system or subsystem. Use the PlantInfoObj)autoblks.pwr.PlantInfo object to evaluate and report power and energy for
component-level blocks and system-level models.
createSankeyPlot(___,
allows specified name-value arguments to set a plot title, specify subsystem that you want
to analyze, and remove losses below a threshold.Name=Value)
After you use the findChildSys
method to retrieve the autoblks.pwr.PlantInfo object for the system that
you want to analyze, use the
createSankeyPlot( method to create a
Sankey diagram to visualize total energy input, output, and losses. For more information,
see SubSystem)ChildSys.
Examples
Analyze the power and energy in the conventional vehicle reference
application. Use the createSankeyPlot method to visualize power
loss.
Open the conventional vehicle reference application. By default, the application has a mapped 1.5 L spark-ignition (SI) engine and a dual clutch transmission. Project files open in a writable location.
Set the system name to ConfiguredConventionalVirtualVehicle.
Create the autoblks.pwr.PlantInfo object.
Use the PwrUnits and EnrgyUnits properties to
specify the units.
SysName = 'ConfiguredConventionalVirtualVehicle'; VehPwrAnalysis = autoblks.pwr.PlantInfo(SysName); VehPwrAnalysis.PwrUnits = 'kW'; VehPwrAnalysis.EnrgyUnits = 'kW*h';
Use the run method to turn on logging, run simulation, and add
logged data to the object.
run(VehPwrAnalysis);
Use the dispSysSummary method to display the results.
dispSysSummary(VehPwrAnalysis);
Use the xlsSysSummary method to write the results to a
spreadsheet.
xlsSysSummary(VehPwrAnalysis,'EnergySummary.xlsx');Use the findChildSys method to retrieve the
autoblks.pwr.PlantInfo object for the Engine subsystem.
To display the results, use the dispSignalSummary method.
Use the histogramEff method to display a histogram of the time
spent at each engine plant efficiency.
EngSysName = SysName+"/Vehicle/ConfiguredSimulinkPlantModel/Engine";
EngPwrAnalysis = VehPwrAnalysis.findChildSys(EngSysName);
dispSignalSummary(EngPwrAnalysis,EngSysName);
histogramEff(EngPwrAnalysis);Use the findChildSys method to retrieve the
autoblks.pwr.PlantInfo object for the Transmission
subsystem.
To display the results, use the dispSignalSummary method.
TransSysName = SysName+"/Vehicle/ConfiguredSimulinkPlantModel/Transmission";
TransPwrAnalysis = findChildSys(VehPwrAnalysis,TransSysName);
dispSignalSummary(TransPwrAnalysis,TransSysName);To plot the results, use the sdiSummary method.
sdiSummary(VehPwrAnalysis,{EngSysName,TransSysName})To create a Sankey diagram, use the createSankeyPlot method.
VehOnlyAnalysis = VehPwrAnalysis.findChildSys(SysName + "/Vehicle");
SankeySubsystems = string({VehOnlyAnalysis.Children.SysName});
createSankeyPlot(VehPwrAnalysis,ChildSys=SankeySubsystems);Input Arguments
autoblks.pwr.PlantInfo object for the system that you want to
analyze.
Data Types: function_handle
Name-Value Arguments
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: ChildSys=SankeySubsystems
Sankey diagram title, specified as a string or character vector.
Example: Title="Sankey Diagram"
Data Types: string | character vector
Subsystems that you want to visualize on a Sankey diagram, specified as a string or character vector.
Use this table to interpret the arrows created for displaying
energy information for the subsystems specified by the ChildSys argument.
| Goal | ChildSys Value | Input Arrows | Output Arrows | Loss Arrows |
|---|---|---|---|---|
Display top-level system energy information. | Not specified | Creates arrows for the total system energy input and stored energy consumed. For example, a decrease in battery charge represents an input. | Creates arrows for the total system energy output and stored energy. For example, an HEV drive cycle simulation resulting in a higher state of charge represents a battery output. | Creates an arrow for the total system energy losses. |
Display individual subsystem energy information. | Specified | Creates arrows representing a total input or consumed energy for each subsystem listed in ChildSys. Detailed breakdown by
specified subsystems plus
| Creates arrows representing a total output or stored energy for each subsystem listed in ChildSys. Detailed breakdown by
specified subsystems plus
| Creates arrows representing a total energy loss for each subsystem listed in ChildSys. Detailed
breakdown by specified subsystems plus
|
Display energy information for all components with power accounting blocks. |
| Creates arrows for every component in the system. Components with
energy inputs below the value of PctThreshold are grouped into | Creates arrows for every component in the system. Components with
energy outputs below the value of PctThreshold are grouped into | Creates arrows for every component in the system. Components with
energy losses below the value of PctThreshold are grouped into |
Example: ChildSys="ConfiguredConventionalVirtualVehicle/Vehicle/ConfiguredSimulinkPlantModel/Engine"
Data Types: string | character vector
Threshold percentage to remove input, output, and loss errors, specified as a scalar.
Example: PctThreshold=5
Data Types: double
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)