To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
The development of larger-scale Mathematica programming projects is discussed and illustrated in this chapter. Each of the examples in this chapter contain numerous tasks that need to work together and also integrate well with Mathematica. When you develop such applications, it is important to think about how your functions work with each other as well as how well they integrate with the rest of Mathematica. The user's interface to your programs should be as close as possible to the built-in functions of Mathematica so that users can more easily learn the syntax and usage. Features such as options, argument checking, messaging, and documentation are all discussed in the context of larger applications that are developed using all of the tools that were developed in earlier chapters.
Manipulating data files
Introduction
One of the most common tasks for scientists and engineers is working with data sets that have been generated by some external process or collector. If they are lucky, the data are stored in a file that has a standard format and can then be read into other programs such as Mathematica with ease using that program's importing functionality. Oftentimes, however, data are stored in files with nonstandard formats and reading that file into a program such as Mathematica requires some manual processing of that file to extract the required parts.
In this section we will walk through the steps of reading, manipulating, and visualizing a dataset that consists of solar radiation data collected by the Renewable Resource Data Center, an organization that is managed by the US Department of Energy (interested readers should visit rredc.nrel.gov).
Mathematica contains a rich set of tools for visualizing functions and data. Generally the built-in graphics functions will provide what you need, but, just like the rest of the Mathematica programming language, you will periodically find yourself with the need to create your own plotting and visualization routines. In this chapter we will discuss how to construct graphical images using Mathematica, and how to write programs that solve problems that are graphical in nature.
Structure of graphics
All Mathematica graphics are constructed from objects called graphics primitives. These primitive elements (Point, Line, Polygon, Circle, etc.) are used by built-in functions such as Plot to create graphics. Although it is quite straightforward to create images using Mathematica's built-in functions, you will frequently find yourself having to create a graphic image for which no Mathematica function exists. This is analogous to the situation in programming where you often have to write a specialized procedure to solve a particular problem. We use the basic building blocks and put them together according to the rules governing the structure of the language and the nature of the problem at hand. In this section we will look at the building blocks of graphics programming and at how we put them together to make graphics.
Primitives, directives, and options
Graphics created with functions such as Plot and ListPlot are constructed of lines connecting points, with options governing the display.
In this chapter we extend the programming concepts we have covered thus far to the objects that comprise the user interface, or front end. Because the objects that the Mathematica user interacts with are themselves Mathematica expressions, all of the tools that you use to do computations can also be used to create, manipulate, and alter cells and notebooks themselves. We will first look at the underlying structure of these objects and then discuss ways of manipulating them directly from within Mathematica.
Introduction
Up until this point, we have been primarily concerned with learning about programming constructs and styles so that we can write programs to manipulate data or solve problems from science, engineering, or mathematics. We have taken for granted that the space in which we do our experimenting, prototyping, and documenting has been the Mathematica notebook, an interface that has some similarities to a word processor document.
It is not uncommon now to add interactive elements to your documents to make them more useful for yourself or the intended reader of your documents. With programs, documentation, and papers all being created and used in electronic format, Mathematica provides a seamless and well-integrated interface to these elements.
Another tool that is useful, especially for educators, are buttons that allow you to hide your program code behind a familiar and easy-to-use interface element – the button. The user clicks on a button and an action happens that is determined by the underlying code.
Expressions are the basic building blocks from which everything is built. Their structure, internal representation, and how they are evaluated are essential to understanding Mathematica. In this chapter we focus on the Mathematica language with particular emphasis on the structure and syntax of expressions. We will also look at how to define and name new expressions, how to combine them using logical operators, and how to control properties of your expressions through the use of attributes.
Expressions
Introduction
Although it may appear different at first, everything that you will work with in Mathematica has a similar underlying structure. This means things like a simple computation, a data object, a graphic, the cells in your Mathematica notebook, even your notebook itself, all have a similar structure – they are all expressions, and an understanding of expressions is essential to mastering Mathematica.
Internal forms of expressions
When doing a simple arithmetic operation such as 3 + 4 ⋆ 5, you are usually not concerned with exactly how a system such as Mathematica actually performs the additions or multiplications. Yet you will find it extremely useful to be able to see the internal representation of such expressions as this will allow you to manipulate them in a consistent and powerful manner.
Internally, Mathematica groups the objects that it operates on into different types: integers are distinct from real numbers; lists are distinct from numbers.
We present simulated monopedal and bipedal robots that are capable of open-loop stable periodic running motions without any feedback even though they have no statically stable standing positions. Running as opposed to walking involves flight phases which makes stability a particularly difficult issue. The concept of open-loop stability implies that the actuators receive purely periodic torque or force inputs that are never altered by any feedback in order to prevent the robot from falling. The design of these robots and the choice of model parameter values leading to stable motions is a difficult task that has been accomplished using newly developed stability optimization methods.
We consider the problem of the stabilization in single support of the vertical posture for a two-link, a three-link, and a five-link planar biped without feet. The control torques are applied in the inter-link joints only. Thus, our objects are under-actuated systems. The control laws are designed, using the biped linear models and their associated Jordan forms. The feedback is synthesized to suppress the unstable modes. The limits imposed on the torques are taken into account explicitly. Thus, the feedback laws with saturation are designed. The numerical investigations of the nonlinear models with the designed control laws are presented.
Several static and dynamic stability criteria have been defined in the course of walking-robot history. Nevertheless, previous work on the classification of stability criteria for statically stable walking machines (having at least four legs) reveals that there is no stability margin that accurately predicts robot stability when inertial and manipulation effects are significant. In such cases, every momentum-based stability margin fails. The use of an unsuitable stability criterion yields unavoidable errors in the control of walking robots. Moreover, inertial and manipulation effects usually appear in the motion of these robots when they are used for services or industrial applications. A new stability margin that accurately measures robot stability considering dynamic effects arising during motion is proposed in this paper. The new stability margin is proven to be the only exact stability margin when robot dynamics and manipulation forces exist. Numerical comparison has been conducted to support the margin's suitability. Stability-level curves are also presented on the basis of a suitable stability margin to control the trajectory of the center of gravity during the support phase.
In this paper, we propose a model-based control system design for autonomous flight and guidance control of a small-scale unmanned helicopter. Small-scale unmanned helicopters have been studied by way of fuzzy and neural network theory, but control that is not based on a model fails to yield good stabilization performance. For this reason, we design a mathematical model and a model-based controller for a small-scale unmanned helicopter system. In order to realize a fully autonomous small-scale unmanned helicopter, we have designed a MIMO attitude controller and a trajectory controller equipped with a Kalman filter-based LQI for a small-scale unmanned helicopter. The design of the trajectory controller takes into consideration the characteristics of attitude closed-loop dynamics. Simulations and experiments have shown that the proposed scheme for attitude control and position control is very useful.