diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e77e58..f0dc291 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) include(GNUInstallDirs) -add_library(OndselSolver STATIC) +add_library(OndselSolver SHARED) set(ONDSELSOLVER_SRC OndselSolver/Array.cpp diff --git a/OndselSolver/CREATE.h b/OndselSolver/CREATE.h index 67bdf9a..099af9b 100644 --- a/OndselSolver/CREATE.h +++ b/OndselSolver/CREATE.h @@ -6,7 +6,7 @@ * See LICENSE file for details about copyright. * ***************************************************************************/ -//This header file causes wierd problems in Visual Studio when included in subclasses of std::vector or std::map. Why? +//This header file causes weird problems in Visual Studio when included in subclasses of std::vector or std::map. Why? #pragma once diff --git a/OndselSolver/FullRow.cpp b/OndselSolver/FullRow.cpp index 2716599..5e49af8 100644 --- a/OndselSolver/FullRow.cpp +++ b/OndselSolver/FullRow.cpp @@ -10,8 +10,8 @@ #include "FullMatrix.h" namespace MbD { - template - std::shared_ptr FullRow::transposeTimesFullRow(FRowsptr fullRow) + template<> + std::shared_ptr FullRow::transposeTimesFullRow(FRowsptr fullRow) { //"a*b = a(i)b(j)" auto nrow = (int)this->size(); diff --git a/OndselSolver/FullRow.h b/OndselSolver/FullRow.h index 8d9ecca..7dfe096 100644 --- a/OndselSolver/FullRow.h +++ b/OndselSolver/FullRow.h @@ -37,7 +37,7 @@ namespace MbD { void atiplusFullRow(int j, FRowsptr fullRow); std::ostream& printOn(std::ostream& s) const override; - std::shared_ptr transposeTimesFullRow(FRowsptr fullRow); + std::shared_ptr transposeTimesFullRow(FRowsptr fullRow); FRowsptr timesTransposeFullMatrix(std::shared_ptr fullMat); // FRowsptr> timesTransposeFullMatrixForFMFMDsptr(std::shared_ptr fullMat); FRowsptr timesFullMatrix(std::shared_ptr fullMat); diff --git a/OndselSolver/FullVector.h b/OndselSolver/FullVector.h index 53b3d4c..5a98b61 100644 --- a/OndselSolver/FullVector.h +++ b/OndselSolver/FullVector.h @@ -178,8 +178,9 @@ namespace MbD { template inline void FullVector::conditionSelfWithTol(double tol) { - assert(false); - return; + assert(false && tol != tol); // clang++ flips out with warnings if you don't use 'tol' + // but suppressing that warning breaks Visual Studio. + return; // Visual Studio demands the unused return } template inline std::ostream& FullVector::printOn(std::ostream& s) const diff --git a/OndselSolver/RedundantConstraint.cpp b/OndselSolver/RedundantConstraint.cpp index dd7c595..d1190d5 100644 --- a/OndselSolver/RedundantConstraint.cpp +++ b/OndselSolver/RedundantConstraint.cpp @@ -105,7 +105,7 @@ void RedundantConstraint::setqsuddotlam(FColDsptr col) void RedundantConstraint::discontinuityAtaddTypeTo(double t, std::shared_ptr> disconTypes) { - //"Reactivate all contraints." + //"Reactivate all constraints." assert(false); //| newSelf | //newSelf : = self constraint. diff --git a/OndselSolver/StableBackwardDifference.cpp b/OndselSolver/StableBackwardDifference.cpp index 09c07e3..89dc329 100644 --- a/OndselSolver/StableBackwardDifference.cpp +++ b/OndselSolver/StableBackwardDifference.cpp @@ -12,7 +12,7 @@ using namespace MbD; void StableBackwardDifference::formTaylorMatrix() { - //This form is numerically more stable and is prefered over the full Taylor Matrix. + //This form is numerically more stable and is preferred over the full Taylor Matrix. //For method order 3: //| (t1 - t) (t1 - t) ^ 2 / 2! (t1 - t) ^ 3 / 3!| |qd(t) | = | q(t1) - q(t) | //| (t2 - t) (t2 - t) ^ 2 / 2! (t2 - t) ^ 3 / 3!| |qdd(t) | |q(t2) - q(t) | diff --git a/testapp/circular.asmt b/testapp/circular.asmt index 3442374..55a9c51 100644 --- a/testapp/circular.asmt +++ b/testapp/circular.asmt @@ -1,7 +1,7 @@ freeCAD: 3D CAD with Motion Simulation by askoh.com Assembly Notes - (Text string: 'Copyright (C) 2000-2004, A-S Koh, All Rights Reserved.The Tree View is on the left.The Graphics View is on the right.The Selection View is at the bottom left.The XYZ axes are colored Red Green Blue (RGB). The default world axes are one meter long (about 40 inches).Units are SI units. Angles are in radians unless stated to be in degrees.A rectangular beam is connected to ground with a revolute (pin) joint which allows rotation in the XY plane. A motion is applied to the joint to rotate the beam with constant angular velocity. A similar beam is made to rotate in a plane parallel to the YZ plane. Units are SI units. Angles are in radians.To load the example for a quick look:Click/File/Open/Assembly/ to get a dialog. Enter *.asm for a list of assemblies. Select circular.asm. Click/OK. The projectiles should appear on the screen.Click /Edit/Marker Size/ to set a suitable length for the marker axes.Click ''Wireframe'' and ''Solid'' to switch between wireframe and rendered views.Click ''TiltRotate'' to show all. Drag on the handles to orientate the assembly in 3D. Tilt means tilting away from the line from the eye to the handle.Click ''ZoomIn'' and drag a rectangle over the region of interest to zoom in.Click ''Animation'' to get a dialog. Click Play to animate.Click ''TiltRotate'' to show all or ''ZoomOut'' to see more.You can use any of the View menu items during animation to change you view.Click Stop to stop the animation.To create the assembly from scratch:Click/File/New/Assembly/ to create an empty assembly. A dialog allows you to specify a unique name (Assembly1).To create the first beam:Click on (Assembly1) in the Tree View if it is not already selected.Click/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Part/New/ to insert a part on the selected plane. A dialog allows you to specify a unique name (Part1).Click/Insert/Sketch/ to insert a sketch on the new part. A dialog allows you to specify a unique name (Sketch1).Click/Draw/Rectangle/ to select the rectangle tool. In the drawing area, click and drag toward the positive quadrant (increasing x and y) to create a rectangle. Click inside the rectangle if three black handles are not visible, RightClick/Position/Angle/ to get a dialog to specify the rectangle position (0.0d, 0.0d), angle (0.0d) and size (2.0d, 0.2d) precisely.Click/Insert/Feature/Extrusion/ to extrude the drawing perpendicular to the sketch plane. A dialog allows you to specify the z coordinates for extrusion (0.0d, 0.1d).Click ''WireFrame'' to make mass marker visible. Click the mass marker, RightClick/Position/Direction/ to get a dialog to specify its mass and inertias precisely. Click/''Apply Uniform Density''. Enter the density (10.0d).To connect the beam to the assembly with a revolute (pin) joint:To mark the joint attachment point on the assembly:Drag the beam to the upper right to clear up the area near the origin.Select Assembly1 from the Tree View.Click/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin.To mark the joint attachment point on the beam:Click on the wide face of the beam to hightlight it.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the face origin. The marker is referenced to the face which becomes the marker''s guide frame.RightClick/Position/Direction/ over the marker to get a dialog to specify the exact placement of the marker on the part. Enter the coordinates of the marker origin relative to the guide frame. (0.1d, 0.1d, 0.0d). No need to change the other values.To create the joint:Click/Kinematic/Joint/RevoluteZ/ to select the revolute (pin) joint tool. Click on the assembly marker, drag to the part marker, and release the button. A dialog allows you to specify a unique name (Joint1). A rubber band connects the ''i'' and ''j'' markers with an label ''rev'' to denote the revolute joint. A revolute joint constraints the origins of ''i'' and ''j'' to be coincident and the z axes of ''i'' and ''j'' to be colinear. Only one rotational degree of freedom exists between ''i'' and ''j''.To apply a motion to the joint:Click/Kinematic/Motion/RotationZ/ to select the z rotation tool. Click on a revolute joint rubber band. A dialog allows you to specify a unique name (Motion1). A second dialog allows you to specify a function of time describing the angle of the ''j'' x-axis relative to the ''i'' x-axis. Enter 2.0d*pi*time. Click/OK. Another rubber band is superposed on the joint but the new label is ''rmo''. If you want to change the function, click the ''rmo'' label. The superposition of the rubber bands can make it difficult to select the desired item. This problem can be overcomed by selecting the desired item directly from the Tree View.You have just learned the basics of creating markers, connections and prescribed motions.To simulate:Click/Simulation/Transient/ to start a simulation. Click/''current state'' for the desired input state. In the next dialog, set the desired end time (1.0d) and output time step (0.01d) of the simulation. The other default parameters should be acceptable.Click/OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click/Simulation/Stop/ to terminate the simulation anytime.To animate:Click ''Animation'' for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click/Stop to stop the animation.To plot marker data:If a suitable marker is not available, insert a marker anywhere on the part. Click on the marker, RightClick/Plot/, a new plot window appears. Click/Plot/Select/ to get a dialog to specify the data for the x and y axes. Multiply select with shift-click or control-click for the y-axis. Click/OK to get the plots. You can export the plot data in tabular form: Click/Plot/Export/ to specify an output filename. The file can be imported into a spreadsheet for further analysis.To plot joint or motion data:Select a joint or motion from the Tree or Graphic Views. RightClick/Plot/ and follow the same procedure for marker data.To add the second beam:Since the second beam is the same as the first, we will reuse.Select \Assembly1\Part1 in the Tree View. Expand the tree as necessary to reach Part1.Click/File/Save As/Part to save the selected part to file. Enter a filename with .prt extension (Part1.prt).Select Assembly1 in the Tree ViewClick/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Part/File/ to insert a part from file. A dialog allows you to specify a unique name (Part2). Another dialog allows you to select the file Part1.prt. The second beam is inserted at the assembly origin.To connect the second beam to the assembly with a revolute (pin) joint:To mark the second joint attachment point on the assembly:Select Assembly1 in the Tree ViewClick/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker2). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin. Drag the handle to move the new marker away from the origin.Click on the marker if it does not have a black handle, RightClick/Position/Direction/ to get a dialog to specify the exact placement of the marker in the assembly. Enter the coordinates of the marker origin relative to the assembly (3.0d, 0.0d, 0.0d). Orient the z-axis to (-1.0d, 0.0d, 0.0d). Orient the x-axis to (0.0d, 0.0d, 1.0d). To mark the joint attachment point on the second beam:The marker on the second beam is ready for attachment. Drag, tilt and rotate the second beam so the the markers for joint attachment are nearby and nearly parallel. This will help the solver find the exact answer.To create the second joint:Click/Kinematic/Joint/RevoluteZ/ to select the revolute (pin) joint tool. Click on \Assembly1\Marker2, drag to the \Assembly1\Part2\Marker1, and release the button. A dialog allows you to specify a unique name (Joint2). A rubber band connects the ''i'' and ''j'' markers with an label ''rev'' to denote the revolute joint.To apply a motion to the second joint:Click/Kinematic/Motion/RotationZ/ to select the z rotation tool. Click on a revolute joint rubber band (Joint2). A dialog allows you to specify a unique name (Motion2). A second dialog allows you to specify a function of time describing the angle of the ''j'' x-axis relative to the ''i'' x-axis. Enter 4.0d*pi*time to make the motion twice as fast as the first one. Click/OK. Another rubber band is superposed on the joint but the new label is ''rmo''. If you want to change the function, click the ''rmo'' label. The superposition of the rubber bands can make it difficult to select the desired item. This problem can be overcomed by selecting the desired item directly from the Tree View.To simulate:Click/Simulation/Transient/ to start a simulation. Click/''current state'' for the desired input state. In the next dialog, set the desired end time (1.0d) and output time step (0.01d) of the simulation. The other default parameters should be acceptable.Click/OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click/Simulation/Stop/ to terminate the simulation anytime.To animate:Click ''Animation'' for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click/Stop to stop the animation. Close the window when done.' runs: (Core.RunArray runs: #(654 37 1 25 63 12 3 8 53 18 54 9 7 5 57 10 141 6 70 9 19 10 20 10 18 7 38 4 55 4 25 36 1 24 89 25 70 27 41 22 95 20 93 21 208 26 114 31 144 9 55 30 61 29 31 64 1 51 109 27 41 20 145 47 54 20 217 30 221 20 1 32 47 1 225 118 68 31 1 33 272 8 314 89 2 12 1 27 24 21 183 8 215 22 39 11 6 12 141 4 34 10 25 20 99 16 29 18 125 8 65 18 99 29 58 16 49 23 151 23 121 27 41 23 192 71 1 58 35 27 41 20 261 30 255 54 216 27 1 32 286 38 1 33 331 8 314 12 1 27 24 21 183 8 136 4 75 22 39 11 6 12 179 10 54) values: #(nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #underline nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil))) + (Text string: 'Copyright (C) 2000-2004, A-S Koh, All Rights Reserved.The Tree View is on the left.The Graphics View is on the right.The Selection View is at the bottom left.The XYZ axes are colored Red Green Blue (RGB). The default world axes are one meter long (about 40 inches).Units are SI units. Angles are in radians unless stated to be in degrees.A rectangular beam is connected to ground with a revolute (pin) joint which allows rotation in the XY plane. A motion is applied to the joint to rotate the beam with constant angular velocity. A similar beam is made to rotate in a plane parallel to the YZ plane. Units are SI units. Angles are in radians.To load the example for a quick look:Click/File/Open/Assembly/ to get a dialog. Enter *.asm for a list of assemblies. Select circular.asm. Click/OK. The projectiles should appear on the screen.Click /Edit/Marker Size/ to set a suitable length for the marker axes.Click ''Wireframe'' and ''Solid'' to switch between wireframe and rendered views.Click ''TiltRotate'' to show all. Drag on the handles to orientate the assembly in 3D. Tilt means tilting away from the line from the eye to the handle.Click ''ZoomIn'' and drag a rectangle over the region of interest to zoom in.Click ''Animation'' to get a dialog. Click Play to animate.Click ''TiltRotate'' to show all or ''ZoomOut'' to see more.You can use any of the View menu items during animation to change you view.Click Stop to stop the animation.To create the assembly from scratch:Click/File/New/Assembly/ to create an empty assembly. A dialog allows you to specify a unique name (Assembly1).To create the first beam:Click on (Assembly1) in the Tree View if it is not already selected.Click/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Part/New/ to insert a part on the selected plane. A dialog allows you to specify a unique name (Part1).Click/Insert/Sketch/ to insert a sketch on the new part. A dialog allows you to specify a unique name (Sketch1).Click/Draw/Rectangle/ to select the rectangle tool. In the drawing area, click and drag toward the positive quadrant (increasing x and y) to create a rectangle. Click inside the rectangle if three black handles are not visible, RightClick/Position/Angle/ to get a dialog to specify the rectangle position (0.0d, 0.0d), angle (0.0d) and size (2.0d, 0.2d) precisely.Click/Insert/Feature/Extrusion/ to extrude the drawing perpendicular to the sketch plane. A dialog allows you to specify the z coordinates for extrusion (0.0d, 0.1d).Click ''WireFrame'' to make mass marker visible. Click the mass marker, RightClick/Position/Direction/ to get a dialog to specify its mass and inertias precisely. Click/''Apply Uniform Density''. Enter the density (10.0d).To connect the beam to the assembly with a revolute (pin) joint:To mark the joint attachment point on the assembly:Drag the beam to the upper right to clear up the area near the origin.Select Assembly1 from the Tree View.Click/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin.To mark the joint attachment point on the beam:Click on the wide face of the beam to highlight it.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the face origin. The marker is referenced to the face which becomes the marker''s guide frame.RightClick/Position/Direction/ over the marker to get a dialog to specify the exact placement of the marker on the part. Enter the coordinates of the marker origin relative to the guide frame. (0.1d, 0.1d, 0.0d). No need to change the other values.To create the joint:Click/Kinematic/Joint/RevoluteZ/ to select the revolute (pin) joint tool. Click on the assembly marker, drag to the part marker, and release the button. A dialog allows you to specify a unique name (Joint1). A rubber band connects the ''i'' and ''j'' markers with an label ''rev'' to denote the revolute joint. A revolute joint constraints the origins of ''i'' and ''j'' to be coincident and the z axes of ''i'' and ''j'' to be colinear. Only one rotational degree of freedom exists between ''i'' and ''j''.To apply a motion to the joint:Click/Kinematic/Motion/RotationZ/ to select the z rotation tool. Click on a revolute joint rubber band. A dialog allows you to specify a unique name (Motion1). A second dialog allows you to specify a function of time describing the angle of the ''j'' x-axis relative to the ''i'' x-axis. Enter 2.0d*pi*time. Click/OK. Another rubber band is superposed on the joint but the new label is ''rmo''. If you want to change the function, click the ''rmo'' label. The superposition of the rubber bands can make it difficult to select the desired item. This problem can be overcomed by selecting the desired item directly from the Tree View.You have just learned the basics of creating markers, connections and prescribed motions.To simulate:Click/Simulation/Transient/ to start a simulation. Click/''current state'' for the desired input state. In the next dialog, set the desired end time (1.0d) and output time step (0.01d) of the simulation. The other default parameters should be acceptable.Click/OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click/Simulation/Stop/ to terminate the simulation anytime.To animate:Click ''Animation'' for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click/Stop to stop the animation.To plot marker data:If a suitable marker is not available, insert a marker anywhere on the part. Click on the marker, RightClick/Plot/, a new plot window appears. Click/Plot/Select/ to get a dialog to specify the data for the x and y axes. Multiply select with shift-click or control-click for the y-axis. Click/OK to get the plots. You can export the plot data in tabular form: Click/Plot/Export/ to specify an output filename. The file can be imported into a spreadsheet for further analysis.To plot joint or motion data:Select a joint or motion from the Tree or Graphic Views. RightClick/Plot/ and follow the same procedure for marker data.To add the second beam:Since the second beam is the same as the first, we will reuse.Select \Assembly1\Part1 in the Tree View. Expand the tree as necessary to reach Part1.Click/File/Save As/Part to save the selected part to file. Enter a filename with .prt extension (Part1.prt).Select Assembly1 in the Tree ViewClick/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Part/File/ to insert a part from file. A dialog allows you to specify a unique name (Part2). Another dialog allows you to select the file Part1.prt. The second beam is inserted at the assembly origin.To connect the second beam to the assembly with a revolute (pin) joint:To mark the second joint attachment point on the assembly:Select Assembly1 in the Tree ViewClick/Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click/Insert/Marker/. A dialog allows you to specify a unique name (Marker2). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin. Drag the handle to move the new marker away from the origin.Click on the marker if it does not have a black handle, RightClick/Position/Direction/ to get a dialog to specify the exact placement of the marker in the assembly. Enter the coordinates of the marker origin relative to the assembly (3.0d, 0.0d, 0.0d). Orient the z-axis to (-1.0d, 0.0d, 0.0d). Orient the x-axis to (0.0d, 0.0d, 1.0d). To mark the joint attachment point on the second beam:The marker on the second beam is ready for attachment. Drag, tilt and rotate the second beam so the the markers for joint attachment are nearby and nearly parallel. This will help the solver find the exact answer.To create the second joint:Click/Kinematic/Joint/RevoluteZ/ to select the revolute (pin) joint tool. Click on \Assembly1\Marker2, drag to the \Assembly1\Part2\Marker1, and release the button. A dialog allows you to specify a unique name (Joint2). A rubber band connects the ''i'' and ''j'' markers with an label ''rev'' to denote the revolute joint.To apply a motion to the second joint:Click/Kinematic/Motion/RotationZ/ to select the z rotation tool. Click on a revolute joint rubber band (Joint2). A dialog allows you to specify a unique name (Motion2). A second dialog allows you to specify a function of time describing the angle of the ''j'' x-axis relative to the ''i'' x-axis. Enter 4.0d*pi*time to make the motion twice as fast as the first one. Click/OK. Another rubber band is superposed on the joint but the new label is ''rmo''. If you want to change the function, click the ''rmo'' label. The superposition of the rubber bands can make it difficult to select the desired item. This problem can be overcomed by selecting the desired item directly from the Tree View.To simulate:Click/Simulation/Transient/ to start a simulation. Click/''current state'' for the desired input state. In the next dialog, set the desired end time (1.0d) and output time step (0.01d) of the simulation. The other default parameters should be acceptable.Click/OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click/Simulation/Stop/ to terminate the simulation anytime.To animate:Click ''Animation'' for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click/Stop to stop the animation. Close the window when done.' runs: (Core.RunArray runs: #(654 37 1 25 63 12 3 8 53 18 54 9 7 5 57 10 141 6 70 9 19 10 20 10 18 7 38 4 55 4 25 36 1 24 89 25 70 27 41 22 95 20 93 21 208 26 114 31 144 9 55 30 61 29 31 64 1 51 109 27 41 20 145 47 54 20 217 30 221 20 1 32 47 1 225 118 68 31 1 33 272 8 314 89 2 12 1 27 24 21 183 8 215 22 39 11 6 12 141 4 34 10 25 20 99 16 29 18 125 8 65 18 99 29 58 16 49 23 151 23 121 27 41 23 192 71 1 58 35 27 41 20 261 30 255 54 216 27 1 32 286 38 1 33 331 8 314 12 1 27 24 21 183 8 136 4 75 22 39 11 6 12 179 10 54) values: #(nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #underline nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil))) Name Assembly1 Position3D diff --git a/testapp/gyro.asmt b/testapp/gyro.asmt index bc41851..92e87a2 100644 --- a/testapp/gyro.asmt +++ b/testapp/gyro.asmt @@ -1,7 +1,7 @@ freeCAD: 3D CAD with Motion Simulation by askoh.com Assembly Notes - (Text string: 'CAD: Copyright (C) 2000-2004, Aik-Siong Koh, All Rights Reserved.A cylinder is connected to ground with a spherical (ball) joint. Its axis passes through the joint. Gravity acts in the negative y direction. While held in the horizontal position, the cylinder is set spinning about its axis at high speed. Then it is released. Gyroscopic and gravitational forces cause the spinning cylinder to precess (rotate about the vertical) and nutate (bop up and down). Units are SI units. Angles are in radians.If the instructions below are too brief, refer to the Notes in projectile.asm and circular.asm.To load the example for a quick look:Click File/Open/Assembly/ to get a dialog. Enter *.asm for a list of assemblies. Select gyro.asm. To create the assembly from scratch:To create a cylindrical rotor:Click File/New/Assembly/ to create an empty assembly. A dialog allows you to specify a unique name (Assembly1).Click Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click Insert/Part/New/ to insert a part on the selected plane. A dialog allows you to specify a unique name (Part1).Click Insert/Sketch/ to insert a sketch on the new part. A dialog allows you to specify a unique name (Sketch1).Click Draw/Circle/ to select the circle tool. In the drawing area, click and drag to create a circle. RightClick/Position/Angle/ over the circle to get a dialog to specify the circle position (0.0d, 0.0d, 0.0d), angle (0.0d) and size (0.5d, 0.5d) precisely.Click Insert/Feature/Extrusion/ to extrude the drawing perpendicular to the sketch plane. A dialog allows you to specify the z coordinates for extrusion (0.0d, 1.0d).RightClick/Position/Direction/ over the part mass marker to get a dialog to specify its mass and inertias precisely. Click ''Apply Uniform Density''. Enter the density (10.0d).To connect the rotor to the assembly with a spherical joint:To mark the joint attachment point on the assembly:Drag the cylinder to the upper right to clear up the area near the origin.Click Select/Assembly/Assembly1/ to reselect the assembly named Assembly1.Click Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin.To mark the joint attachment point on the rotor:Click on the z face of the cylinder to hightlight it.Click Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the face origin. The marker is referenced to the face which becomes the marker''s guide frame.RightClick/Position/Direction/ to get a dialog to specify the exact placement of the marker on the part. Enter the coordinates of the marker origin relative to the guide frame. (0.0d, 0.0d, -2.0d). No need to change the other values. Tilt the cylinder slightly to get a good view of the marker.To create a spherical joint:The goal now is to connect the part to the assembly with a spherical (pin) joint.Click Kinematic/Joint/Spherical/ to select the spherical joint tool. Click on the assembly marker, drag to the part marker, and release the button. A dialog allows you to specify a unique name (Joint1). A rubber band connects the ''i'' and ''j'' markers with an label ''sph'' to denote the spherical joint.To set initial conditions:RightClick/PositionPart/Direction/ over the marker (Assembly1Part1Marker1) to get a dialog to specify its absolute position and orientation in space precisely. Enter the absolute coordinates of the marker origin in space (0.0d, 0.0d, 0.0d). Enter the marker z-axis direction in absolute coordinates (0.0d, 0.0d, 1.0d). Do not worry about the magnitude as only the direction is important. Enter the direction of a vector in the marker x-z plane in absolute coordinates (1.0d, 0.0d, 0.0d).RightClick/Velocity/ over the marker (Assembly1Part1Marker1) to get a dialog to specify its absolute velocity in space precisely. Enter velocity of marker origin in absolute components (0.0d, 0.0d, 0.0d). Enter the angular velocity of the marker in absolute components (0.0d, 0.0d, 3600.0d).To set gravity:Click Dynamic/Gravity/ for the gravity dialog. Enter (0.0d, -9.81d, 0.0d).To simulate:Click Simulation/Dynamics/ to start a simulation. Click ''current state'' for the desired input state. In the subsequent dialog, set the desired end time (10.0d) and output time step (0.05d) of the simulation. The other default parameters should be acceptable.Click OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click Simulation/Stop/ to terminate the simulation anytime.To animate:Click Simulation/Animation/ for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click Stop to stop the animation. Close the window when done.To plot:Click Simulation/Plot/ for a list of items that can have plots. Select a marker (Assembly1Part1MassMarker). A new plot window appears. Click Plot/Select/ to get a dialog to specify the data for the x and y axes. Multiply select with shift-click or control-click for the y-axis. Click OK to get the plots. You can export the plot data in tabular form: Click Plot/Export/ to specify an output filename. The file can be imported into a spreadsheet for further analysis.' runs: (Core.RunArray runs: #(505 63 14 5 12 1 2 37 89 8 4 36 1 30 1013 60 1 51 384 48 588 28 385 26 782 15 77 12 544 11 270 8 468) values: #(nil #underline #(#underline #bold) #underline #(#underline #bold) #underline nil #(#bold #large) nil #bold nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil))) + (Text string: 'CAD: Copyright (C) 2000-2004, Aik-Siong Koh, All Rights Reserved.A cylinder is connected to ground with a spherical (ball) joint. Its axis passes through the joint. Gravity acts in the negative y direction. While held in the horizontal position, the cylinder is set spinning about its axis at high speed. Then it is released. Gyroscopic and gravitational forces cause the spinning cylinder to precess (rotate about the vertical) and nutate (bop up and down). Units are SI units. Angles are in radians.If the instructions below are too brief, refer to the Notes in projectile.asm and circular.asm.To load the example for a quick look:Click File/Open/Assembly/ to get a dialog. Enter *.asm for a list of assemblies. Select gyro.asm. To create the assembly from scratch:To create a cylindrical rotor:Click File/New/Assembly/ to create an empty assembly. A dialog allows you to specify a unique name (Assembly1).Click Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click Insert/Part/New/ to insert a part on the selected plane. A dialog allows you to specify a unique name (Part1).Click Insert/Sketch/ to insert a sketch on the new part. A dialog allows you to specify a unique name (Sketch1).Click Draw/Circle/ to select the circle tool. In the drawing area, click and drag to create a circle. RightClick/Position/Angle/ over the circle to get a dialog to specify the circle position (0.0d, 0.0d, 0.0d), angle (0.0d) and size (0.5d, 0.5d) precisely.Click Insert/Feature/Extrusion/ to extrude the drawing perpendicular to the sketch plane. A dialog allows you to specify the z coordinates for extrusion (0.0d, 1.0d).RightClick/Position/Direction/ over the part mass marker to get a dialog to specify its mass and inertias precisely. Click ''Apply Uniform Density''. Enter the density (10.0d).To connect the rotor to the assembly with a spherical joint:To mark the joint attachment point on the assembly:Drag the cylinder to the upper right to clear up the area near the origin.Click Select/Assembly/Assembly1/ to reselect the assembly named Assembly1.Click Select/Plane/x=X y=Y/ to select the XY plane of the assembly.Click Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the assembly origin.To mark the joint attachment point on the rotor:Click on the z face of the cylinder to highlight it.Click Insert/Marker/. A dialog allows you to specify a unique name (Marker1). A RedGreenBlue (RGB) marker representing the xyz axes appears at the face origin. The marker is referenced to the face which becomes the marker''s guide frame.RightClick/Position/Direction/ to get a dialog to specify the exact placement of the marker on the part. Enter the coordinates of the marker origin relative to the guide frame. (0.0d, 0.0d, -2.0d). No need to change the other values. Tilt the cylinder slightly to get a good view of the marker.To create a spherical joint:The goal now is to connect the part to the assembly with a spherical (pin) joint.Click Kinematic/Joint/Spherical/ to select the spherical joint tool. Click on the assembly marker, drag to the part marker, and release the button. A dialog allows you to specify a unique name (Joint1). A rubber band connects the ''i'' and ''j'' markers with an label ''sph'' to denote the spherical joint.To set initial conditions:RightClick/PositionPart/Direction/ over the marker (Assembly1Part1Marker1) to get a dialog to specify its absolute position and orientation in space precisely. Enter the absolute coordinates of the marker origin in space (0.0d, 0.0d, 0.0d). Enter the marker z-axis direction in absolute coordinates (0.0d, 0.0d, 1.0d). Do not worry about the magnitude as only the direction is important. Enter the direction of a vector in the marker x-z plane in absolute coordinates (1.0d, 0.0d, 0.0d).RightClick/Velocity/ over the marker (Assembly1Part1Marker1) to get a dialog to specify its absolute velocity in space precisely. Enter velocity of marker origin in absolute components (0.0d, 0.0d, 0.0d). Enter the angular velocity of the marker in absolute components (0.0d, 0.0d, 3600.0d).To set gravity:Click Dynamic/Gravity/ for the gravity dialog. Enter (0.0d, -9.81d, 0.0d).To simulate:Click Simulation/Dynamics/ to start a simulation. Click ''current state'' for the desired input state. In the subsequent dialog, set the desired end time (10.0d) and output time step (0.05d) of the simulation. The other default parameters should be acceptable.Click OK to start the simulation. The simulation progress is shown in the Transcript window and animated in the drawing. You can use any of the View menu items during the simulation. Let the simulation run to completion or Click Simulation/Stop/ to terminate the simulation anytime.To animate:Click Simulation/Animation/ for a animation control window to play the animation, step frame by frame, jump to the specified current frame. You can also use any of the View menu items during the animation. Click Stop to stop the animation. Close the window when done.To plot:Click Simulation/Plot/ for a list of items that can have plots. Select a marker (Assembly1Part1MassMarker). A new plot window appears. Click Plot/Select/ to get a dialog to specify the data for the x and y axes. Multiply select with shift-click or control-click for the y-axis. Click OK to get the plots. You can export the plot data in tabular form: Click Plot/Export/ to specify an output filename. The file can be imported into a spreadsheet for further analysis.' runs: (Core.RunArray runs: #(505 63 14 5 12 1 2 37 89 8 4 36 1 30 1013 60 1 51 384 48 588 28 385 26 782 15 77 12 544 11 270 8 468) values: #(nil #underline #(#underline #bold) #underline #(#underline #bold) #underline nil #(#bold #large) nil #bold nil #(#bold #large) nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil #bold nil))) Name Gyro Position3D