Solar energy conversion w/m^2 to mj/m^2 - physics

i am new here, I am using MERRA monthly solar radiation data. I want to convert w/M^2 to MJ/m^2
I am bit confused, how to convert solar radiation monthly average data W/m^2 to MJ/m^2
so far i understood by reading different sources,
Firstly i have to convert w/m^2 to kw/m^2
after kw/m^2 to mj/m^2 .......
Am i doing correctly
Just i am taking one instance:
For may month i have value 294 w/m^2
So 294 * 0.001 = 0.294 kw/m^2
0.294 * 24 (kw to kwh (m^/day)) = 7.056 kwh/m^2/day
7.056 * 3.6 (kwh to mj) = 25.40 mj/day
i am confused i am doing right or wrong .

Not sure why you would take the kWh step in between.
Your panels do 294 Watt per m², i.e. 294 Joule per sec per m². So that's 24*60*60 * 294 = 25401600 Joule per m² per day, or 25.4016 MJ per m² per day.

So if:
1 W/m2 = 1 J/m2 s
Then:
294 W/m2 = 294 J/m2 s
if you want it in days then:
1 day = 60s * 60min *24h = 86400s
294 J/m2 s x 86000s/1day = 25284000 J/m2 day
25284000 J/m2 day x 1MJ/1000000J = 25.284 MJ/m2 day
all together:
294 W/m2 = 294/(1000000/86400) = 25.4016 MJ/m2 day

A watt is the unit of power and Joules are the units of energy, they are related by time. 1 watt is 1 Joule per second 1W = 1 J/s. So the extension of that equation is that 1J = 1w x 1second. 1J = 1Ws. A loose analogy is if you say Litre is a unit of volume and L/S is a unit of flow. So your calculation needs to consider how long you are gathering the solar energy. So the number of Joules, if the sunlight shines at 90degrees to the solar panel for 1 hour is 294W/m2 x 3600s and would give ~1 x 10^7 joules per square metre. Of course as the inclination [the angle of light] varies away from 90 degrees, this will cause the effective power and hence the energy absorbed to drop, as a function of the sine of the angle to the sun. 90 degrees gives a sine of 1 and is full power.

Related

Expected Value formula

I have a table as follows
Day Savings
1 : 251
2 : 722
3 : 1132
4 : 1929
5 : 3006
6 : 4522
7 : 8467
...
14 : x
These savings are growing day by day, I want to find a formula to expect the final value of day 14 which is x!
I didn't look at the data in any detail, but it seems like an exponential growth situation. If that's the case, then you can estimate the growth rate by fitting an exponential curve to the data using least squares approximation to get an estimated interest rate, r. If you find the data not conducive to that, you could try fitting it to some other curve. You can then use the estimated interest rate to compute the expected funds using the standard a = p*exp(r*i) where p is the initial principal and i is the elapsed time.
This all assumes compounding interest which is an exponential growth situation. If that assumption is incorrect, this approach is probably not going to work for you.

How to calculate distance using voltage from Q4X Analog Laser Sensor

I have a Q4X Stainless Steel Analog Laser Sensor to calculate the distance with analog output voltage.
It does display distance on Laser Sensor display and I am trying to do the same thing in my code using scale factor but its not matches with Laser Sensor display value.
here is my scaling factor.
#define A2D_SCL_LASER ( 11.81f / ( 10.0f - 0.0f ) ) // inches per volt
Devices specs:
Supply Voltage (Vcc)
12 to 30 V dc
Sensing Range—Threaded Barrel Models
500 mm models: 25 mm to 500 mm (0.98 in to 19.68 in)
300 mm models: 25 mm to 300 mm (0.98 in to 11.81 in)
100 mm models: 25 mm to 100 mm (0.98 in to 3.94 in)
Comparison of distance calculation in my code and sensor display
My values(mm) sensor display value(mm)
1V 29.9974 52
2V 59.944 80
3V 89.916 107
4V 119.888 134
5V 150.114 162
6V 179.832 190
7V 209.804 217
8V 240.03 245
9V 270.002 272
10V 300 300
Ref:
http://info.bannerengineering.com/cs/groups/public/documents/literature/185623.pdf
I simply fitted the sensor displayed value with the voltage you give in your question. The R²=1 means that the fit is perfect (or near perfect) and this is a good sign.
The equation you are searching for is
Distance(mm) = 27.533 x Volt + 24.467

pandas transform moving average daily base to weekly base

I have a moving average with data points on everyday base e.g. 14 days MA.
Now I want to take this MA and display it on a bar chart e.g. one bar represents a week.
How I calculate the MA for this bar?
Is it the sum of the daily MA points over the week?
1,2,3,4,5,6,7
So the MA is 28? but the base is still daily?
Can someone try to explain if this makes sense and is correct?
Yes, Moving Average (MA) for the bar is the average of daily MA (daily count).
So
# Calculating MA
MA(week1) = (MA1 + MA2 + MA3 + MA4 + MA5 + MA6 + MA7)/7
MA(week1) = (1 + 2 + 3 + 4 + 5 + 6 + 7)/7 = 4
# Bar value 4
Incase your data is 14-day MA, you will have to make some assumptions and calculate the weekly MA. Have a look at the example to get a better understanding.
# 14-day MA -> Weekly MA
(W1 + W2)/2 = MA1
(W2 + W3)/2 = MA2
...
(Wn-1 + Wn)/2 = MAn-1
# Assume W1 == W2, you can estimate the per weekly MA
Example to calculate Moving Average

Using DAX for Production Planning

