How to obtain a random function from defined graph with specified average?
조회 수: 1(최근 30일)
표시 이전 댓글
Nivedita 2022년 12월 5일
답변: Gokul Nath S J 2022년 12월 9일
How to plot a random function so that the average of the driving period and the energy loss from graph as shown below will be 3600 seconds and 3 kWh respectively.
Gokul Nath S J 2022년 12월 9일
I assume, you want the average duration and energy loss of the attached image to be 3600 and 3KWh respectively. As an initial step, one has to find the average of the entire graph and assign the driving time to be 3600. Since the number of intervals are known in the x-axis, one can find the fundamental sampling time.
For example, say you got an average value of the function to be 4000. Then the time corresponding to 4000 in the x-axis will be 3600. Now see in which index does 3600 lies. Say 3600, lies in 500 index of a 100-index array in x-axis. Then one could easily find the interval length and the maximum value of the driving time considering the start value to be zero.
Once the average driving time is set, you can proceed ahead with the energy loss. Say if your equation driving the system is kinetic energy loss and y – axis be velocity. The energy loss will be proportional to square of velocity. Normalize the graph with the energy loss value and multiply the entire graph with 3KWh. This depends on the energy loss function and the quantity in the y-axis.
I hope the above information helps in resolving your issue.
Gokul Nath S J
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!