Message Boards Message Boards

3 Replies
5 Total Likes
View groups...
Share this post:

Colour coding with time series sensor data

Posted 11 years ago
I have a time series of temperature sensor data of a room collected in xls file. I have made a 3D rectangle to mimic the room. Now I want to change the colour according to the time series temperature data. I am able to import the xls data.

But I am not knowing how to change the colour of the room coded with the temperature time series.

PS : I am newbie and started using Mathematica(v 9.0) just 10 hours ago emoticon emoticon
POSTED BY: Namit Kumar
3 Replies
Besides you can get your data from field, you may also use Wolfram System modeler to simulate the whole space and make it a smart and green home by yourself. Please take a look at this example. Once you know the geometry of the house, you can set the parameters in a model that is similar to the attached screenshot. You can then deduce the thermodynamic constants of the walls and floor. After you have them you can approximate the actual energy cost in your home by changing the ambient temperature or wind speed outside and the target temperature inside the room.  
POSTED BY: Shenghui Yang
I am doing a proof of concept of this right now.  Without going into details right now - Mathematica is a great tool for doing this type of modeling - especially if you want an interactive demonstration or delivarable.

So there are sensors on different vertical positions - the map will display the 3 levels in 3D so that you can view and switch levels on or off.  The sliders on the left can be linked to sensor input, or an imported data file and show how temperature change during say a 24 hour period.

Here I used the built in Mathematica Graphics to draw the temperature regions on an imported jpg of a house. The sliders can vary the color of these regions from blue to red (say) or I can construct another visual temperature scale.

#next_pages_container { width: 5px; hight: 5px; position: absolute; top: -100px; left: -100px; z-index: 2147483647 !important; }
POSTED BY: Clemens Dempers
There are a number of sub-problems that you will want to solve and put together to build a solution.

 1. Import your data from XLS:

2. Manipulate your data into the correct form so that it can be used by Mathematica's functions. Mathematica stores data using nested lists:

3. Write a program that can use a time-slice of the heat data and create a 3D represtation of it. My suggestion would be to use RegionPlot3D and to use the ColorFunction option:

For example, let's say our room is a 1 x 1 x 1 unit box and has temperatures given by the set of data generated by the code below:
tempdata = Flatten[Table[{{x, y, z}, x - y + Sin[2 Pi z]}, {x, 0, 1, 0.1}, {y, 0, 1, 0.1}, {z, 0, 1, 0.1}], 2]
"tempdata" is a list of pairs. The first value of each pair is a 3D x,y,z coordinate and the last value of each pair is the temperature of the box at that point. Since we need to have an estimate of the temperature at any point in the 1x1x1 unit box, make an interpolation of the data:
tempFunction = Interpolation[tempdata]
Here is how we can make a unit box using RegionPlot3D:
RegionPlot3D[True, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]
Now we must define a ColorFunction in some way. This will depend on what colors you might want for example in your output:
RegionPlot3D[True, {x, 0, 1}, {y, 0, 1}, {z, 0, 1},
ColorFunction -> Function[{x, y, z}, Hue[tempFunction[x, y, z]]]]

You will probably want to change the way the colors are defined on the box, please see the examples of ColorFunction in the documentation for examples of how it is used. You may also want to use options such as ColorFunctionScaling->False.

4. You mentioned that you have a time series of this data. In this case are you  looking to make an animation of the heat in the room over time? After writing a program that produces a visualization of the room at a specific time step, you can combine a list of the vizualizations together with ListAnimate or other similar functions in Mathematica. You can for example, bring them together into a gif.

Each of these steps are not trivial for someone learning Mathematica. I would reccomend reading through Mathematica's virtual book first to get a good overview of how to program with Mathematica and then work on each of these steps individually.
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract