O'Reilly logo

Effective Computation in Physics by Anthony Scopatz, Kathryn D. Huff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Classes and Objects

When physicists create a mathematical model of a physical process, they rely on the mathematical framework that can represent that process as closely as possible. When Newton developed a model of forces and motion, the appropriate mathematical framework was calculus. When Einstein developed a model of wave-particle motion, he relied on the mathematics of wave equations and eigenvalues. For many models in scientific computation, the computational framework that best aligns with our need is object orientation.

The universe presents itself as a collection of objects that humans (in particular, scientists) tend to classify based on their attributes and behaviors. Similarities, relationships, and hierarchies among these objects further help to structure our perception of the world. In alignment with that conceptual model, object orientation facilitates representation of the world as classes of objects that possess attributes, behaviors, and hierarchical relationships. Classes in object orientation organize data, methods, and functions. Those classes manifest themselves as specific objects. We will discuss these two concepts in great detail here.

This chapter will describe how object orientation allows the scientist to cleanly organize behaviors and data. It will also mention the many objects this book has used already and how they operate as particular instances of distinct classes. To demonstrate the use of classes for modeling physics, this chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required