My question is based on building a ramp up for planning production lines.
I have a WIP where a ramp up category is selected to be used for each MSO (Master Sew Order). The Ramp up is based on hour fences (for example 1-6 hours,6-12 hours,etc).
On the WIP, an MSO will have units (example 1,920 units), divided by capacity per hour (80 pcs/hr), to give time needed 24 hours. This then needs to be
calculated based on ramp up, for hours 1-6, 6-12, 12-18, and 18-24 and multiply our by related efficiency.
For example:
Hours 1-6: 20% efficiency * 80 units = 16 units/hr (6 x 16 = 96 units produced)
Hours 6-12: 40% efficiency * 80 units = 32 units/hr (192 units)
Hours 12-18: 60% efficiency * 80 Units = 48 units/hr (288 units)
Hours 18-24: 80% efficiency * 80 units = 64 units/hr (384 units)
Hours 24+: 100% efficiency * 80 units = 80 units/hr ((1920-960)/80)= 12 hours remaining
TOTAL TIME = 36 hours to produce
How would Power BI know to divide up the original 24 hour estimate into parts, multiply by respective efficiency, and return a new result of 36 hours?
Thank you so much in advance!
Kurt
Relationships
I'm not sure how to do this in DAX but you tagged PowerQuery so here's a custom query that computes 36 based on your parameters:
let
MSO = 1920,
Capacity = 80,
Efficiency = {
{6, 0.2},
{12, 0.4},
{18, 0.6},
{24, 0.8},
{#infinity, 1.0}
},
Accumulated = List.Accumulate(Efficiency, [
Remaining = MSO,
RunningHours = 0
], (state, current) =>
let
until = current{0},
eff = current{1},
currentCapacity = eff * Capacity,
RemainingHours = state[Remaining] / currentCapacity,
CappedHours = List.Min({RemainingHours, until - state[RunningHours]})
in [
Remaining = state[Remaining] - currentCapacity * CappedHours,
RunningHours = state[RunningHours] + CappedHours
]),
Result = if Accumulated[Remaining] = 0
then Accumulated[RunningHours]
else error "Not enough time to finish!"
in
Result
The inner lists for Efficiency are of the form time-efficiency-ends,efficiency-value. Plug in infinity to mean the last efficiency never stops.
In a normal iterative programming language you could update state with a for-loop, but in M you need to use List.Accumulate and package all your state into one value.
In your data model you may have MSO in one table containing 2 fields, [Units] and [UnitsPerHour], and another table called EffTable which may store the efficiencies broken out by the hour fences.
Create 4 new calculated columns in your MSO table, one for each hour fence, eg [1--6]:
=
6 * LOOKUPVALUE ( EffTable[Efficiency], EffTable[Hours], "1--6" )
* [UnitsPerHour]
These are fields that hold how many units you would produce in the 4 time slots. Create a new calculated field for the total, [RampUpUnits]:
=
[1--6Hours] + [6--12Hours] + [12--18Hours] + [18--24Hours]
Finally calculate the total time as:
=
24
+ ( [Units] - [RampUpUnits] )
/ [UnitsPerHour]
This calculates the number of hours required for the remaining units and adds it to 24 for the ramp up time.

Pandas shifting uneven timeseries data

I have some irregularly stamped time series data, with timestamps and the observations at every timestamp, in pandas. Irregular basically means that the timestamps are uneven, for instance the gap between two successive timestamps is not even.
For instance the data may look like
Timestamp Property
0 100
1 200
4 300
6 400
6 401
7 500
14 506
24 550
.....
59 700
61 750
64 800
Here the timestamp is say seconds elapsed since a chose origin time. As you can see we could have data at the same timestamp, 6 secs in this case. Basically the timestamps are strictly different, just that second resolution cannot measure the change.
Now I need to shift the timeseries data ahead, say I want to shift the entire data by 60 secs, or a minute. So the target output is
Timestamp Property
0 750
1 800
So the 0 point got matched to the 61 point and the 1 point got matched to the 64 point.
Now I can do this by writing something dirty, but I am looking to use as much as possible any inbuilt pandas feature. If the timeseries were regular, or evenly gapped, I could've just used the shift() function. But the fact that the series is uneven makes it a bit tricky. Any ideas from Pandas experts would be welcome. I feel that this would be a commonly encountered problem. Many thanks!
Edit: added a second, more elegant, way to do it. I don't know what will happen if you had a timestamp at 1 and two timestamps of 61. I think it will choose the first 61 timestamp but not sure.
new_stamps = pd.Series(range(df['Timestamp'].max()+1))
shifted = pd.DataFrame(new_stamps)
shifted.columns = ['Timestamp']
merged = pd.merge(df,shifted,on='Timestamp',how='outer')
merged['Timestamp'] = merged['Timestamp'] - 60
merged = merged.sort(columns = 'Timestamp').bfill()
results = pd.merge(df,merged, on = 'Timestamp')
[Original Post]
I can't think of an inbuilt or elegant way to do this. Posting this in case it's more elegant than your "something dirty", which is I guess unlikely. How about:
lookup_dict = {}
def assigner(row):
lookup_dict[row['Timestamp']] = row['Property']
df.apply(assigner, axis=1)
sorted_keys = sorted(lookup_dict.keys)
df['Property_Shifted'] = None
def get_shifted_property(row,shift_amt):
for i in sorted_keys:
if i >= row['Timestamp'] + shift_amt:
row['Property_Shifted'] = lookup_dict[i]
return row
df = df.apply(get_shifted_property, shift_amt=60, axis=1)