optimize Package#
Motivation#
MotionSolve is commonly used for system-level simulation to evaluate how well a design performs. A typical goal of such simulations is to identify the set of design parameters that allow the system to achieve its intended functions in an optimal way.
Common design variables include the location and orientation of connectors and their force characteristics. Occasionally, mass and material properties of bodies are also included as design variables. System behavior is usually characterized by a set of response variables, and the objective is to find design variable values that drive the responses to their desired targets.
Traditionally, analyses have used methods such as Monte Carlo simulations and design of experiments. While effective, these approaches are computationally intensive and require a large number of simulations.
MotionSolve supports analytical computation of design sensitivities, the matrix of partial derivatives of the response variables with respect to the design variables. Gradient-based optimizers can use these sensitivities to minimize a cost function, a process known as design optimization.
Although not as general as statistical methods, optimization with design sensitivity is significantly faster and is often the preferred solution.
The optimize package provides a practical interface for applying these techniques directly in MotionSolve
What is the optimize package?#
The msolve optimize package offers a rich array of tools and algorithms to tackle both design sensitivity analysis (DSA) and optimization problems seamlessly. Design sensitivity analysis highlights the influence of alterations in design variables (DVs) on the performance or behavior of a given system or model by closely monitoring the changes in response values (RVs). This technique provides invaluable insights, essential for informed decision-making regarding design selections. Concurrently, the optimization problem delves into the realm of seeking optimal solutions. This process identifies solutions that either maximize or minimize an objective function within the defined constraints. By skillfully navigating through the available design variables, this process drives response values toward optimal choices that align with their objectives.
Who will use it?#
This library is primarily tailored for proficient multibody experts seeking a more advanced approach to optimizing their system designs. Instead of resorting to the traditional method of manually adjusting design variables and individually assessing their performance, this library employs a diverse range of algorithms to swiftly identify the most optimal design solutions.
What is its application?#
The optimize package is very generic in nature and targets various industries, such as automotive, general machinery, white goods markets, and others. You can use the package to understand how changes in design variables impact the behavior of a system, or to find the optimal dimensions, shapes, or materials for engineering components, ensuring maximum efficiency and minimum material usage.
Design Variables#
Design variables are used to define parametric models. By changing the values of design variables, you change the model itself. During optimization, the optimizer systematically adjusts these values in its search for an optimal solution.
Each design variable has a value and upper/lower limits. The current value is used to define the model, while the optimizer must keep the variable within its specified bounds during optimization.
Many MotionSolve modeling entity attributes are designable. This means their values can be expressed as numeric expressions containing references to design variables. A model may include any number of design variables.
See Dv for details.
Response Variables#
Model behavior is captured in terms of Response Variables (RVs). These are functions of the system equations that characterize performance or behavior. The optimizer in MotionSolve works directly with response variables.
Response variables are used to define the cost and constraint functions of an optimization problem. The MotionSolve optimizer provides a library of built-in responses that you can use to construct these functions.
In addition, you can create your own custom response variables and incorporate them into the optimization process.
See Response for details.
Objective Function#
The objective function (also called the cost function) is the quantity to be minimized during optimization. In MotionSolve, the objective function is typically constructed as a weighted combination of one or more response variables. Each response contributes to the overall objective, and user-specified weights control their relative importance.
Using the Optimize Package#
Constructing a designable model of a system becomes seamless using this package. Follow these steps to ensure the model is primed for design sensitivity analysis or optimization:
Model Construction: Develop a comprehensive model of the system using the package, incorporating all pertinent design variables.
Instrumentation: Equip the model with the necessary attributes to seamlessly monitor responses or integrate optimization capabilities.
Metric Generation: Formulate distinct model responses that are of interest. These responses, referred to as metrics, serve as the benchmarks for performance evaluation.
Target Definition: (Optimization) Specify the values you aim to achieve for the defined metrics. These target values guide the optimization process toward your intended outcomes.
Objective Formation: (Optimization) Craft an objective function by utilizing the metric functions and aligning them with the target values. This objective encapsulates the optimization goal.
Execution: Initiate the process by instructing MotionSolve to provide a sensitivity matrix or enhance the system based on the formulated objective.
By diligently following these steps, you can effortlessly forge a dynamic link between design, metrics, objectives, and optimization, yielding an intricately optimized system that aligns seamlessly with your goals.
- Optimizer Class#
Optimizer is an object that contains all the elements required for optimization.
- Response Module#
The Response module contains response objects and base classes. You can create your own objectives and constraints.
- Utilities Module#
The Utilities module contains utility functions that help to make the model designable. These methods reduce the number of Dvs needed and simplify the process of making certain entities designable.