? ? "I would like to be able to define a trace for the energy stored in a capacitor using the formula E= 1/2 * V^2 * C. But I can't find how to include component values such as capacitance, C, in the trace formulas. Is there a way to do this?"
There is.
First, use .PARAMs to define parameters using those formulas.? This step is not really essential, but it helps to keep things organized.
Then, when you have your (parameter) value calculated, put it within {curly braces}, where the component's value should go.? For example, for a capacitor, right-click on the text where the value would go (originally "C" when you put it on the schematic), and change it to something like {MyCapValue} where MyCapValue is a user-defined parameter that was defined in a .param statement.? Or, I believe you could use {E/(0.5*V(something)**2)}.
Be careful NOT to use "^" to mean exponentiation.? In most places in LTspice, "^" is the operator for XOR.? "**" properly raises one number to an exponent.? See the tables on the Help page for the .PARAM statement.
A pair of curly braces is the way to turn a parameter into a number.? Where SPICE/LTspice expects there to be a number but instead you have a parameter, use curly braces to turn it into a number.