PC Measurement Guide - Click here to read more...
The AdeptStore: Order Technical Software 24 hours a day from anywhere in the world

Product Index
Search
Register
Products
What's New
Pressroom
Adept Store

Support
Free Seminars
Info Requests
Magazines
Tech Support
Training

Corporate
About Adept
Contact Us
Find Adept
Jobs

Maple Reporter

Introducing Maple 7

Maple at 20

Maple Student Centre

Instant Calculus

Application Centre Highlights
Animations Contest
Games in Maple
Population Biology
Is it raining in Moscow

Tips & Techniques

Maple 7 and Maple Powertools Each Win and EDDIE Award

Application Centre Highlights
Is it Raining in Moscow? Ask Maple

Maple 7's Sockets package allows you to download real-time Web data into your Maple applications. A team of Waterloo Maple’s application specialists took this package for a test-drive by connecting to Lycos®’s weather Web site http://weather.lycos.com from inside a Maple worksheet.

We created a Maple procedure that would connect to http://weather.lycos.com and return the current temperature reported by Lycos for any city we input to the procedure. (See Figures 1 and 2). One might object, "If you want the weather in Moscow, why not visit Lycos with a browser directly and spare yourself the Maple programming?" However, the motivation of the Sockets package goes beyond providing access to internet data. It enables users to pull that data automatically into mathematical analysis they developed in Maple, which the Web sites themselves cannot provide. A more fitting title to this article might be, "Why is it raining in Moscow? Ask Maple."

In this particular Maple application, we collected current temperatures from 30 cities selected from around the globe. We then plotted the cities’ temperatures as points on a sphere, with the locations of the points determined by the cities’ latitude and longitude, and the colours of the points determined by their current temperatures. (See Figure 3).
One can spin the globe using Maple’s real-time 3-D plot rotation and see how location influences temperature at any given time of day, or time of the year. The application is available from the Maple Application Centre at http://www.adeptscience.co.uk/go?pg=H31

Out of laziness, we didn’t take the data analysis any further, but one can imagine some fascinating directions Maple could go from here. One could input the temperature data to Maple’s curve-fitting procedures to estimate the current temperature of any point on the earth as a function of latitude and longitude. Then one would suddenly recall the famous Meteorology Theorem from topology, which states that at any given time, there exists a pair of antipodal points on the planet having the exact same temperature and barometric pressure. By applying Maple’s symbolic equation solver to the temperature function, one could actually find all such pairs of points. By repeating the process for different times, one could study how the antipodal pairs shift throughout the day. In such an analysis, the data acquisition merely provides the icing. Maple’s maths engine provides the cake.

Downloading data from a Web site with the Sockets package presents a challenge, however. The data queries to a Web site sent by a socket connection in Maple must have syntax understood by the site’s Web server. Because every Web server has its own protocol, the user must do some homework before attempting to connect to a server from Maple. For example, in the Lycos page showing the weather in Berlin (see Figure 4), the URL substring following the server’s IP ("weather.lycos.com") contains a code identifying the page for Berlin, namely, "zipcode=EDDB&direct=true." By viewing each city’s page in Lycos, one would have to acquire each city’s code manually and hard-code it into the Maple application. This is, in fact, what we did to create the temperature application described above.

Maple’s user community has made incredibly creative uses of the software that Waterloo Maple itself never even dreamed of. We are confident that users will exploit the opportunities presented by Maple 7’s new Sockets package in many exciting and imaginative ways.

Article: Is it Raining in Moscow? Ask Maple