Madrid is today a large city, the capital of Spain. Guichard refers to the Spanish historian Oliver Asin, to note that it was once just a small frontier town created at the time of the Umayyad in the second half of the ninth century. "Madjrit" was the medieval name of the city of Madrid given to it by the Muslims. According to al-Himrayi, the hisn (fortress) of Madjrit was built by the Umayyad Amir of Cordova; Muhammad I; 852-86, whilst the historian M.A. Makki believes that its foundation may be dated between 866 and 871. The description of Madjrit by al-Himrayi states that the place consists of a small town and an impregnable fortress, with a Friday mosque.  A curiosity related to the city's history is the discovery of the skeleton of a gigantic beast in the moat of the town and the extraordinary nature of the soil of Madrid, ideal for the manufacture of solid and durable cooking pots. Another natural resource, which seems to have had its impact on local industry is cork oak. Glick points out to the fabrication of cork-soled shoes (which is one of our modern day fashions). The Andalusi Muslims fell heir to a number of oak-based industries developed by the Romans, including the making of cork-soled shoes. Under Islamic aegis, the technique was intensified and diversified, and the cork-soled shoe became universal in the country and a staple of the export trade. The Muslims made of the Romance corco (Latin, quercus) an Arabic root, q-r-q; the shoe was designated qurq (plural, aqraaq), which subsequently returned to Castilian in the form alcorque. There were two known quarters of qarraain (CaraquaÃ?Ân) in Granada and another so named in an oak district near Madrid. Both the word and the technique diffused from al-Andalus across North Africa, where it was identified as an Andalusi technique. 
Another Muslim legacy to the city was that they also, and vastly extended the use of qanats (gently sloping underground tunnels for irrigation purposes), building one system at Crevillente, most likely for agricultural use, and others, at Madrid for urban water supply. The Madrid system is still in use to this day. 
With regard to the scholars of the city, they have been studied by Oliver Asin, and so has the bibliographer Ibn Hayyan, who studied the governors of Madrid in the Ummayad period, most particularly the numerous members of the family of the Banu Salim, of Berber origin, firmly implanted in the central marches of al-Andalus and especially in the region of medinaceli (madinat Salim).
Madrid is today famed for one principal thing as far the history of Muslim civilisation is concerned, and this relates to the Escorial manuscript collection. The story of this collection has, however, the by now customary tragic story of Muslim civilisation, that is its destruction by the Catholic Church. Following their final re-conquest of Muslim territory, the Christians in Spain began to destroy Islamic books in a wholesale manner.  Spain was so stripped of Muslim books that when Philip II, in the sixteenth century, founded the Escorial library, he was unable to find many Arabic books in Spain. Some survived in Morocco, and gradually a collection was built up, though a seventeenth-century catalogue of the Escorial library, then the largest in Spain, showed only 4,000 Islamic titles, lone survivors of one of the worst holocausts of books in history.
Also related to the Muslim manuscripts kept in this library is a fact noted by Scott, that in paper making for ages known to the Chinese, the Muslims substituted linen, and finally cotton, for the silk which had been employed in China. Its introduction by the Spanish Muslims into Europe is indisputable, a manuscript of cotton paper dating from the eleventh century having been discovered in the library of the Escorial. It was practically unknown in Europe until the fifteenth century, and was not manufactured in London before 1690. 
Madrid did not produce many scholars, but amongst its sons is one of the most formidable scholars of Islam: Al-Majriti.
The Great Scholar Al-Majriti:
Maslama ibn Ahmad al-Majriti was born in Madrid, in the second half of the tenth century, and died in 1007.He was, according to Holmyard, the most brilliant of a brilliant group of Spanish Muslims who flourished under Caliph Al-Hakam II (961-76). He was the chief mathematician and astronomer of his time, and the lustre of his name was increased by his skill in the science of the division of inheritances. Maslama, according to Sa'id al-Andalusi, was the best mathematician of his time, applying himself to the observation of the stars.He brought al-Khwarizmi's astronomical tables (Zij) to the knowledge of the Christian West, was a chemical experimenter, and the earliest Hispano-Muslim scientist of any importance, according to Sarton. He also wrote treatises on commercial arithmetic (al-mutamalat) dealing with sales, cadaster, and taxes, using algebraic, geometrical and arithmetical operations. He wrote a treatise on the astrolabe (which was to be eventually translated into Latin by Joan. Hispalensis); a commentary on Ptolemy's Planisphaerium translated by Rudolph of Bruges (q.v., first half of twelfth century); and); a book on the generation of animals.He was also the founder of an important school of Muslim-Spanish scholars.
One of the major contributions of Maslama is, that alongside another Muslim Andalusi scholar Ibn al-Saffar, he introduced new methods for surveying, hitherto unknown in Spain. Indeed, the practice of triangulation, unknown to the Romans, was introduced from the East in the astrolabic treatises of both Maslama and Ibn al-Saffaar.It must be reminded that Maslama's treatise on the astrolabe was translated into Latin by John of Seville, but in the 12th century. The Muslims earlier on used the astrolabe for surveying, something which can be found explained amongst other uses of the astrolabe. This practice seems to have extended to the northern, Christian parts of Spain, in Catalonia much earlier than anywhere else in Western Christendom, Catalonia, and Ripoll, most particularly, it must be reminded, being the first place in Western Christendom to absorb Muslim scientific output. Glick tells that generally, when astrolabic literature was translated into Latin, geodesic uses of the instrument were omitted and Christian surveying treatises on the whole remained within the Roman tradition, but not with the tenth-century Geometria incertiauctoris, which Millas Vallicrosa relates to the Arabized
by: FSTC Ltd