Array multiplication for large dates set
5 views (last 30 days)
Show older comments
I am trying to solve a hot water tank problem which has minutely solar data over a year. My hot water tank is divided into 1 litre slices with a 200 litre capacity. Each minute the sun heats a coil which in turn heats the first slice of water in the tank. The amount of heat the coil gives to the first slice is taken off the coil's initial temperature to calculate the heat given to the second slice. This continues all the way down the tank for the 200 slices. Every minute the weather data changes and so I think I need a loop occurring each minute to account for this changing initial weather value. But I also need to calculate for each slice within each loop.
Can someone please point me in the right direction to learn how to have 200 variables change over a large data set (1 minute x 1 year = 525,600 changing initial temperatures).
I'm currently having my data set blow up which is not what I want to happen. I want to be able to graph a years worth of data for each slice which will represent 200 x 525,600 total data points. Many thanks.
4 Comments
Stephen23
on 29 Sep 2018
Edited: Stephen23
on 29 Sep 2018
Below is my code as is. It is a bit of a mess to be honest:
Essentially I have a large array with a time component and values representing solar irradiance. I need to multiple this array with some equations for each of the 200 slices in my tank.
At certain times the slices "move" as new water enters the tank so I need to record each slice 1-200 as it changes temperature over the entire year dependant on the weather.
I am struggling to understand how to multiply a large data set with a changing variable without running out of memory.
Sorry I can't be clearer but I am a real novice with Matlab (as my code probably illustrates!).
Stephen23
on 29 Sep 2018
"I am struggling to understand how to multiply a large data set with a changing variable without running out of memory."
Possibly the solution is "so don't". It is not clear which variables you want to multiply, but if you run out of memory doing that, then clearly you will need to change your algorithm: you could process your data in blocks rather than all at once, or subsample the data, or use a different calculation method... pick whatever suits your needs, your data, and your algorithm.
"I want to be able to graph a years worth of data for each slice which will represent 200 x 525,600 total data points"
Most screens have a much lower resolution than that, so plotting so many data points at once is of questionable value.
Answers (1)
Peter Perkins
on 1 Oct 2018
I'm guessing that by "multiplication", you don't mean numeric multiplication, but rather you mean, "my data are M x N".
>> t = datetime(2018,1,1,0,0,0):minutes(1):datetime(2018,12,31,23,59,59);
>> tt = array2timetable(rand(length(t),200),'RowTimes',t);
>> whos tt
Name Size Bytes Class Attributes
tt 525600x200 845212595 timetable
That's big, but not at all impossible if you have a the memory. But as Stephen says, if your gola is plotting, you're resolution is probably nowhere near that.
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots 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!