Panayiotis Steele July 15, 2005 Project Proposal Organization: NRL Computational Multiphysics Systems Laboratory Mentor Name: Dr. John G. Michopoulos I.Title Symbolic Algebra and Visualization Enhancements of a 2D-Visual Programming Environment for Multiphysics Mechatronic Systems Simulation. II.Problem Statement There is a well established need for the development of a symbolic algebra module (or "actor") for Ptolemy-II, a two dimensional visual environment for heterogeneous and concurrent modeling of physical systems. The current capabilities of the system are limited to simple algebraic manipulations and multi-dimensional entity representations and visualizations. Capturing the forward and inverse kinematic behavior of complex hybrid physical systems (such as mechatronic systems used for various applications) is of primary importance for various application areas including, material testing, component manufacturing and robotics. An additional problem associated with Ptolemy-II is that it does not contain a 3D graphics visualization actor. III.Purpose The main goal of this project is to develop an actor for Ptolemy-II that uses the Mathematica kernel as its calculation engine. The actor will be able to accept Mathematica expressions presented to its input port or/and its expression definition field, then link to the Mathematica kernel-the computational engine behind the Mathematica user interface-evaluate them and finally return the resulting expressions to the actors output ports. A secondary goal (depending on the timely development of the actor) is the utilization of this actor is to model and simulate the mechatronic system of the Computational Multiphysics Systems Laboratory (CMSL) called the "6D-Loader" system. This system has six degrees of kinematic freedom for applying displacements and rotation and measuring reaction forces and moments resulting from the response of appropriately selected composite material specimens. Integration with Mathematica and its symbolic algebra capabilities is necessary to model this machine because its kinematic behavior is described by a set of very complex system of nonlinear equations, while the behavior of the specimen is governed by a coupled system of partial differential equations. These equations are not solvable by hand, and Mathematica's assistance is highly warranted to solve them easily. Ptolemy-II and specifically the 2D visual programming editor called "Vergil" will be used to model both the visual and the functional behavior of the machine. The project will help immensely in the CMSL, even if the second goal is not realized. My mentor has already started modeling the machine and my actor will greatly facilitate completion of this task. Furthermore, a Mathematica actor for Ptolemy-II could be used to capture and model the behavior of other physical systems as well. This project is a good and very appropriate topic for the Computer Systems Laboratory because it requires the integration of various applications: Ptolemy-II, the Mathematica kernel and the J/Link interface of Mathematica to other applications. This will be done by utilizing existing libraries, as well as the development of custom developed methods to parse the input to and output from the Mathematica actor, within the context of this project. IV.Scope of Study I will have to integrate various programs together seamlessly, so that input from Ptolemy can be translated into input for Mathematica, and output from Mathematica can be translated into output and input for Ptolemy. I will collect software performance data and meta-data, and use them to optimize my final design of the integrated software. I will also research as needed so that I can understand what I am doing and make my project work. For example, I need to look up functions in the J/Link library to connect directly to the Mathematica kernel and JavaView for displaying multi-dimensional graphics from withing Prolemy. V.Background As far as research done in this general area, my mentor has started simulating the machine that I will finish simulating. With the Mathematica actor, no one has tried what I will be doing, but other computer scientists have created their own actors for other applications. Yet others have created programs that interface with Mathematica using J/Link. I am going to combine the two. The two most important documents for another student to get up to speed would be the Ptolemy II documentation, which can be found at http://ptolemy.eecs.berkeley.edu/ptolemyII and http://embedded.eecs.berkeley.edu/concurrency/ptolemy/index.html, and the J/Link documentation provided with the Mathematica software. The J/Link documentation can also be found at http://documents.wolfram.com/v5/Add-onsLinks/JLink/index.html. VI.Procedure and Methodology There are several new things I will need to learn, including all about J/Link, a fair amount about Mathematica syntax, how to program a Ptolemy actor so that it interfaces correctly with the core Ptolemy program, and how to add it to the Ptolemy source. I may also need to learn some of the Mathematica programming language. The only graphics I will need are a simple JPanel in a pop-up JFrame to display Mathematica graphs. The only data I will need to collect are those that I need to program, i.e. not experimental data; rather, research and system performance data. I will test the program as I go along by writing only small sections of code at a time and testing the code in a small environment outside Ptolemy (a standalone application). Then, after the code executes correctly outside of Ptolemy, I will run it in Ptolemy to see what, if any, errors arise, and fix them. VII.Expected Results; Value to Others I expect two results to be accomplished by the end of this mentorship. One is having a finished, working, polished actor that other people can use and not be confused. The other is to complete a simulation of the multiphysics and multi-dimensional mechatronic system present in the lab. Another possible result will be the application of what I learn from the previous tasks towards the development of a visualization actor that will accept Ptolemy expressions and will produce JavaView representations of these expressions. The final results and analyses of the project will be presented in a paper, with all the code and relevant screenshots attached. I will also prepare a poster with a brief overview of the project. Possible contributions of this project to future researchers include having a powerful mathematical computational engine available for Ptolemy developers, increased ease of modeling of systems with Ptolemy, and an increased variety of the problems that can be solved with Ptolemy.