Reformulating a simple cost function - combining 2 variables

AI Thread Summary
The discussion centers on reformulating a cost function for energy consumption in a house with a battery storage system. The original equation incorporates variables for energy input and output, which are constrained to be positive. The user seeks to express the equation solely in terms of a single variable, "energy," where positive values indicate energy discharge and negative values indicate charging. A suggested approach involves using a piecewise function to define the cost based on the state of the battery. This reformulation aims to simplify the representation of energy transactions in the cost equation.
bradyj7
Messages
117
Reaction score
0
Hi there,

I have an equation below for the cost of energy for a house per hour. The house has an energy storage system (i.e.a very large battery) installed. You can charge the battery up and energy from the battery can be used to power the building. For example you can charge the battery when electricity prices are low and then you can use the energy in the battery to supply energy to the building when electricity prices are high so that the building does not have to purchase electricity at expensive times.

The equation is written in terms of the price of electricity, the energy consumed, efficiency constant and the variables energy_in and energy_out of the battery.

c(t) = Price(t) * (Energy_consumed(t) - eff*Energy_out + (1/eff)*Energy_out)

In a single hour energy can only enter of or be discharged from the battery. Therefore, when energy_in is positive, energy_out will always be zero and vice versa. You'll notice that this equation is written in terms of energy_in and energy_out, both variables can only be positive.

My question is as follows: I'd like to reformulate the equation to be only written in terms of the variable "energy" instead of as it is currently with energy_in and nergy_out. The new variable will be >0 when energy is discharged (out) and <0 when it is charged (in).

I was hoping if somebody could tell me if this possible?

Thank you for reading this.

Sincerely
 
Mathematics news on Phys.org
bradyj7 said:
Hi there,

I have an equation below for the cost of energy for a house per hour. The house has an energy storage system (i.e.a very large battery) installed. You can charge the battery up and energy from the battery can be used to power the building. For example you can charge the battery when electricity prices are low and then you can use the energy in the battery to supply energy to the building when electricity prices are high so that the building does not have to purchase electricity at expensive times.

The equation is written in terms of the price of electricity, the energy consumed, efficiency constant and the variables energy_in and energy_out of the battery.

c(t) = Price(t) * (Energy_consumed(t) - eff*Energy_out + (1/eff)*Energy_out)

In a single hour energy can only enter of or be discharged from the battery. Therefore, when energy_in is positive, energy_out will always be zero and vice versa. You'll notice that this equation is written in terms of energy_in and energy_out, both variables can only be positive.

My question is as follows: I'd like to reformulate the equation to be only written in terms of the variable "energy" instead of as it is currently with energy_in and energy_out. The new variable will be >0 when energy is discharged (out) and <0 when it is charged (in).

I was hoping if somebody could tell me if this possible?
Sure, you can write the definition of the function using cases.
$$c(t) = \begin{cases} \text{Price(t)} * (\text{E}_{\text{ext}}(t) -\text{eff} * \text{E}_{\text{batt}}) & \text{if E}_{\text{batt}} \ge 0 \\
\text{Price(t)} * (\text{E}_{\text{ext}}(t) + \frac 1 {\text{eff}} * \text{E}_{\text{batt}}) & \text{if E}_{\text{batt}} \lt 0 \end{cases}$$

For the sake of simplifying the equation, I replaced Energy_consumed by Eext, and Energy by Ebatt.
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top