# 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.

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Gokul Nath S J 2022년 12월 9일
Dear Nivedita,
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.
With regards,
Gokul Nath S J

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by