HOPSAN
Encyclopedia
Hopsan is a free simulation
Computer simulation
A computer simulation, a computer model, or a computational model is a computer program, or network of computers, that attempts to simulate an abstract model of a particular system...

 environment for fluid
Fluid power
Fluid power is the use of fluids under pressure to generate, control, and transmit power. Fluid power is subdivided into hydraulics using a liquid such as mineral oil or water, and pneumatics using a gas such as air or other gases...

 and mechatronic
Mechatronics
Mechatronics is the combination of mechanical engineering, electronic engineering, computer engineering, software engineering, control engineering, and systems design engineering in order to design, and manufacture useful products. Mechatronics is a multidisciplinary field of engineering, that is...

 systems, developed at Linköping University
Linköping University
Linköping University is a state university in Linköping, Sweden. Linköping University was granted full university status in 1975 and is now one of Sweden's larger academic institutions. Education, research and PhD training are the mission of four faculties: Arts and Sciences, Educational...

. Although originally developed for simulation of fluid power systems, it has also been adopted for other domains such as electric power
Electric power
Electric power is the rate at which electric energy is transferred by an electric circuit. The SI unit of power is the watt.-Circuits:Electric power, like mechanical power, is represented by the letter P in electrical equations...

, flight dynamics
Flight dynamics
Flight dynamics is the science of air vehicle orientation and control in three dimensions. The three critical flight dynamics parameters are the angles of rotation in three dimensions about the vehicle's center of mass, known as pitch, roll and yaw .Aerospace engineers develop control systems for...

, and vehicle dynamics
Vehicle dynamics
Vehicle dynamics refers to the dynamics of vehicles, here assumed to be ground vehicles. Vehicle dynamics is a part of engineering primarily based on classical mechanics but it may also involve chemistry, solid state physics, electrical engineering, communications, psychology, control theory,...

. It uses bi-directional delay line
Bi-directional delay line
In mathematics, a bi-directional delay line is a numerical analysis technique used in computer simulation for solving ordinary differential equations by converting them to hyperbolic equations. In this way an explicit solution scheme is obtained with highly robust numerical properties...

s (or transmission line elements, TLM
TLM
TLM may refer to:* Torch Le Monde* Télé Lyon Métropole, TV Channel of Lyon's agglomeration* The Leprosy Mission* The Little Mermaid* Transaction-level modeling* Traditional Latin Mass* Transmission line matrix method* Transmission line measurement...

) to connect different components.

History

The development on Hopsan first began in 1977 at the Division of Hydraulics and Pneumatics at Linköping University. The first version was written in FORTRAN
Fortran
Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

, with a drag-and-drop
Drag-and-drop
In computer graphical user interfaces, drag-and-drop is the action of selecting a virtual object by "grabbing" it and dragging it to a different location or onto another virtual object...

 graphical user interface
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

 written in Visual Basic
Visual Basic
Visual Basic is the third-generation event-driven programming language and integrated development environment from Microsoft for its COM programming model...

. In addition to the simulation capability it also had features for simulation based optimization
Optimization (mathematics)
In mathematics, computational science, or management science, mathematical optimization refers to the selection of a best element from some set of available alternatives....

. This used the COMPLEX direct search optimization method or a generic algorithm
Generic programming
In a broad definition, generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters...

 (GA). It also had features for frequency analysis
Frequency analysis
In cryptanalysis, frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers....

 and transfer function
Transfer function
A transfer function is a mathematical representation, in terms of spatial or temporal frequency, of the relation between the input and output of a linear time-invariant system. With optical imaging devices, for example, it is the Fourier transform of the point spread function i.e...

 analysis, on simulated results. It also supported co-simulation under Simulink
Simulink
Simulink, developed by MathWorks, is a commercial tool for modeling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment and...

. Component models were written as FORTRAN subroutines. There was also a separate tool called COMPGEN, written in Mathematica
Mathematica
Mathematica is a computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing...

, which can be used to generate component models in a more straightforward way.

In 2009 the development of the first version of Hopsan was dropped in favor for a brand new generation of the software, written in C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

. This working name of the project is Hopsan NG, and the first beta version was released in February 2011. Parts of the source code in Hopsan was used in the OpenModelica Connection Editor (OMEdit) in a collaboration with the OpenModelica
Modelica
Modelica is an object-oriented, declarative, multi-domain modeling language for component-oriented modeling of complex systems, e.g., systems containing mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents.The free Modelica languageis...

 project.

Program Overview

The current generation of Hopsan consists of two parts, a graphical user interface and a simulation core library. These are completely separated, so that the core can be used stand-alone, for example in embedded systems or target computers. Everything is precompiled, so that no compilation is required during runtime
Runtime
In computer science, run time, run-time, runtime, or execution time is the time during which a program is running , in contrast to other phases of a program's lifecycle such as compile time, link time, load time, etc....

. Custom user models can be created and compiled as separate library files, which can be loaded from Hopsan. There is also an automated component generator using Mathematica. Hopsan models can be exported to Simulink. Plot data can be exported to XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

, CSV
Comma-separated values
A comma-separated values file stores tabular data in plain-text form. As a result, such a file is easily human-readable ....

, gnuplot
Gnuplot
- License :Despite gnuplot's name, it is not part of or related to the GNU system and it is not distributed under the GNU General Public License .However, some GNU packages do use gnuplot....

 and Matlab
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...

. Experiments with including the Hopsan simulation core to LabVIEW
LabVIEW
LabVIEW is a system design platform and development environment for a visual programming language from National Instruments. LabVIEW provides engineers and scientists with the tools needed to create and deploy measurement and control systems.The graphical language is named "G"...

 Simulation Interface Toolkit by using a wrapper library
Wrapper library
In computer programming, a library is a collection of subroutines or classes used to develop software. Libraries expose interfaces which clients of the library use to execute library routines. Wrapper libraries consist of a thin layer of code which translates a library's existing interface into a...

 have been successful. Support for model exchange, both import and export, by using the Functional Mock-up Interface
Functional Mock-up Interface
The functional mock-up interface defines a standardized interface to be used in computer simulations to develop complex cyberphysical systems....

 is currently being implemented. Built-in support for numerical optimization is scheduled for version 0.5.

Hopsan is a cross-platform
Cross-platform
In computing, cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms...

 project, with the intention of running on Windows, Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 and Macintosh
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...

 systems. The current beta release is only available for Windows, but the intention is to create versions for the other systems as well. The transmission line element method is very suitable for parallel execution
Parallel computing
Parallel computing is a form of computation in which many calculations are carried out simultaneously, operating on the principle that large problems can often be divided into smaller ones, which are then solved concurrently . There are several different forms of parallel computing: bit-level,...

, due to physically motivated time delays between certain components. Hopsan has support for dividing simulations in separate threads
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

, making it possible to take advantage of multicore processors.

Features in the graphical user interface include Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

 scripting, an undo
Undo
Undo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing, undo will negate the last command done to the file being edited....

/redo function, XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

-based model and configuration files, hydraulic symbols according to the ISO 1219-1 standard and global system parameters that can be shared between components..

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK