Руководство Rocky 3 DEM
Руководство Rocky 3 DEM
Руководство Rocky 3 DEM
User Manual
July, 2015
WWW.ROCKY-DEM.COM
Copyright © 2015, ESSS, GDI, and RDI. All Rights Reserved. Page 1
User Manual
V 3.7.0
Page 2 Copyright © 2015, ESSS, GDI, and RDI. All Rights Reserved.
COPYRIGHT © 2015, Engineering Simulation and Scientific Software (ESSS), Granular Dynamics
International, LLC (GDI), and Rocky DEM, Inc. (RDI). ALL RIGHTS RESERVED.
No part of this documentation may be reproduced in any form, by any means, without the prior written
permission of ESSS, GDI, and RDI.
ESSS, GDI, and RDI make no representations or warranties with respect to the program material and
specifically disclaim any implied warranties, accuracy, merchantability or fitness for any particular purpose.
Furthermore, ESSS, GDI, and RDI reserve the right to revise the program material and to make changes
therein without obligation to notify purchaser of any revisions or changes except specific errors determined to
be incorporated in the program material. It shall be the responsibility of ESSS, GDI, and RDI to correct any
such errors in an expeditious manner. In no event shall ESSS, GDI, or RDI be liable for any incidental,
indirect, special, or consequential damages arising out of the purchaser’s use of program material.
Autodesk, AutoCAD, and Inventor are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries
and/or affiliates in the USA and/or other countries. Windows and Excel are registered trademarks of Microsoft Corporation
in the United States and other countries. Intel, Intel Core, and Xeon, are trademarks of Intel Corporation in the U.S. and/or
other countries. SolidWorks is a registered trademark of Dassault Systèmes SolidWorks Corporation in the United States
and overseas. Adobe Photoshop is either a registered trademark or a trademark of Adobe Systems Incorporated in the
United States and/or other countries. ANSYS, ANSYS Workbench, FLUENT and any and all ANSYS, Inc. brand, product,
service and feature names, logos and slogans are registered trademarks or trademarks of ANSYS, Inc. or its subsidiaries
in the United States or other countries. Python and PyCon are trademarks or registered trademarks of the Python
Software Foundation. All other brand, product, service, and feature names or trademarks are the property of their
respective owners.
Contents
1. Software Overview .......................................................................................................................................... 5
Program Features ...................................................................................................................................... 6
What's New ................................................................................................................................................ 8
System Requirements ................................................................................................................................ 8
Best Practices ............................................................................................................................................ 8
System Requirements
Rocky has been designed to be used in conjunction with common CAD design tools, such as Autodesk
Inventor and AutoCAD. As a result, Rocky will have similar system requirements. Please see below for
minimum system requirements and optional recommendations.
Minimum Requirements:
64-bit Windows 7
A video card that supports OpenGL graphics
4 GB of free disk space
4 GB of RAM
Two-button mouse with center wheel
Screen resolution of 1280 x 1024
Recommended:
8 GB of free disk space
8 GB of RAM
Quad-core or better processor (Intel Core i5, Intel Core i7, or Intel Xeon processor)
A Nvidia GPU card with at least 4 GB memory and fast double-precision processing capabilities (Telsa
K40, Telsa K80, Titan, Titan Black, or Titan Z)
Autodesk Inventor or other CAD software
Microsoft Excel or other spreadsheet software
AVI-compatible media player
Best Practices
The engineers who developed and tested Rocky have compiled the following set of best practices to help you
get the most out of using the software. These recommendations are best used in conjunction with the user
assistance content that follows.
While there are no hard-and-fast rules regarding processing speed in Rocky, there are some steps you can
take. To speed up your processing time, do one or more of the following:
• Use GPU processing and/or increase your processing power.
• Reduce your particle stiffness. The default stiffness of 1x108 Pa can be safely reduced to 1x106 -
1x107 Pa for narrow size distributions (1:3 or less). This should result in a 3-10x increase in time
step.
• Increase your minimum particle size.
• Reduce the complexity (sides, corners, size distributions) of your particles.
• Shorten the simulation length.
• Increase the size of your boundary triangles. The default value of 0.1 is recommended for all
boundaries where you want to see wear data.
• Run and save Rocky files locally; avoid processing and saving Rocky simulations over a network.
• Run only one simulation at a time on any one machine.
To gain an understanding of how much faster GPU processing could be as compared with CPU processing,
see http://rocky-dem.com/index.php?pg=gpu_processing.
To prevent this from happening, do one of the following (see also Figure 3 below):
• Make your inlet smaller.
• Add a vertical lip to the top of your feeder box.
Figure 3:
(1) Angled walls of feeder box
prevents particle from fully
entering simulation area;
(2) Make the inlet smaller;
(3) Add a lip to the top of the
feeder box.
To view a video
1. Log into the ESSS customer portal.
Note: If you do not have access to the customer portal, please contact [email protected]
for assistance
2. Click the link below to open the video you want to watch.
• How to install Rocky: This 10 minute video provides a detailed look at the steps required to install
Rocky and configure the floating licensing server. It is best watched in conjunction with the
written instructions for configuring the Rocky 3 floating licensing server.
• User interface overview: This 5 minute video outlines the major parts of the Rocky user interface,
including the menu and tool bars, Data and Data Editors panels, and the various visualization
options available.
• Customizing the Rocky User Interface: This 5 minute video goes over the five main components
of the Rocky UI, and how you can show, hide, move, and resize them to your liking.
• Data panel overview: Outlines the various components of the Data tree, the hierarchical
component that a Rocky simulation is built upon. Right-clicking items in the Data panel displays a
contextual menu with available actions for the selected item; Left-clicking items in the Data panel
displays editable options in the Data Editors panel, which is located just below the Data panel.
• Rocky Preferences Overview: Goes over the various global preferences that can be set in Rocky
including data and time formats, timestep formats, and various visualization settings.
• Geometries and Particles as Grid Parts: Shows how Geometries and Particles are displayed in
Rocky 3D Views, and how changing visualization options changes the coloration to show
different results.
• Using the Timestep Toolbar Options: Shows how using the arrows, drop-down list, and playback
button on the Timestep toolbar enables you to see progressive results in the Workspace. Also
shows how a workspace can be divided up into many different 3D Views and plots.
• Selecting Multiple Options in the Data Panel: Shows the multiple select feature in Rocky that
enables you to select multiple items in the Data panel and edit all common parameters at once in
the Data Editors panel.
• Opening a Simulation: Shows the various ways you can start a new simulation or edit an existing
one.
• Creating a graph (curve or plot): Shows some ways to display and analyze simulation results in
Rocky, including creating curves and plots.
•
• Editing a graph (curve or plot): Demonstrates some ways to change or modify an existing plot or
curve within Rocky.
• Changing the 3D View: Demonstrates how to use the toolbar buttons, mouse and keyboard to
change the perspective, zoom, rotate, and pan a 3D View in the Workspace.
• Using User Processes to Analyze a Component: Shows how using the User Processes features,
including the Plane and Cube options, enables you to divide your geometries to analyze specific
sections or components.
• Importing Custom Geometry: Shows how to add your own geometry components into Rocky, and
also covers the file options supported.
• Creating an Animation: Shows how to set up an animation of your simulation and save it as an
AVI.
Install/Remove Rocky
Instructions for how to install or remove Rocky and also configure the floating licensing server are provided
below.
Note: You must be logged into the ESSS customer portal to view the content. If you do not have access to
the customer portal, please contact [email protected] for assistance.
To install ROCKY
1. View the overview video on How to install Rocky.
2. Follow the written instructions for configuring the Rocky 3 floating licensing server.
To remove ROCKY
1. From the Start menu, click All Programs, click ESSS, click Rocky 3, and then click Uninstall Rocky 3.
2. Follow the instructions provided on your screen.
Main UI Components
Use this section to explore the five major parts of the Rocky user interface, and learn when and why you
might access them.
You can also show/hide toolbars by right clicking a toolbar and selecting or deselecting the options at the
very bottom of the contextual menu.
Panels
Below the toolbar and surrounding the Workspace are various floating panels that enable you to set
parameters and choose options for your simulation and its resulting data. The primary panels for configuring
your simulation are the Data and Data Editors panels that appear (by default) to the left of the Workspace;
the primary panels for post-processing are the Windows and Windows Editors panels that appear (by default)
to the right of the Workspace. Also showing (by default) to the right of the Workspace, you can display
various tools panels such as Animations or Macros. You can choose to show/hide multiple panels through
both the View and Tools menus located at the top of the screen.
All panels in Rocky can be resized, moved, nested with other panels, and undocked to float independent of
the Rocky main screen. Specifically:
• To resize a panel, hover your mouse over a panel boundary until the resize icon appears. Then, click
and drag the boundary to the desired width or height.
• To move a panel to another docked location, click the panel title and drag to the desired area outside
of the Workspace. While still dragging the panel, a preview of new docked locations will be displayed
with a blue background. To select a new docked location, release the mouse over the preview of the
location you want.
• To make a nested panel, click the panel title and then drag it directly over another panel until the
lower panel is blue, and then release the mouse. The second panel will appear as a tab at the bottom
of the first panel. Select the tab you want to toggle between panels.
• To make a docked panel float, click the panel title, drag it towards the center of the screen then
release the mouse. Alternatively, you can also click the icon to the left of the panel’s close button to
make any docked panel float.
Show/hide multiple panels by right clicking a panel’s title bar and selecting or deselecting the options at the
top and middle of the contextual menu. To learn more about showing, hiding, moving, and resizing objects in
the Rocky UI, watch the Customizing the Rocky User Interface video.
Workspace
A Workspace is a collection of Rocky windows. Located in the center of the Rocky screen, the windows that
make up a Workspace are where you choose to view the physical components of your simulation setup (3D
View windows), and interact with the graphical results of your simulation (plot and histogram windows).
You can have multiple Workspaces for different purposes, such as by analysis type. These are designated by
Workspace tabs along the bottom of the Workspace area, which can also be renamed to better help you
organize your data.
are viewed. Windows appear only from within a Rocky Workspace, but you can maximize the size of the
Window to take advantage of the entire Workspace area, or you can tile several windows in columns by using
the options at the bottom of the Windows menu.
Hidden Features
This section covers the not-so-obvious but useful features scattered throughout the Rocky UI and how it
might benefit you to use them.
Figure 6: Open and closed eye icons to the right of objects in the Data panel
Figure 7: Checkboxes to the left of objects in the Data panel
Eye Icon
An “open” eye icon (default setting) indicates that particular object is visible or shown in 3D View windows,
plots, or histograms. A “closed” eye icon keeps that item in the simulation's calculations but makes the object
appear invisible or hidden in the window. This is useful for seeing behind one object to another in an
animation, for example, or for focusing on a particular curve in a plot.
Checkbox
In the Data panel, the checkbox has the same visibility affect as the eye icon but is hierarchical, meaning it
affects all children components directly beneath that item in the Data panel. For example, clearing the
checkbox to the left of Geometries hides all individual geometry components listed beneath it.
In the Windows panel, the checkbox acts like the eye icon does in the Data panel: it shows/hides the
individual object—in this case, various windows in the Workspace. Unlike in the Data panel, checkboxes in the
Windows panel are not hierarchical.
See Input/Output Relationships in the Data Panel When Component Names are Bold
Linked objects refers to the ability of a geometry component, Particles, or Air Flow to provide data to a
particular User Process, thus establishing an input/output relationship between them. This linkage is
illustrated in the Data panel by the name of the object providing the data (output) turning bold when the User
Process that is accepting the data (input) is selected, as shown in Figure 8.
Figure 8: Example of a geometry component shown in bold when the user process linked to it is selected
To create this kind of input/output relationship, the User Process must be created directly from the object
providing the data. In the example above, the “Cube <01> user process was created by selecting the
83.BC06 geometry and then creating a Cube user process from either the Data Editor or right-click menu.
Figure 9: Pin icons on the Grid Functions tab of the Data Editors panel
The color of these pin icons indicates how often Rocky calculates the particular item, as follows:
• A gray-colored pin (default) indicates that the item will not be calculated for any timestep. Choosing
to avoid calculating data that you don’t need saves processing time and power during your
simulation.
• A red-colored pin indicates that the item will be calculated for each timestep included in the
simulation. And if settings affecting those values change, Rocky will recalculate to keep all the values
current.
Important: Choosing to have Rocky calculate the item at each timestep is likely to take up a
significant amount of processing time and power. Only choose to pin items for which having all
timestep calculations be kept up-to-date and available are truly necessary for your analysis.
Tip: To pin or unpin an item, just click left-click the pin icon.
Alternately, you can choose to have Rocky calculate any values you are interested in once, by right-clicking
the item and choosing Compute Statistics. This enables you to see values you are interested without taking
up as much processing time and power as it would take to pin the same item. The results you get are
dependent upon what kind of data item you chose, as described below:
• For items on the Grid Functions tab, choosing to Compute Statistics results in only the current
timestep being calculated.
Note: Ensure first that Instantaneous is selected from the Time Scope drop down before taking this
step.
• For items on the Curves tab, choosing to Compute Statistics results in all currently available
timesteps being calculated. But unlike pinning an item, choosing to Compute Statistics will not
continue to recalculate those values should settings change that affect them, or if new timesteps are
added to the simulation.
Placeholder Description
? Information isn’t calculated yet. Same as “Not loaded.”
Not loaded Information isn’t calculated yet. Same as “?
- Not enough information available at this particular timestep in order to calculate the
values. Same as “Unable to calculate”.
Unable to calculate Not enough information available at this particular timestep in order to calculate the
values. Same as “-”.
Unknown Not enough information is known to calculate the value.
<ind> Item contains no units for the value displayed. Generally indicates a count of
something.
Double-Click the Status Panel to Jump to the Appropriate UI Location
If you have errors listed in the Status panel (Figure 10), you can double-click those errors to be taken to the
location in the Data panel where you would address them.
For example, if you double-click the “There are no geometries in the simulation” error, Rocky would enable
the Geometries item in the Data panel.
When you start typing into it, Rocky immediately displays in the Data panel the entire hierarchy of the
component(s) that best match what you typed. In a simulation setup with many different components, using
the search bar can help you find what you need faster than scrolling.
Tips:
• To search the names in order from left to right, enter the first few characters of the component you
want to find.
For example, to find all components that begin with “belt,” type belt into the search box. You would
find “belt 01” and “belt 02” but not “feeder belt” by using this method.
• To search anywhere in the name, type an asterisk (*) followed by the characters anywhere within the
name that you want to find.
For example, to find all components containing “belt” anywhere in the name, type *belt into the
search box. In this way, you would find the “feeder belt” component as well as “belt 01” and “belt 02.”
Figure 12: Example of Title bar progress information shown while a simulation is processing
File Types
There are several unique file types used in Rocky, and several common ones. Use the table below to identify
when and why certain file types are used.
Note: Only the simulation project file is saved to the directory location you choose. All other files created by
Rocky (marked as “System” below) are saved to a project subfolder created automatically within the same
directory as your project file. System files are critical for Rocky functioning and should not be edited, moved,
or deleted.
Files you choose to export out of Rocky, including animation, image, and data files, are saved to the locations
you specify. See the below table for more detail.
Whatever system you choose will provide the default unit settings for all parameters used within Rocky.
However, each individual parameter unit can still be changed manually to another unit type at any time.
Use the images and tables below to help you understand your unit system options.
Figure 13: Unit Management dialog
For Input variables, you can enter into the parameter text fields a variable name on its own, or you can use a
variable within a mathematical function that you enter into the parameter text field instead. In this way, Rocky
enables you to create dynamic relationships between parameters, and enables you to change and update
placeholder values quickly. (For a more detailed example, see Appendix D: Use Variables to Test Varying
Belt Speeds).
Because it can be hard to remember what parameters use what variables, Rocky uses the Expressions list to
help you keep track of where the Input variables are being referenced—even if it is being used within a
function or other variable definition. The Expressions list is also useful for verifying what units the variable or
function is using for the particular location specified, and for changing the value or units of the variable later
without having to locate it again in the Data Editors panel.
Important: Verify that your field units are set the way you want before using or creating a variable—or function
including a variable—within a field. Even though variables are saved in the Variables list without units, as soon
as a variable—or function including a variable—is used within a parameter field, it takes on whatever units are
currently set for that field and those units are then recorded for that specific usage in the Expressions list.
Changing the units for the field after the variable or function have already been entered only converts the
numerical display to reflect the new units; the original variable or function amount and units are still retained.
However, you can change the units and value later by editing it in the Expressions list.
Variables can be defined and used at any point during the setup portion of your simulation. See also Enter
Input Variables or Mathematical Functions as Parameter Values.
Use the images and tables below to help you understand how to set your variables.
Figure 14: Example of entering a variable into a text field
Figure 15: The variable name and units used for the field appears after double-clicking the field
Figure 16: The current value for the variable entered appears in the field after clicking away from the field
Figure 17: Expressions/Variables panel, Input tab showing one defined variable being used in two separate locations
Table 5: Expressions/Variables panel, Output tab and Edit Properties dialog options
Setting Description Range
Name Enables you to specify a unique identifier for the The name must begin with a
variable. By default, it is the name of the curve or letter or underscore and can be
grid function that you have chosen but can be followed by as many letters,
edited as desired. underscores, or numbers as
desired. Spaces and other
symbols are not allowed. Letters
are case sensitive.
Value The numerical value assigned to the variable as Automatically calculated based
determined by the curve or grid function that you upon the settings you have
have chosen and the constraints you have chosen.
assigned.
Setting Description Range
Details A summary of the constraints imposed upon the Automatically listed based upon
curve or grid function that results in the Value the settings you have chosen.
displayed.
Grid Function to When the variable is based upon a Grid Function, Min; Max; Average; Sum; Sum
Curve this is the function that will convert the grid function Squared; Variance; Standard
values at each timestep in the Domain Range to a Deviation
single value. This single value will then be acted
upon by the Operation on Curve function to get the For more information, see About
final Value. Curve and Grid Functions.
Operation on If the variable is based upon a Curve function, this Min; Max; Average; Sum; Sum
Curve is the function that will be applied to it to generate Squared; Variance; Standard
the final Value for the variable. Deviation
If the variable is based upon a Grid Function, this is For more information, see About
the function that will be applied to the single value Curve and Grid Functions.
generated from the Grid Function to Curve value to
achieve a final Value for the variable.
Domain Range Defines what timesteps of the simulation are Application Time Filter;
included in the final Value calculation. The options All;
are as follows: Last Output;
• Application Time Filter: Use the range Time Range;
settings on the Time Filter dialog to limit
Specify Time;
the timesteps used. (For more information,
After Time;
see Use the Timestep toolbar.)
Time Range Relative to
• All: Use all available timesteps in the
Simulation End
simulation.
• Last Output: Use only the very last (most
recent) timestep that was calculated.
• Time Range: Limit the timestep values by a
specific range that you choose. (Uses the
Initial and Final values you set.)
• Specific Time: Choose only a single
specific timestep. (Uses the At Time value
you set.)
• After Time: Use all timesteps available
after a specific time period of your
choosing. (Uses the Initial value you set.)
• Time Range Relative to Simulation End:
Specify how long before the very end of the
simulation to include timesteps. (Uses the
Range from end value you set.)
Setting Description Range
Initial When Time Range or After Time is chosen for Any value between 0 and the
Domain Range, this is the starting time to begin final simulation time.
calculations.
Final When Time Range is chosen for Domain Range, Any value between the Initial
this is the ending time when calculations are time and the final simulation time.
stopped.
At Time When Specific Time is chosen for Domain Range, Any value between 0 and the
this is the exact moment in which the calculation final simulation time.
will be performed.
Range from end When Time Range Relative to Simulation End is Any value between 0 and the
chosen for Domain Range, this is the period of time final simulation time.
before the final simulation time in which timesteps
will be included in the calculation. For example,
when you want to include only the last X seconds
of the simulation.
To change the units for a variable—or functions using variables--in use by a field
• Do one of the following:
• In the Expressions/Variables panel under Expressions, find the instance of the variable whose units
you want to change, double-click the Value for that usage, and then modify the units displayed in the
brackets.
• Remove the variable name—or function using the variable name—from the field, set the units for the
field to the ones you want adopted by the variable or function, and then re-enter the variable name—
or function using the variable name—again.
Tip: Double-click the field to see the full variable name—or function using the variable name—and the
units that it using in that instance.
Tip: Rocky includes several visual feedback mechanisms, like text color, to help you ensure the variable
names and mathematical functions you enter are correct. See Use Colored Text to Validate the Syntax of
Your Entries for more information.
variable--within a field. Even though variables are always saved in the Variables list without units, as soon a
variable—or function using a variable--is used within a parameter field, it takes on whatever units are currently
set for that field and then those units are recorded for that specific usage in the Expressions list. Changing
the units for the field after the variable or function have already been entered only converts the numerical
display to reflect the new units; the original variable or function amount and units are still retained. However,
you can change the units and value later by editing it in the Expressions list.
You enable a moving, rotating, vibrating, or swinging geometry by first importing the boundary from a CAD
program, and then setting the Translation and Rotation, Vibration, or Pendulum values you want. See also
Add and Edit Geometry Components.
To enable a geometry to rotate around a center point (e.g. a rotating mill slice)
1. Ensure the geometry you want to rotate has already been imported. (See also Add and Edit Geometry
Components.)
2. From the Data panel, under Geometries, select the geometry to want to rotate.
The parameters for that geometry are displayed in the Data Editors panel.
3. From the Data Editors panel, on the Custom Boundary tab, determine when you want the geometry to
appear and/or disappear by entering the number of seconds you want for Enable Time and Disable Time.
Tip: To keep the geometry visible during the entire simulation, leave the values at 0 and 1000 (or your
maximum simulation time).
a) In the Boundary Mass box, enter the geometry’s mass.
b) In the Moments of Inertia boxes, enter the values you want for the 3 principal moments of inertia.
Note: It is assumed that at the beginning of rotation, principal axes of inertia coincide with local x,
y, and z axes.
5. From the Movements sub-tab, click Edit Movements List.
6. From the Custom Movements dialog, do all of the following:
a) Determine when you want the geometry to start and stop moving by entering the number of
seconds for Start Movement Time and Stop Movement Time.
b) From the Movement Type list, do one of the following:
o To have the geometry physically move during the simulation, select Rotation and
Translation.
o To keep the geometry stationary but apply velocity to the surface, select Rotation and
Translation without Displacement.
Note: You cannot enable free motion or boundary wear simulations with this option.
7. Under Rotation Parameters, for each of the axes for which you want movement, do one of the following:
• To have the geometry continue to rotate in a set motion regardless of gravity or the
boundaries/particles with which it comes into contact, enter the rotational velocity, acceleration and
the location of the center point of rotation.
• To have the boundary move freely under gravity and interact with the particles with which it comes
into contact, select Free Motion, and then enter the additional torque and center point of rotation
location.
Notes:
o Free motion is possible only with Rotation and Translation.
o Geometries will not interact with other geometries.
8. Click OK to save your changes and close the dialog.
To enable a geometry to rotate freely around a non-center point (e.g., a gate or rubber curtain)
1. Ensure the geometry you want to rotate has already been imported. (See also Add and Edit Geometry
Components.)
2. From the Data panel, under Geometries, select the geometry to want to rotate.
The parameters for that geometry are displayed in the Data Editors panel.
3. From the Data Editors panel, on the Custom Boundary tab, determine when you want the geometry to
appear and/or disappear by entering the number of seconds you want for Enable Time and Disable Time.
Tip: To keep the geometry visible during the entire simulation, leave the values at 0 and 1000 (or your
maximum simulation time).
4. From the Mass sub-tab, do all of the following:
a) In the Boundary Mass box, enter the geometry’s mass.
b) In the Moments of Inertia boxes, enter the values you want for the 3 principal moments of inertia.
Note: It is assumed that at the beginning of rotation, principal axes of inertia coincide with local x,
y, and z axes.
5. From the Movements sub-tab, click Edit Movements List.
6. From the Custom Movements dialog, do all of the following:
a) Determine when you want the geometry to start and stop moving by entering the number of
seconds for Start Movement Time and Stop Movement Time.
b) From the Movement Type list, select Rotation and Translation.
7. Under Rotation Parameters, for each of the axes for which you want movement, do all of the following:
a) Select Free Motion, and then enter the additional torque and center point of rotation location.
b) Select Specify Gravity Center (local) and then enter the Gravity Center location for the geometry.
Note: Geometries will not interact with other geometries.
8. Click OK to save your changes and close the dialog.
Tips:
• To more easily replicate a movement you have already set up, select the movement you want to
replicate, and then above the Movement list, click the Copy button.
• To change the name of a movement, select it and then above the Movement list, click Rename.
• To re-order the movement list, select the movement you want to move, and the above the Movement
list, use the Move Up and Move Down buttons to change its location in the list.
• To remove a movement, select it and then above the Movement list, click the Remove button.
To view either type of wear data, you need to ensure that you have enabled enough boundary triangles prior
to processing your simulation. Too few triangles will result in a jagged or blocky representation rather than a
smooth one.
To view a color map of wear on the default belt or imported geometry itself
1. Set up the simulation as you normally would. (See also Set Simulation Parameters.)
Tip: Ensure that your Statistics / Wear / Breakage Start time is set to when you want wear data to be
collected. (From the Data panel, select Solver and then from the Data Editors panel, locate this value on
the Time Configuration sub-tab.)
2. Before processing your simulation, from the Data panel, under Geometries, select the default conveyor
or imported (custom) geometry for which you want to enable wear.
The parameters for the geometry become active in the Data Editors panel.
The geometries in your simulation change color and a color legend is displayed in the 3D View.
7. Do the following to adjust the view and color map as desired:
a) To better focus on the area you want to view, use the mouse to pan, rotate, and zoom.
b) To hide all items but the belt or geometry you want to focus on, use the eye icons to the left of
the geometries and particles in the Data panel.
c) To modify the color bar, right-click the color legend and change the options listed.
d) To focus on a different time period within the simulation, use the arrows or slider on the Timestep
toolbar.
3. Setting Up a Simulation
Before you can process a simulation, you must first set the parameters upon which the simulation will be
based. These parameters are set within the Data and Data Editors panels of the Rocky user interface. They
include such settings as project name; particle type, size, and shape; geometry type and location; materials
and interactions; airflow; and more.
Rocky comes preset with default values that you can use right away without modification if you choose.
However, the minimum requirements for processing a simulation include setting up each of the following
three items:
1. One inlet geometry
Note: The inlet can either be from a default feed conveyor or from a separate inlet geometry that
you’ve added to the simulation.
2. One particle group
3. One input
To save an exact copy of the simulation project, including the simulation results
1. From the File menu, click Save As.
2. From the Save As dialog, choose the first option, “Save As a New Project and Copy Simulation Results”,
and then click OK.
3. In the Save in list, click the drive or folder of the location to which you want to save the file.
4. In the File name box, enter a name for the file, and then click Save.
To save a copy of only the simulation settings; not the simulation results
1. From the File menu, click Save As.
2. From the Save As dialog, choose the second option, “Save As a New Project but DON”T Copy
Simulation Results”, and then click OK.
3. In the Save in list, click the drive or folder of the location to which you want to save the file.
4. In the File name box, enter a name for the file, and then click Save.
Setting simulation parameters involves setting simulation-wide values as well as parameters specific to
particles, geometries, materials, interactions, inputs, and more.
Simulation-wide parameters are set by first selecting the Study, Physics, Domain Settings, and Solver
sections in the Data panel and then editing the results in the Data Editors panel. These values can be set at
any time before you begin processing your simulation.
Use the figures and tables below to help you understand the various parameters you can set for the
simulation in general.
Figure 21: Study parameters in the Data Editors panel
Figure 23: Domain Settings, Coordinate Limits parameters in the Data Editors panel
Table 8: Study parameter options
Setting Description Range
Set at Boundary When selected, automatically sets the coordinate limits of the Turns on or off
Limits simulation at the extreme ends of the existing geometries. When
geometries change or move, the limits will be changed also.
Notes:
• Selecting this item will cause particles to disappear from
the simulation when they reach the end of a geometry.
• Clearing this item will cause particles to disappear from
the simulation based on the values you set in the Min
Values and Max Values fields.
• Because the limits are dynamic due to the changing and
moving of geometries, the limits will not be visible in the
3D View. You can, however, see the boundary limit
values by viewing the Simulation Summary screen. (See
Processing a Simulation for more information.)
Min Values When Set at Boundary Limits is cleared, enables you to set the No limit for X, Y,
minimum values for the simulation coordinate limits in the and Z values but
following format: must be lower than
X Y Z Max Values
The limits will be visible in the 3D View.
Max Values When Set at Boundary Limits is cleared, enables you to set the No limit for X, Y,
maximum values for the simulation coordinate limits in the and Z values but
following format: must be higher
X Y Z than Min Values
The limits will be visible in the 3D View.
Figure 24: Domain Settings, Periodic Boundaries parameters in the Data Editors panel
Figure 25: Solver, Time Configuration parameters in the Data Editors panel
Table 10: Solver, Time Configuration parameter options
Setting Description Range
Simulation The total amount of time that you want the simulation to run. Positive values
Duration Tips:
• When calculating the Duration value, be sure to
account for the length and speed of your conveyors,
the tonnage of your particles, and so on.
• You can extend the duration at a later point by
changing this value to a higher number.
Output Frequency The time frequency by which you want your Timestep files to be Value must be
saved. positive but less than
Tip: To prevent rotating or vibrating boundaries from appearing Duration.
like they are moving backwards, divide the movement by 2 and
then set your output frequency as slightly lower than that value.
Statistics / Wear / The amount of time you want to wait before starting to calculate Value must be
Breakage Start simulation statistics like belt and boundary wear, energy positive but less than
spectra, and particle breakage. Duration.
You can add as many components to your simulation in any combination you desire. However, before you
are able to process a simulation, you must have a minimum of at least one inlet (this can be either from a
default feed conveyor or from a separate inlet that you’ve added to the simulation).
Once you add the geometries you want, you can then change the parameters to achieve the behavior you
want. The parameters you change can include the size, shape, and behavior of the default geometries
included within Rocky, or special movements of the custom geometries you’ve imported, such as gates that
lift or turn, for example.
The benefits of choosing a default conveyor geometry are ease of set-up for typical transfer chute designs:
the default conveyors have common elements like skirtboards and belt rolls included in the design and come
set up to have the conveyor surface move around the head pulley. These items can be specified for an
imported conveyor as well but will take more setup and configuration effort. Also note that an imported feed
conveyor will need to have an inlet added to the design in order to function.
All other non-conveyor geometries, including chute or mill components, will need to be imported into Rocky.
Custom geometries have the benefit of allowing movement—such as translation or pendulum actions—to be
applied to the individual components.
Use the figure and table below to understand the various import parameters you can set for your custom
geometry and then use the procedures that follow to learn about how to add geometry components to your
simulation setup.
Figure 28: Rocky dialog displaying import options for custom geometries
Use the figures and table below to understand the various parameters you can set for a default feed
conveyor.
Figure 29: Default Feed Conveyor, Geometry parameters in the Data Editors panel
Figure 30: Default Feed Conveyor, Orientation parameters in the Data Editors panel
Figure 31: Default Feed Conveyor, Skirtboard parameters in the Data Editors panel
Figure 32: Default Feed Conveyor, Feeder Box parameters in the Data Editors panel
Figure 33: Default Feed Conveyor, Head Pulley parameters in the Data Editors panel
Figure 34: Default Feed Conveyor, Belt Profile parameters in the Data Editors panel
Figure 35:Default Feed Conveyor, Belt Motion parameters in the Data Editors panel
Figure 36: Default Inlet, Simulation Configuration parameters in the Data Editors panel
Figure 37: Default Inlet, Geometry parameters in the Data Editors panel
Figure 38: Default Receiving Conveyor, Geometry parameters in the Data Editors panel
Figure 39: Default Receiving Conveyor, Orientation parameters in the Data Editors panel
Figure 40: Default Receiving Conveyor, Skirtboard parameters in the Data Editors panel
Figure 41: Default Receiving Conveyor, Belt Profile parameters in the Data Editors panel
Figure 42: Default Receiving Conveyor, Belt Motion parameters in the Data Editors panel
Figure 43: Imported (custom) geometry, Geometry parameters in the Data Editors panel
Figure 44: Imported (custom) geometry, Mass parameters in the Data Editors panel
Figure 45: Imported (custom) geometry, Wear parameters in the Data Editors panel
Figure 46: Imported (custom) geometry, Movements parameters in the Data Editors panel
Figure 47: Custom Movements dialog, Rotation and Translation parameters. (Same parameters as Rotation and
Translation Without Displacement.)
Motion Defines which coordinate system the movement values are Local;
Coordinates based on: Global
• Local: Coordinate system is relative to the position of
the geometry.
• Global: Coordinate system is relative to the simulation
in general.
Note: Most movement settings can be either Local or Global
but Center of Rotation values can only be Local.
Translation Parameters
Setting Description Range
Free Motion When Rotation and Translation is selected, this enables the Turns on or off
geometry to move freely along the chosen Axis under gravity
and particle forces.
Notes:
• Free movement is affected by particle placement,
Boundary Mass, and Force.
• The amount of movement is restricted by Minimum
Displacement and Maximum Displacement.
• Free Movement cannot be specified for Rotation and
Translation Without Movement.
Force When Free Motion is selected, this enables an external force Positive values
to be applied to the geometry. For example, the added force of
a car pressing down on a wheel.
Velocity This is the translational velocity along the axis. No limit
Tip: To set the same value for a parameter across multiple similar geometries, multi-select the geometries
you want in the Data panel (SHIFT + left-click for a continuous group; CTRL + left-click for discontinuous
items) and then change the values you want in the Data Editor panel. Only those parameters common across
all selected geometries will be editable but any changes made will populate across the selected group.
To remove a geometry
• From the Data panel, under Geometries, right-click the name of the geometry you want to remove,
and then click Remove Geometry.
By default, Rocky defines three Material sets for each simulation, including one each for Default Belt, Default
Boundary, and Default Particle. While you can modify the settings for these default Materials and also add
additional Material definitions if you choose, you cannot remove these default Materials from the simulation.
Materials you define here will be used when defining the parameters for Geometries, Particles, and Materials
Interactions.
Use the figures and table below to help you understand the various parameters you can modify for Materials.
Figure 50: Material parameters in the Data Editors panel
Modifying these values enables you to calibrate how “wet” or “sticky” a Material acts when it comes into
contact with another Material, enabling you to create simulations that more closely mirror real-world
conditions.
Note: Even though Rocky enables you to set interactions of geometries to other geometries, these types of
interactions have no value to your simulation. The only values that will affect your simulation are those
interactions between particles (particle-to-particle) or between particles and boundaries (particle-to-
geometry).
Use the figures and table below to help you understand the various parameters you can modify for Materials
Interaction.
Figure 52: Materials Interaction parameters in the Data Editors panel
Use the figure and table below to help you understand the various parameters you can set for each Particle
group.
Figure 53: Particle, Size Distribution parameters in the Data Editors panel
Figure 54: Particle, Geometry parameters in the Data Editors panel
If more than one size is specified for a particle group, a range of sizes
within the Size parameter will be used for each Cumulative %
provided. The one exception is for the smallest Size value, which will
have no range.
Vertical Changes the height (Y value) of the particle assuming a Z value of 1. Value limited by
Aspect Ratio list box
Horizontal Changes the width (X value) of the particle assuming a Z value of 1. Value limited by
Aspect Ratio list box
Smoothness Changes how smooth or sharp the particle edges are. The higher the Value limited by
value, the smoother the edges. list box
Side Angle For Briquettes, changes the angle of the corners. Value limited by
list box
Number of Changes how many points a particle's surface has. Value limited by
Corners list box
Superquadric Changes how square or elliptical a particle appears. The higher the Value limited by
Degree value, the more square the shape. list box
Breakage
Use When selected, enables you to modify the various parameters used to Turns on or off
Breakage calculate how particles will fracture in the simulation.
Note: Breakage models apply only to non-round particle shapes.
(From the Geometry tab, choose Faceted, Briquette, Faceted Cylinder,
or Custom from the Shape Type list.)
Setting Description Range
Model Name of the model that Rocky uses to calculate fracturing. Exp-T10
For more information about the breakage model used in Rocky, refer
to the 2013 paper by Alex Potapov et al: Computer Simulation of Coal
Breakage in Conveyor Transfer Chutes with Rocky Discrete Element
Method Package.
Distribution Type of fragment distribution size used in the model. Gaudin-Schumann
Minimum Smallest size the particle fragments can be after breaking. Any value
Size
Reference Lref in the model equation. Any value
Size
Minimum If the total specific energy for a particle that comes into contact with Any value
Specific another particle or geometry is less than this value, breakage will not
Energy occur.
emin in the model equation.
Selection The particle breakage strength parameter, which is a material Any value
Function constant.
Coefficient S in the model equation.
Maximum Maximum degree of impact breakage, Value limited by
T10 Value M in the model equation. list box
Use the figure and table below to help you understand the various parameters you can set for particle inputs.
Tips:
• To insert a new row beneath the selected row, click the Insert button.
• To remove the selected row, click the Remove button.
• To remove all rows in the table, click the Remove All button.
To edit an Input
• From the Data panel, click the Particle Input you want to edit, and then from the Data Editors panel,
modify the settings as desired.
To remove an Input
• From the Data panel, click the Particle Input you want to remove, and then from the Data Editors
panel, click the Remove button.
Use the figures and table below to understand the various parameters you can set for air flow.
Figure 57: CFD Coupling, Air Flow in Data Editors panel
In general, the higher the values given on the Simulation Summary dialog, the longer the simulation will take
to process. (See also Best Practices for Faster Processing.)
Use the figure and table below to understand the various types of summary information provided for
simulations.
The time it takes for your simulation to complete will depend upon the complication of the parameters you
have set, and the number and type of the processors you have chosen. Based upon these characteristics,
your simulation can take anywhere from a few minutes to several days to complete. (See also
Best Practices for Faster Processing.)
IMPORTANT: You are only able to set and change parameters during simulation setup so ensure that your
settings are correct before processing.
While your simulation is processing, you might stop and restart the simulation several times before your
simulation is complete. As the simulation is processing, you can see the progress in a 3D View window or
see data collect in a plot or histogram.
Start a Simulation
You start a simulation either after you have finished setting simulation parameters and are ready to begin the
calculations, or have stopped a simulation and want to continue processing it. In this step, you select whether
you want CPU or GPU processing, the number of processors, and which direction you want parallel slicing to
occur.
While the simulation is processing, you are able to use Rocky to review your simulation settings, create
charts, graphs, and 3D Views of the data collected thus far, and more.
The only task you are unable to do while a simulation is processing is change the set up parameters. Doing
this would affect the calculations that Rocky is solving. To change the setup parameters, first stop the
simulation, change your parameters, and then start your simulation over from the beginning.
Use the image and table below to understand the parameters you can set for processing your simulation.
Note: We covered these first
two options in the Set
Simulation-Wide
Parameters section.
Figure 58: Solver, General Settings parameters in the Data Editors panel
Notes:
• Setting more processors than what you have available will
slow the simulation.
• Windows limits the number of processors to 64 so if you are
running Rocky on Windows, it is best to set this value to 64 or
less.
Parallel Sets the direction parallel slicing is made during processing. In X-Parallel Slicing
Slicing general, choose the direction that represents the longest boundary Y-Parallel Slicing
component in your simulation. For example, if your longest boundary is Z-Parallel Slicing
a conveyor oriented along the X-axis, choose X-Parallel Slicing. This
setting can help reduce processing time.
Stop a Simulation
There are several reasons why you might want to stop your simulation from processing. For example:
• When you want your computer to take a break from processing, perhaps to do some computer
maintenance, with the intent of resuming your simulation again later.
• When you want to prevent Rocky from making any further calculations to the simulation, perhaps
because you want to change the simulation parameters and start processing again from the
beginning.
• When you have determined you have enough data from the simulation results and no longer need
further calculations to be performed.
When you stop a simulation, you can choose to resume it at any time to continue processing from the last
saved Timestep. If you decide to change any of the setup parameters, however, you must start processing
your simulation from the beginning. (See also Start a Simulation.)
To stop a simulation from processing
• From the Solver tab, click Stop Processing.
You can create a plot or histogram to show various data, such as statistics for particles, geometries, belt
wear, and energy spectra; or, you can export the data you want to a CSV file to view from a spreadsheet
program, such as Microsoft Excel.
When you create an animation, you can choose which portion of the simulation files to include, enabling you
to make an animation of the whole simulation or just a portion of it. Any visualization settings that you have
set in the 3D View, including the colors, particle shapes, labels, and view angles, will also be replicated in the
animation exactly as shown, so it is important to ensure that those settings are as you want before adding
your Key Frames.
Tip: For precise animations requiring exact positioning and sequencing, or for creating many similar
animations of different simulations, it is recommended that you use Rocky’s Macro tool to set up a repeatable
script. To get help setting up an animations macro, please contact [email protected].
Use the figures and tables below to understand the various parameters you can set for your animation file.
Figure 59: Animation panel Figure 60: Video Compression dialog
To set up an animation
1. Open the simulation containing the results you want to animate.
2. Ensure the Animation panel is visible. (From the Tools menu, click Animation.)
3. Create a Key Frames list by doing the following:
a. Find or create a 3D View with the visualization settings you want to animate, including the rotation
and level of zoom.
b. Using the Timestep dropdown and/or arrows in the toolbar, choose the particular Timestep with
which you want your animation to start. (For example, if you want your animation to start at the
beginning, choose the [0] 0 s Timestep.)
c. From the bottom of the Animation panel, click the Add Key Transition Tips:
Frame button.
• To transition quickly between
An image of the Timestep and view you created shows in
views, leave no Timestep gap
the Key Frames list.
between Key Frames.
d. Set up your next Key Frame by doing one of the following:
• To transition slowly between
• To show the same view for a period of time, move only
views, leave a Timestep gap
your Timestep forward as desired but don’t change the
between Key Frames equal to
view.
the desired transition length.
• To transition to another view over a period of time,
• To create a 360 wraparound
move your Timestep forward and change your view as
view, include two Key Frames
desired.
with the same exact view and
e. From the bottom of the Animation panel, click the Add Key a Timestep gap equal to the
Frame button. desired amount of time you
An image of the Timestep and view you created shows in want the view to pivot around
the Key Frames list. the center point.
f. Repeat steps 3d-e as many times as necessary to
complete your animation set up.
Tip: Use the buttons at the bottom and side of the Animation panel to help you delete, copy, move,
and update Key Frames that you’ve already created.
4. From the top of the Animation panel, determine what kind of transitions you want between your Key
Frames by choosing an option from the Camera Interpolation list.
5. Determine the speed, length, and quality of your animation by setting the values you want in the FPS
field for the animation, and Number of Frames field for each Key Frame. Use the values displayed for
Total Frames and Total Time to guide you in your selections.
6. At the bottom of the Animation panel, click the Play button to view a preview of your animation in the
Rocky Workspace, and then edit your Key Frames and animation options as desired.
Rocky User Manual (this document). Use the Table of Contents at the beginning of the document or the
Search or Find function within your PDF viewer to quickly find the information you need.
To access the Rocky User Manual, from within the Rocky program, click User Manual from the Help
menu.
ESSS Customer Portal. View Rocky how-to and overview videos, installation instructions, and examples
of Rocky simulations. From the portal you can also submit a customer support request and check-up on
existing requests.
To access the ESSS customer portal, from the www.rocky-dem.com website, go to the Customer Portal
page, click the Customer Portal link, and then sign in as instructed. If you do not already have sign-in
information for the customer portal, please contact [email protected] for assistance.
Rocky Training. Sign-up for the next Rocky training session to get a better understanding of how Rocky
can help you improve your designs, and get hands-on experience using the product.
Rounded Barley
Polyhedron
Pea
Rice
Rock
Orange
Raisin
Vertical Horizontal Number
Start with this Side Superquadric
To create this shape Aspect Aspect Smoothness of
Particle Type Angle Degree
Ratio Ratio Corners
Chocolate
Rounded
Polyhedron
Wood Chip
Coal
Poker Chip
Rounded
Polygon
1.245 0.532 N/A N/A 5 N/A
Corn
Pill
Navy Bean
Sheet Metal
Vertical Horizontal Number
Start with this Side Superquadric
To create this shape Aspect Aspect Smoothness of
Particle Type Angle Degree
Ratio Ratio Corners
Rod
Rounded
Cylinder
Capsule
Sharp Rock
Faceted
Wafer
Newspaper
Briquette
Symbol Description
Space
! Exclamation mark
" Double quotes (or speech marks)
# Number
$ Dollar
% Percentage
& Ampersand
' Single quote
( Open parenthesis (or open bracket)
) Close parenthesis (or close bracket)
* Asterisk
+ Plus
, Comma
- Hyphen
. Period, dot, or full stop
/ Slash or divide
0 Zero
1 One
2 Two
3 Three
4 Four
5 Five
6 Six
7 Seven
8 Eight
9 Nine
: Colon
; Semicolon
< Less than (or open angled bracket)
= Equals
> Greater than (or close angled bracket)
? Question mark
@ At symbol
A Uppercase A
B Uppercase B
C Uppercase C
D Uppercase D
E Uppercase E
F Uppercase F
G Uppercase G
H Uppercase H
I Uppercase I
J Uppercase J
K Uppercase K
L Uppercase L
M Uppercase M
N Uppercase N
O Uppercase O
P Uppercase P
Q Uppercase Q
R Uppercase R
S Uppercase S
T Uppercase T
U Uppercase U
V Uppercase V
W Uppercase W
X Uppercase X
Y Uppercase Y
Z Uppercase Z
[ Opening bracket
\ Backslash
] Closing bracket
^ Caret - circumflex
_ Underscore
` Grave accent
a Lowercase a
b Lowercase b
c Lowercase c
d Lowercase d
e Lowercase e
f Lowercase f
g Lowercase g
h Lowercase h
i Lowercase i
j Lowercase j
k Lowercase k
l Lowercase l
m Lowercase m
n Lowercase n
o Lowercase o
p Lowercase p
q Lowercase q
r Lowercase r
s Lowercase s
t Lowercase t
u Lowercase u
v Lowercase v
w Lowercase w
x Lowercase x
y Lowercase y
z Lowercase z
{ Opening brace
| Vertical bar
} Closing brace
~ Equivalency sign - tilde
Delete
Appendix C: Calculation Reference
Rocky uses expressions to create a new curve or grid function. These expressions are based upon the latest
NumPy math routines. (For more information about NumPy math routines, see
http://docs.scipy.org/doc/numpy/reference/routines.math.html).
It is also possible to conduct calculations using timesteps, in which case the expression would access the
variables using brackets [ ].
For example:
Use the Table of Functions below to navigate to the section you are interested in.
Table of Functions
Trigonometric functions .......................................................................................................................... 121
sin....................................................................................................................................................................... 121
cos ...................................................................................................................................................................... 122
tan ...................................................................................................................................................................... 123
arcsin .................................................................................................................................................................. 124
arccos ................................................................................................................................................................. 126
arctan ................................................................................................................................................................. 127
hypot .................................................................................................................................................................. 129
arctan2 ............................................................................................................................................................... 129
degrees .............................................................................................................................................................. 131
radians................................................................................................................................................................ 132
unwrap................................................................................................................................................................ 133
deg2rad .............................................................................................................................................................. 133
rad2deg .............................................................................................................................................................. 134
Hyperbolic functions ............................................................................................................................... 135
sinh ..................................................................................................................................................................... 135
cosh .................................................................................................................................................................... 136
tanh .................................................................................................................................................................... 137
arcsinh ................................................................................................................................................................ 138
arccosh ............................................................................................................................................................... 139
arctanh ............................................................................................................................................................... 140
Rounding................................................................................................................................................ 141
around ................................................................................................................................................................ 141
round .................................................................................................................................................................. 143
rint ...................................................................................................................................................................... 143
fix ....................................................................................................................................................................... 143
floor .................................................................................................................................................................... 144
ceil...................................................................................................................................................................... 145
trunc ................................................................................................................................................................... 146
Sums, products, differences ................................................................................................................... 146
prod .................................................................................................................................................................... 146
sum .................................................................................................................................................................... 148
nansum .............................................................................................................................................................. 149
cumprod ............................................................................................................................................................. 151
cumsum ............................................................................................................................................................. 152
diff ...................................................................................................................................................................... 153
ediff1d ................................................................................................................................................................ 154
gradient .............................................................................................................................................................. 155
cross .................................................................................................................................................................. 156
trapz ................................................................................................................................................................... 158
Exponents and logarithms ...................................................................................................................... 160
exp ..................................................................................................................................................................... 160
expm1 ................................................................................................................................................................ 161
log ...................................................................................................................................................................... 162
log10 .................................................................................................................................................................. 163
log2 .................................................................................................................................................................... 164
log1p .................................................................................................................................................................. 165
logaddexp........................................................................................................................................................... 167
logaddexp2......................................................................................................................................................... 167
Other special functions ........................................................................................................................... 168
i0 ........................................................................................................................................................................ 168
sinc..................................................................................................................................................................... 170
Floating point routines ............................................................................................................................ 171
signbit................................................................................................................................................................. 171
copysign ............................................................................................................................................................. 172
frexp ................................................................................................................................................................... 173
ldexp .................................................................................................................................................................. 173
Arithmetic operations ............................................................................................................................. 173
add ..................................................................................................................................................................... 173
reciprocal............................................................................................................................................................ 174
negative.............................................................................................................................................................. 174
multiply ............................................................................................................................................................... 175
divide.................................................................................................................................................................. 176
power ................................................................................................................................................................. 177
subtract .............................................................................................................................................................. 178
true_divide.......................................................................................................................................................... 179
floor_divide ......................................................................................................................................................... 180
fmod ................................................................................................................................................................... 181
mod .................................................................................................................................................................... 182
modf ................................................................................................................................................................... 183
remainder ........................................................................................................................................................... 183
Handling complex numbers.................................................................................................................... 184
angle .................................................................................................................................................................. 184
real ..................................................................................................................................................................... 185
imag.................................................................................................................................................................... 185
conj ..................................................................................................................................................................... 186
Miscellaneous ........................................................................................................................................ 187
convolve ............................................................................................................................................................. 187
clip ...................................................................................................................................................................... 189
sqrt ..................................................................................................................................................................... 190
square ................................................................................................................................................................ 191
absolute .............................................................................................................................................................. 191
abs...................................................................................................................................................................... 192
fabs..................................................................................................................................................................... 193
sign ..................................................................................................................................................................... 194
maximum ............................................................................................................................................................ 194
max..................................................................................................................................................................... 195
minimum ............................................................................................................................................................. 197
min...................................................................................................................................................................... 198
nan_to_num........................................................................................................................................................ 199
real_if_close ....................................................................................................................................................... 200
interp .................................................................................................................................................................. 201
Trigonometric functions
sin
sin(x[, out])
Parameters
x : array_like
Angle, in radians (:math:`2 \pi` rad equals 360 degrees).
Returns
y : array_like
The sine of each element of x.
See Also
Examples
>>> np.sin(np.pi/2.)
1.0
cos
cos(x[, out])
Cosine elementwise.
Parameters
x : array_like
Input array in radians.
out : ndarray, optional
Output array of same shape as `x`.
Returns
y : ndarray
The corresponding cosine values.
Raises
Notes
References
Examples
tan
tan(x[, out])
Parameters
x : array_like
Input array.
out : ndarray, optional
Output array of same shape as `x`.
Returns
y : ndarray
The corresponding tangent values.
Raises
Notes
References
Examples
arcsin
arcsin(x[, out])
Parameters
x : array_like
`y`-coordinate on the unit circle.
Returns
angle : ndarray
The inverse sine of each element in `x`, in radians and in the
closed interval ``[-pi/2, pi/2]``. If `x` is a scalar, a scalar
is returned, otherwise an array.
See Also
Notes
For real-valued input data types, *arcsin* always returns real output.
For each value that cannot be expressed as a real number or infinity,
it yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
arccos
arccos(x[, out])
Parameters
x : array_like
`x`-coordinate on the unit circle.
For real arguments, the domain is [-1, 1].
Returns
angle : ndarray
The angle of the ray intersecting the unit circle at the given
`x`-coordinate in radians [0, pi]. If `x` is a scalar then a
scalar is returned, otherwise an array of the same shape as `x`
is returned.
See Also
Notes
For real-valued input data types, `arccos` always returns real output.
For each value that cannot be expressed as a real number or infinity,
it yields ``nan`` and sets the `invalid` floating point error flag.
For complex-valued input, `arccos` is a complex analytic function that
has branch cuts `[-inf, -1]` and `[1, inf]` and is continuous from
above on the former and from below on the latter.
References
Examples
Plot arccos:
arctan
arctan(x[, out])
Parameters
x : array_like
Input values. `arctan` is applied to each element of `x`.
Returns
out : ndarray
Out has the same shape as `x`. Its real part is in
``[-pi/2, pi/2]`` (``arctan(+/-inf)`` returns ``+/-pi/2``).
It is a scalar if `x` is a scalar.
See Also
arctan2 : The "four quadrant" arctan of the angle formed by (`x`, `y`)
and the positive `x`-axis.
angle : Argument of complex values.
Notes
For real-valued input data types, `arctan` always returns real output.
For each value that cannot be expressed as a real number or infinity,
it yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
>>> np.pi/4
0.78539816339744828
Plot arctan:
Parameters
x1, x2 : array_like
Leg of the triangle(s).
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
z : ndarray
The hypotenuse of the triangle(s).
Examples
arctan2
arctan2(x1, x2[, out])
Parameters
x1 : array_like, real-valued
`y`-coordinates.
x2 : array_like, real-valued
`x`-coordinates. `x2` must be broadcastable to match the shape of
`x1` or vice versa.
Returns
angle : ndarray
Array of angles in radians, in the range ``[-pi, pi]``.
See Also
Notes
Note that +0 and -0 are distinct floating point numbers, as are +inf
and -inf.
References
.. [1] ISO/IEC standard 9899:1999, "Programming language C."
Examples
Note the order of the parameters. `arctan2` is defined also when `x2` = 0
and at several other special points, obtaining values in
the range ``[-pi, pi]``:
degrees
degrees(x[, out])
Parameters
x : array_like
Input array in radians.
out : ndarray, optional
Output array of same shape as x.
Returns
y : ndarray of floats
The corresponding degree values; if `out` was supplied this is a
reference to it.
See Also
Examples
Parameters
x : array_like
Input array in degrees.
out : ndarray, optional
Output array of same shape as `x`.
Returns
y : ndarray
The corresponding radian values.
See Also
Examples
Parameters
p : array_like
Input array.
discont : float, optional
Maximum discontinuity between values, default is ``pi``.
axis : int, optional
Axis along which unwrap will operate, default is the last axis.
Returns
out : ndarray
Output array.
See Also
rad2deg, deg2rad
Notes
Examples
deg2rad
deg2rad(x[, out])
x : array_like
Angles in degrees.
Returns
y : ndarray
The corresponding angle in radians.
See Also
Notes
.. versionadded:: 1.3.0
Examples
>>> np.deg2rad(180)
3.1415926535897931
rad2deg
rad2deg(x[, out])
Parameters
x : array_like
Angle in radians.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
y : ndarray
The corresponding angle in degrees.
See Also
deg2rad : Convert angles from degrees to radians.
unwrap : Remove large jumps in angle by wrapping.
Notes
.. versionadded:: 1.3.0
Examples
>>> np.rad2deg(np.pi/2)
90.0
Hyperbolic functions
sinh
sinh(x[, out])
Parameters
x : array_like
Input array.
out : ndarray, optional
Output array of same shape as `x`.
Returns
y : ndarray
The corresponding hyperbolic sine values.
Raises
Notes
If `out` is provided, the function writes the result into it,
and returns a reference to `out`. (See Examples)
References
Examples
>>> np.sinh(0)
0.0
>>> np.sinh(np.pi*1j/2)
1j
>>> np.sinh(np.pi*1j) # (exact value is 0)
1.2246063538223773e-016j
>>> # Discrepancy due to vagaries of floating point arithmetic.
cosh
cosh(x[, out])
Parameters
x : array_like
Input array.
Returns
out : ndarray
Output array of same shape as `x`.
Examples
>>> np.cosh(0)
1.0
tanh
tanh(x[, out])
Equivalent to ``np.sinh(x)/np.cosh(x)`` or
``-1j * np.tan(1j*x)``.
Parameters
x : array_like
Input array.
out : ndarray, optional
Output array of same shape as `x`.
Returns
y : ndarray
The corresponding hyperbolic tangent values.
Raises
Notes
References
Examples
arcsinh
arcsinh(x[, out])
Parameters
x : array_like
Input array.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See `doc.ufuncs`.
Returns
out : ndarray
Array of of the same shape as `x`.
Notes
References
Examples
arccosh
arccosh(x[, out])
Parameters
x : array_like
Input array.
out : ndarray, optional
Array of the same shape as `x`, to store results in.
See `doc.ufuncs` (Section "Output arguments") for details.
Returns
y : ndarray
Array of the same shape as `x`.
See Also
For real-valued input data types, `arccosh` always returns real output.
For each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
arctanh
arctanh(x[, out])
Parameters
x : array_like
Input array.
Returns
out : ndarray
Array of the same shape as `x`.
See Also
emath.arctanh
many numbers `z` such that `tanh(z) = x`. The convention is to return the
`z` whose imaginary part lies in `[-pi/2, pi/2]`.
For real-valued input data types, `arctanh` always returns real output.
For each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
Rounding
around
Parameters
a : array_like
Input data.
decimals : int, optional
Number of decimal places to round to (default: 0). If
decimals is negative, it specifies the number of positions to
the left of the decimal point.
out : ndarray, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output, but the type of the output
values will be cast if necessary. See `doc.ufuncs` (Section
"Output arguments") for details.
Returns
rounded_array : ndarray
An array of the same type as `a`, containing the rounded values.
Unless `out` was specified, a new array is created. A reference to
the result is returned.
See Also
Notes
References
Examples
See Also
rint
rint(x[, out])
Parameters
x : array_like
Input array.
Returns
See Also
Examples
fix
Parameters
x : array_like
An array of floats to be rounded
y : ndarray, optional
Output array
Returns
See Also
Examples
>>> np.fix(3.14)
3.0
>>> np.fix(3)
3.0
>>> np.fix([2.1, 2.9, -2.1, -2.9])
array([ 2., 2., -2., -2.])
floor
floor(x[, out])
The floor of the scalar `x` is the largest integer `i`, such that
`i <= x`. It is often denoted as :math:`\lfloor x \rfloor`.
Parameters
x : array_like
Input data.
Returns
y : {ndarray, scalar}
The floor of each element in `x`.
Notes
Examples
ceil
ceil(x[, out])
The ceil of the scalar `x` is the smallest integer `i`, such that
`i >= x`. It is often denoted as :math:`\lceil x \rceil`.
Parameters
x : array_like
Input data.
Returns
y : {ndarray, scalar}
The ceiling of each element in `x`, with `float` dtype.
See Also
Examples
The truncated value of the scalar `x` is the nearest integer `i` which
is closer to zero than `x` is. In short, the fractional part of the
signed number `x` is discarded.
Parameters
x : array_like
Input data.
Returns
y : {ndarray, scalar}
The truncated value of each element in `x`.
See Also
Notes
.. versionadded:: 1.3.0
Examples
prod
Parameters
a : array_like
Input data.
axis : int, optional
Axis over which the product is taken. By default, the product
of all elements is calculated.
dtype : data-type, optional
The data-type of the returned array, as well as of the accumulator
in which the elements are multiplied. By default, if `a` is of
integer type, `dtype` is the default platform integer. (Note: if
the type of `a` is unsigned, then so is `dtype`.) Otherwise,
the dtype is the same as that of `a`.
out : ndarray, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output, but the type of the
output values will be cast if necessary.
Returns
See Also
Notes
Examples
>>> np.prod([1.,2.])
2.0
>>> np.prod([[1.,2.],[3.,4.]])
24.0
sum
Parameters
a : array_like
Elements to sum.
axis : integer, optional
Axis over which the sum is taken. By default `axis` is None,
and all elements are summed.
dtype : dtype, optional
The type of the returned array and of the accumulator in which
the elements are summed. By default, the dtype of `a` is used.
An exception is when `a` has an integer type with less precision
than the default platform integer. In that case, the default
platform integer is used instead.
out : ndarray, optional
Array into which the output is placed. By default, a new array is
created. If `out` is given, it must be of the appropriate shape
(the shape of `a` with `axis` removed, i.e.,
``numpy.delete(a.shape, axis)``). Its type is preserved. See
`doc.ufuncs` (Section "Output arguments") for more details.
Returns
sum_along_axis : ndarray
An array with the same shape as `a`, with the specified
axis removed. If `a` is a 0-d array, or if `axis` is None, a scalar
is returned. If an output array is specified, a reference to
`out` is returned.
See Also
mean, average
Notes
Examples
nansum
Parameters
a : array_like
Array containing numbers whose sum is desired. If `a` is not an
array, a conversion is attempted.
axis : int, optional
Axis along which the sum is computed. The default is to compute
the sum of the flattened array.
Returns
y : ndarray
An array with the same shape as a, with the specified axis removed.
If a is a 0-d array, or if axis is None, a scalar is returned with
the same dtype as `a`.
See Also
Notes
Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
If positive or negative infinity are present the result is positive or
negative infinity. But if both positive and negative infinity are present,
the result is Not A Number (NaN).
Arithmetic is modular when using integer types (all elements of `a` must
be finite i.e. no elements that are NaNs, positive infinity and negative
infinity because NaNs are floating point types), and no error is raised
on overflow.
Examples
>>> np.nansum(1)
1
>>> np.nansum([1])
1
>>> np.nansum([1, np.nan])
1.0
>>> a = np.array([[1, 1], [1, np.nan]])
>>> np.nansum(a)
3.0
>>> np.nansum(a, axis=0)
array([ 2., 1.])
cumprod
Parameters
a : array_like
Input array.
axis : int, optional
Axis along which the cumulative product is computed. By default
the input is flattened.
dtype : dtype, optional
Type of the returned array, as well as of the accumulator in which
the elements are multiplied. If *dtype* is not specified, it
defaults to the dtype of `a`, unless `a` has an integer dtype with
a precision less than that of the default platform integer. In
that case, the default platform integer is used instead.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type of the resulting values will be cast if necessary.
Returns
cumprod : ndarray
A new array holding the result is returned unless `out` is
specified, in which case a reference to out is returned.
See Also
Notes
Examples
>>> a = np.array([1,2,3])
>>> np.cumprod(a) # intermediate results 1, 1*2
... # total product 1*2*3 = 6
array([1, 2, 6])
>>> a = np.array([[1, 2, 3], [4, 5, 6]])
>>> np.cumprod(a, dtype=float) # specify type of output
array([ 1., 2., 6., 24., 120., 720.])
The cumulative product for each column (i.e., over the rows) of `a`:
The cumulative product for each row (i.e. over the columns) of `a`:
>>> np.cumprod(a,axis=1)
array([[ 1, 2, 6],
[ 4, 20, 120]])
cumsum
Parameters
a : array_like
Input array.
axis : int, optional
Axis along which the cumulative sum is computed. The default
(None) is to compute the cumsum over the flattened array.
dtype : dtype, optional
Type of the returned array and of the accumulator in which the
elements are summed. If `dtype` is not specified, it defaults
to the dtype of `a`, unless `a` has an integer dtype with a
precision less than that of the default platform integer. In
that case, the default platform integer is used.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type will be cast if necessary. See `doc.ufuncs`
(Section "Output arguments") for more details.
Returns
See Also
Notes
Examples
diff
Parameters
a : array_like
Input array
n : int, optional
The number of times values are differenced.
axis : int, optional
The axis along which the difference is taken, default is the last axis.
Returns
out : ndarray
The `n` order differences. The shape of the output is the same as `a`
except along `axis` where the dimension is smaller by `n`.
See Also
gradient, ediff1d
Examples
ediff1d
Parameters
ary : array_like
If necessary, will be flattened before the differences are taken.
to_end : array_like, optional
Number(s) to append at the end of the returned differences.
to_begin : array_like, optional
Number(s) to prepend at the beginning of the returned differences.
Returns
diff, gradient
Notes
When applied to masked arrays, this function drops the mask information
if the `to_begin` and/or `to_end` parameters are used.
Examples
gradient
Parameters
f : array_like
An N-dimensional array containing samples of a scalar function.
`*varargs` : scalars
0, 1, or N scalars specifying the sample distances in each direction,
that is: `dx`, `dy`, `dz`, ... The default distance is 1.
Returns
g : ndarray
N arrays of the same shape as `f` giving the derivative of `f` with
respect to each dimension.
Examples
cross
Parameters
a : array_like
Components of the first vector(s).
b : array_like
Components of the second vector(s).
axisa : int, optional
Axis of `a` that defines the vector(s). By default, the last axis.
axisb : int, optional
Axis of `b` that defines the vector(s). By default, the last axis.
axisc : int, optional
Axis of `c` containing the cross product vector(s). By default, the
last axis.
axis : int, optional
If defined, the axis of `a`, `b` and `c` that defines the vector(s)
and cross product(s). Overrides `axisa`, `axisb` and `axisc`.
Returns
c : ndarray
Vector cross product(s).
Raises
ValueError
When the dimension of the vector(s) in `a` and/or `b` does not
equal 2 or 3.
See Also
Examples
Vector cross-product.
>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> np.cross(x, y)
array([-3, 6, -3])
>>> x = [1, 2]
>>> y = [4, 5, 6]
>>> np.cross(x, y)
array([12, -6, -3])
Equivalently:
>>> x = [1, 2, 0]
>>> y = [4, 5, 6]
>>> np.cross(x, y)
array([12, -6, -3])
>>> x = [1,2]
>>> y = [4,5]
>>> np.cross(x, y)
-3
Change the vector definition of `x` and `y` using `axisa` and `axisb`.
trapz
Integrate along the given axis using the composite trapezoidal rule.
Parameters
y : array_like
Input array to integrate.
x : array_like, optional
If `x` is None, then spacing between all `y` elements is `dx`.
dx : scalar, optional
If `x` is None, spacing given by `dx` is assumed. Default is 1.
axis : int, optional
Specify the axis.
Returns
out : float
Definite integral as approximated by trapezoidal rule.
See Also
sum, cumsum
Notes
References
Examples
>>> np.trapz([1,2,3])
4.0
>>> np.trapz([1,2,3], x=[4,6,8])
8.0
>>> np.trapz([1,2,3], dx=2)
8.0
>>> a = np.arange(6).reshape(2, 3)
>>> a
array([[0, 1, 2],
[3, 4, 5]])
>>> np.trapz(a, axis=0)
array([ 1.5, 2.5, 3.5])
>>> np.trapz(a, axis=1)
array([ 2., 8.])
Exponents and logarithms
exp
exp(x[, out])
Parameters
x : array_like
Input values.
Returns
out : ndarray
Output array, element-wise exponential of `x`.
See Also
Notes
References
Examples
>>> plt.subplot(121)
>>> plt.imshow(np.abs(out),
... extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi])
>>> plt.title('Magnitude of exp(x)')
>>> plt.subplot(122)
>>> plt.imshow(np.angle(out),
... extent=[-2*np.pi, 2*np.pi, -2*np.pi, 2*np.pi])
>>> plt.title('Phase (angle) of exp(x)')
>>> plt.show()
expm1
expm1(x[, out])
Parameters
x : array_like
Input values.
Returns
out : ndarray
Element-wise exponential minus one: ``out = exp(x) - 1``.
See Also
Notes
This function provides greater precision than the formula ``exp(x) - 1``
for small values of ``x``.
Examples
>>> np.expm1(1e-10)
1.00000000005e-10
>>> np.exp(1e-10) - 1
1.000000082740371e-10
exp2
exp2(x[, out])
Parameters
x : array_like
Input values.
Returns
out : ndarray
Element-wise 2 to the power `x`.
See Also
Notes
.. versionadded:: 1.3.0
Examples
log
log(x[, out])
Parameters
x : array_like
Input value.
Returns
y : ndarray
The natural logarithm of `x`, element-wise.
See Also
Notes
For real-valued input data types, `log` always returns real output. For
each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
log10
log10(x[, out])
x : array_like
Input values.
Returns
y : ndarray
The logarithm to the base 10 of `x`, element-wise. NaNs are
returned where x is negative.
See Also
emath.log10
Notes
For real-valued input data types, `log10` always returns real output. For
each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
log2
log2(x[, out])
x : array_like
Input values.
Returns
y : ndarray
Base-2 logarithm of `x`.
See Also
Notes
.. versionadded:: 1.3.0
For real-valued input data types, `log2` always returns real output. For
each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
Examples
log1p
log1p(x[, out])
Return the natural logarithm of one plus the input array, element-wise.
Input values.
Returns
y : ndarray
Natural logarithm of `1 + x`, element-wise.
See Also
Notes
For real-valued input data types, `log1p` always returns real output. For
each value that cannot be expressed as a real number or infinity, it
yields ``nan`` and sets the `invalid` floating point error flag.
References
Examples
>>> np.log1p(1e-99)
1e-99
>>> np.log(1 + 1e-99)
0.0
logaddexp
logaddexp(x1, x2[, out])
Parameters
x1, x2 : array_like
Input values.
Returns
result : ndarray
Logarithm of ``exp(x1) + exp(x2)``.
See Also
Notes
.. versionadded:: 1.3.0
Examples
logaddexp2
logaddexp2(x1, x2[, out])
Returns
result : ndarray
Base-2 logarithm of ``2**x1 + 2**x2``.
See Also
Notes
.. versionadded:: 1.3.0
Examples
i0
Usually denoted :math:`I_0`. This function does broadcast, but will *not*
"up-cast" int dtype arguments unless accompanied by at least one float or
complex dtype argument (see Raises below).
Parameters
Returns
Raises
See Also
scipy.special.iv, scipy.special.ive
Notes
References
Examples
>>> np.i0([0.])
array(1.0)
>>> np.i0([0., 1. + 2j])
array([ 1.00000000+0.j , 0.18785373+0.64616944j])
sinc
Parameters
x : ndarray
Array (possibly multi-dimensional) of values for which to to
calculate ``sinc(x)``.
Returns
out : ndarray
``sinc(x)``, which has the same shape as the input.
Notes
References
Examples
>>> plt.ylabel("Amplitude")
>>> plt.xlabel("X")
>>> plt.show()
signbit
signbit(x[, out])
Parameters
x: array_like
The input value(s).
out : ndarray, optional
Array into which the output is placed. Its type is preserved
and it must be of the right shape to hold the output.
See `doc.ufuncs`.
Returns
Examples
>>> np.signbit(-1.2)
True
>>> np.signbit(np.array([1, -2.3, 2.1]))
array([False, True, False], dtype=bool)
copysign
copysign(x1, x2[, out])
Parameters
x1: array_like
Values to change the sign of.
x2: array_like
The sign of `x2` is copied to `x1`.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
out : array_like
The values of `x1` with the sign of `x2`.
Examples
Split the number, x, into a normalized fraction (y1) and exponent (y2)
ldexp
ldexp(x1, x2[, out])
Compute y = x1 * 2**x2.
Arithmetic operations
add
add(x1, x2[, out])
Parameters
x1, x2 : array_like
The arrays to be added. If ``x1.shape != x2.shape``, they must be
broadcastable to a common shape (which may be the shape of one or
the other).
Returns
y : ndarray or scalar
The sum of `x1` and `x2`, element-wise. Returns a scalar if
both `x1` and `x2` are scalars.
Notes
Examples
Calculates ``1/x``.
Parameters
x : array_like
Input array.
Returns
y : ndarray
Return array.
Notes
.. note::
This function is not designed to work with integers.
For integer arguments with absolute value larger than 1 the result is
always zero because of the way Python handles integer division.
For integer zero the result is an overflow.
Examples
>>> np.reciprocal(2.)
0.5
>>> np.reciprocal([1, 2., 3.33])
array([ 1. , 0.5 , 0.3003003])
negative
negative(x[, out])
Returns an array with the negative of each element of the original array.
Input array.
Returns
y : ndarray or scalar
Returned array or scalar: `y = -x`.
Examples
>>> np.negative([1.,-1.])
array([-1., 1.])
multiply
multiply(x1, x2[, out])
Parameters
x1, x2 : array_like
Input arrays to be multiplied.
Returns
y : ndarray
The product of `x1` and `x2`, element-wise. Returns a scalar if
both `x1` and `x2` are scalars.
Notes
Examples
divide
divide(x1, x2[, out])
Parameters
x1 : array_like
Dividend array.
x2 : array_like
Divisor array.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
y : {ndarray, scalar}
The quotient `x1/x2`, element-wise. Returns a scalar if
both `x1` and `x2` are scalars.
See Also
Notes
When both `x1` and `x2` are of an integer type, `divide` will return
integers and throw away the fractional part. Moreover, division by zero
always yields zero in integer arithmetic.
Examples
>>> np.divide(2, 4)
0
>>> np.divide(2, 4.)
0.5
Division by zero always yields zero in integer arithmetic, and does not
raise an exception or a warning:
power
power(x1, x2[, out])
Parameters
x1 : array_like
The bases.
x2 : array_like
The exponents.
Returns
y : ndarray
The bases in `x1` raised to the exponents in `x2`.
Examples
>>> x1 = range(6)
>>> x1
[0, 1, 2, 3, 4, 5]
>>> np.power(x1, 3)
array([ 0, 1, 8, 27, 64, 125])
subtract
subtract(x1, x2[, out])
Parameters
x1, x2 : array_like
The arrays to be subtracted from each other.
Returns
y : ndarray
The difference of `x1` and `x2`, element-wise. Returns a scalar if
both `x1` and `x2` are scalars.
Notes
Examples
true_divide
true_divide(x1, x2[, out])
Parameters
x1 : array_like
Dividend array.
x2 : array_like
Divisor array.
Returns
out : ndarray
Result is scalar if both inputs are scalar, ndarray otherwise.
Notes
The floor division operator ``//`` was added in Python 2.2 making ``//``
and ``/`` equivalent operators. The default floor division operation of
``/`` can be replaced by true division with
``from future import division``.
In Python 3.0, ``//`` is the floor division operator and ``/`` the
true division operator. The ``true_divide(x1, x2)`` function is
equivalent to true division in Python.
Examples
>>> x = np.arange(5)
>>> np.true_divide(x, 4)
array([ 0. , 0.25, 0.5 , 0.75, 1. ])
>>> x/4
array([0, 0, 0, 0, 1])
>>> x//4
array([0, 0, 0, 0, 1])
floor_divide
floor_divide(x1, x2[, out])
Return the largest integer smaller or equal to the division of the inputs.
Parameters
x1 : array_like
Numerator.
x2 : array_like
Denominator.
Returns
y : ndarray
y = floor(`x1`/`x2`)
See Also
Examples
>>> np.floor_divide(7,3)
2
fmod
fmod(x1, x2[, out])
Parameters
x1 : array_like
Dividend.
x2 : array_like
Divisor.
Returns
y : array_like
The remainder of the division of `x1` by `x2`.
See Also
Notes
The result of the modulo operation for negative dividend and divisors is
bound by conventions. In `fmod`, the sign of the remainder is the sign of
the dividend. In `remainder`, the sign of the divisor does not affect the
sign of the result.
Examples
Parameters
x1 : array_like
Dividend array.
x2 : array_like
Divisor array.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
y : ndarray
The remainder of the quotient ``x1/x2``, element-wise. Returns a scalar
if both `x1` and `x2` are scalars.
See Also
divide, floor
Notes
Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of) integers.
Examples
The fractional and integral parts are negative if the given number is
negative.
Parameters
x : array_like
Input array.
Returns
y1 : ndarray
Fractional part of `x`.
y2 : ndarray
Integral part of `x`.
Notes
Examples
remainder
remainder(x1, x2[, out])
Parameters
x1 : array_like
Dividend array.
x2 : array_like
Divisor array.
out : ndarray, optional
if both `x1` and `x2` are scalars.
See Also
divide, floor
Notes
Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of) integers.
Examples
angle
Parameters
z : array_like
A complex number or sequence of complex numbers.
deg : bool, optional
Return angle in degrees if True, radians if False (default).
Returns
See Also
arctan2
absolute
Examples
real
Parameters
val : array_like
Input array.
Returns
out : ndarray
Output array. If `val` is real, the type of `val` is used for the
output. If `val` has complex elements, the returned type is float.
See Also
Examples
imag
Returns
out : ndarray
Output array. If `val` is real, the type of `val` is used for the
output. If `val` has complex elements, the returned type is float.
See Also
Examples
conj
conjugate(x[, out])
Parameters
x : array_like
Input value.
Returns
y : ndarray
The complex conjugate of `x`, with same dtype as `y`.
Examples
>>> x = np.eye(2) + 1j * np.eye(2)
>>> np.conjugate(x)
array([[ 1.-1.j, 0.-0.j],
[ 0.-0.j, 1.-1.j]])
Miscellaneous
convolve
Parameters
a : (N,) array_like
First one-dimensional input array.
v : (M,) array_like
Second one-dimensional input array.
mode : {'full', 'valid', 'same'}, optional
'full':
By default, mode is 'full'. This returns the convolution
at each point of overlap, with an output shape of (N+M-1,). At
the end-points of the convolution, the signals do not overlap
completely, and boundary effects may be seen.
'same':
Mode `same` returns output of length ``max(M, N)``. Boundary
effects are still visible.
'valid':
Mode `valid` returns output of length
``max(M, N) - min(M, N) + 1``. The convolution product is only given
for points where the signals overlap completely. Values outside
the signal boundary have no effect.
Returns
out : ndarray
Discrete, linear convolution of `a` and `v`.
See Also
Notes
References
Examples
Parameters
a : array_like
Array containing elements to clip.
a_min : scalar or array_like
Minimum value.
a_max : scalar or array_like
Maximum value. If `a_min` or `a_max` are array_like, then they will
be broadcasted to the shape of `a`.
out : ndarray, optional
The results will be placed in this array. It may be the input
array for in-place clipping. `out` must be of the right shape
to hold the output. Its type is preserved.
Returns
clipped_array : ndarray
An array with the elements of `a`, but where values
< `a_min` are replaced with `a_min`, and those > `a_max`
with `a_max`.
See Also
Examples
>>> a = np.arange(10)
>>> np.clip(a, 1, 8)
array([1, 1, 2, 3, 4, 5, 6, 7, 8, 8])
>>> a
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> np.clip(a, 3, 6, out=a)
array([3, 3, 3, 3, 4, 5, 6, 6, 6, 6])
>>> a = np.arange(10)
>>> a
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> np.clip(a, [3,4,1,1,1,4,4,4,4,4], 8)
array([3, 4, 2, 3, 4, 5, 6, 7, 8, 8])
sqrt
sqrt(x[, out])
Parameters
x : array_like
The values whose square-roots are required.
out : ndarray, optional
Alternate array object in which to put the result; if provided, it
must have the same shape as `x`
Returns
y : ndarray
An array of the same shape as `x`, containing the positive
square-root of each element in `x`. If any element in `x` is
complex, a complex array is returned (and the square-roots of
negative reals are calculated). If all of the elements in `x`
are real, so is `y`, with negative elements returning ``nan``.
If `out` was provided, `y` is a reference to it.
See Also
lib.scimath.sqrt
A version which returns complex numbers when given negative reals.
Notes
Examples
>>> np.sqrt([1,4,9])
array([ 1., 2., 3.])
>>> np.sqrt([4, -1, -3+4J])
array([ 2.+0.j, 0.+1.j, 1.+2.j])
square
square(x[, out])
Parameters
x : array_like
Input data.
Returns
out : ndarray
Element-wise `x*x`, of the same shape and dtype as `x`.
Returns scalar if `x` is a scalar.
See Also
numpy.linalg.matrix_power
sqrt
power
Examples
absolute
absolute(x[, out])
Parameters
x : array_like
Input array.
Returns
absolute : ndarray
An ndarray containing the absolute value of
each element in `x`. For complex input, ``a + ib``, the
absolute value is :math:`\sqrt{ a^2 + b^2 }`.
Examples
abs
absolute(x[, out])
Parameters
x : array_like
Input array.
Returns
absolute : ndarray
An ndarray containing the absolute value of
each element in `x`. For complex input, ``a + ib``, the
absolute value is :math:`\sqrt{ a^2 + b^2 }`.
Examples
>>> x = np.array([-1.2, 1.2])
>>> np.absolute(x)
array([ 1.2, 1.2])
>>> np.absolute(1.2 + 1j)
1.5620499351813308
fabs
fabs(x[, out])
This function returns the absolute values (positive magnitude) of the data
in `x`. Complex values are not handled, use `absolute` to find the
absolute values of complex data.
Parameters
x : array_like
The array of numbers for which the absolute values are required. If
`x` is a scalar, the result `y` will also be a scalar.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
Returns
y : {ndarray, scalar}
The absolute values of `x`, the returned values are always floats.
See Also
Parameters
x : array_like
Input values.
Returns
y : ndarray
The sign of `x`.
Examples
maximum
maximum(x1, x2[, out])
Returns
y : {ndarray, scalar}
The maximum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.
See Also
minimum :
element-wise minimum
fmax :
element-wise maximum that ignores nans unless both inputs are nans.
fmin :
element-wise minimum that ignores nans unless both inputs are nans.
Notes
Equivalent to ``np.where(x1 > x2, x1, x2)`` but faster and does proper
broadcasting.
Examples
max
Returns
See Also
Notes
NaN values are propagated, that is if at least one item is NaN, the
corresponding max value will be NaN as well. To ignore NaN values
(MATLAB behavior), please use nanmax.
Examples
>>> a = np.arange(4).reshape((2,2))
>>> a
array([[0, 1],
[2, 3]])
>>> np.amax(a)
3
>>> np.amax(a, axis=0)
array([2, 3])
>>> np.amax(a, axis=1)
array([1, 3])
minimum
minimum(x1, x2[, out])
Compare two arrays and returns a new array containing the element-wise
minima. If one of the elements being compared is a nan, then that element
is returned. If both elements are nans then the first is returned. The
latter distinction is important for complex nans, which are defined as at
least one of the real or imaginary parts being a nan. The net effect is
that nans are propagated.
Parameters
x1, x2 : array_like
The arrays holding the elements to be compared. They must have
the same shape, or shapes that can be broadcast to a single shape.
Returns
y : {ndarray, scalar}
The minimum of `x1` and `x2`, element-wise. Returns scalar if
both `x1` and `x2` are scalars.
See Also
maximum :
element-wise minimum that propagates nans.
fmax :
element-wise maximum that ignores nans unless both inputs are nans.
fmin :
element-wise minimum that ignores nans unless both inputs are nans.
Notes
The minimum is equivalent to ``np.where(x1 <= x2, x1, x2)`` when neither
x1 nor x2 are nans, but it is faster and does proper broadcasting.
Examples
Parameters
a : array_like
Input data.
axis : int, optional
Axis along which to operate. By default a flattened input is used.
out : ndarray, optional
Alternative output array in which to place the result. Must
be of the same shape and buffer length as the expected output.
See `doc.ufuncs` (Section "Output arguments") for more details.
Returns
amin : ndarray
A new array or a scalar array with the result.
See Also
Notes
NaN values are propagated, that is if at least one item is nan, the
corresponding min value will be nan as well. To ignore NaN values (matlab
behavior), please use nanmin.
Examples
>>> a = np.arange(4).reshape((2,2))
>>> a
array([[0, 1],
[2, 3]])
>>> np.amin(a) # Minimum of the flattened array
0
>>> np.amin(a, axis=0) # Minima along the first axis
array([0, 1])
>>> np.amin(a, axis=1) # Minima along the second axis
array([0, 2])
nan_to_num
Parameters
x : array_like
Input data.
Returns
See Also
Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
Examples
>>> np.set_printoptions(precision=8)
>>> x = np.array([np.inf, -np.inf, np.nan, -128, 128])
>>> np.nan_to_num(x)
array([ 1.79769313e+308, -1.79769313e+308, 0.00000000e+000,
-1.28000000e+002, 1.28000000e+002])
real_if_close
If complex input returns a real array if complex parts are close to zero.
Parameters
a : array_like
Input array.
tol : float
Tolerance in machine epsilons for the complex part of the elements
in the array.
Returns
out : ndarray
If `a` is real, the type of `a` is used for the output. If `a`
has complex elements, the returned type is float.
See Also
Notes
Machine epsilon varies from machine to machine and between data types
but Python floats on most platforms have a machine epsilon equal to
2.2204460492503131e-16. You can use 'np.finfo(np.float).eps' to print
out the machine epsilon for floats.
Examples
>>> np.finfo(np.float).eps
2.2204460492503131e-16
interp
Parameters
x : array_like
The x-coordinates of the interpolated values.
Returns
y : {float, ndarray}
The interpolated values, same shape as `x`.
Raises
ValueError
If `xp` and `fp` have different length
Notes
Does not check that the x-coordinate sequence `xp` is increasing.
If `xp` is not increasing, the results are nonsense.
A simple check for increasingness is::
np.all(np.diff(xp) > 0)
Examples
>>> xp = [1, 2, 3]
>>> fp = [3, 2, 0]
>>> np.interp(2.5, xp, fp)
1.0
>>> np.interp([0, 1, 1.5, 2.72, 3.14], xp, fp)
array([ 3. , 3. , 2.5 , 0.56, 0. ])
>>> UNDEF = -99.0
>>> np.interp(3.14, xp, fp, right=UNDEF)
-99.0
Figure 61: Variables entered into the Input tab of the Expressions/Variables panel
Step 3: Use Example Input Variables
Use the new input variables to specify the movements of the receiving conveyor that you have imported.
Specifically:
1. In the Data panel, choose the custom receiving conveyor that you have imported, and then from the
Data Editors panel, on the Custom Boundary tab, select the Movements tab, and then click the Edit
Movements List button.
2. From the Custom Movements dialog, create two separate Movements using the following variables.
Note: Be sure to specify Rotation and Translation Without Displacement for Movement Type. For
belts like this receiving belt, this setting ensures that the position of the component doesn’t change in
the simulation.
Figure 62: Custom Movements dialog, Movement 1 when variable names are entered (green)
Figure 63: Custom Movements dialog, Movement 1 after variables are replaced with values (black)
Figure 64: Custom Movements dialog, Movement 2 when variable names are entered (green)
Figure 65: Custom Movements dialog, Movement 2 after variables are replaced with values (black)
Figure 66: Expressions/Variables panel Expressions list after initial variable entry
Notice that the values used in the Custom Movements dialog have changed accordingly. (See Figure 68 and
Figure 69.)
Copyright © 2015, ESSS, GDI, and RDI. All Rights Reserved. Page 211