[MBDyn-users] Best way to get forces from state-space integration into mbdyn?

Richard Crozier r.crozier at ed.ac.uk
Wed Sep 13 23:21:12 CEST 2017


On 08/09/17 15:59, Richard Crozier wrote:
> Dear List,
> 
> I have a set of forces I wish to apply to structural nodes which are the 
> output of the integration of a state-space system. The inputs to this 
> system are the node velocities. The outputs are the hydrodynamic wave 
> radiation forces on a body moving in water waves.
> 
> What I am trying to figure out is how to do this state-space integration 
> in tandem with the mbdyn nodal simulation. Is there any way to get MBDyn 
> to do this state-space integration for me?
> 
> It seems like the Aeromodal Element may do something like this, so I 
> plan to look at this, but is there a better/simpler way?
> 
> Regards,
> 
> Richard
> 


Following on from my previous message, I had a go using the state-space 
MIMO genel to achieve this, which seems like it should do what I want 
however, I can't find an example of this element in use and have run 
into a problem.

Unfortunately I can't attached the real input file as it is too large 
for the mailing list but you it would not be possible to run the input 
file anyway as it required external socket forces from another program. 
I have attached a version with the state-space matrices removed instead.

When I try to run the file, I get the following error from mbdyn 
(happens when I call GetMotion() for first time which returns -1):

"StructNode(1): unable to return angles"

I suspect the problem is in my specification of the inputs and outputs, 
e.g. I have the following genel :

      genel : 12, state space MIMO,
          6.0, # number of outputs
              1.0, structural, 1, algebraic,
              1.0, structural, 2, algebraic,
              1.0, structural, 3, algebraic,
              1.0, structural, 4, algebraic,
              1.0, structural, 5, algebraic,
              1.0, structural, 6, algebraic,
          6.0, # number of inputs
              node dof, 1.0, structural, 1, differential,
              node dof, 1.0, structural, 2, differential,
              node dof, 1.0, structural, 3, differential,
              node dof, 1.0, structural, 4, differential,
              node dof, 1.0, structural, 5, differential,
              node dof, 1.0, structural, 6, differential,
          187.0, # state order
          Matrix A,
	... etc. (big matrices)

I gather from the input manual there is some restriction on what node 
dof values you can use. Essentially I am producing forces for all 
degrees of freedom of a structural node based on it's velocity and 
angular velocity.

I would really appreciate some help in understanding the correct way to 
do this, if it is possible.

Thanks!

Richard
		


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------

MBDyn - MultiBody Dynamics 1.7.1
configured on Mar 17 2017 at 12:32:32

Copyright 1996-2015 (C) Paolo Mantegazza and Pierangelo Masarati,
Dipartimento di Ingegneria Aerospaziale <http://www.aero.polimi.it/>
Politecnico di Milano                   <http://www.polimi.it/>

MBDyn is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it
under certain conditions.  Use 'mbdyn --license' to see the conditions.
There is absolutely no warranty for MBDyn.  Use "mbdyn --warranty"
for details.

reading from file "/home/rcrozier/src/rnfoundry-hg/wave/matlab-octave/wec-sim/test/+test_wsim_RM3/RM3_state-space-radiation-forces.mbd"
MathParser::RegisterNameSpace: registering namespace "default"
registering description "remark"
registering description "printsymboltable"
registering description "set"
registering description "setenv"
registering description "exit"
registering description "include"
registering description "chdir"
registering drive caller "array"
registering drive caller "closestnext"
registering drive caller "const"
registering drive caller "cosine"
registering drive caller "cubic"
registering drive caller "direct"
registering drive caller "dof"
registering drive caller "doubleramp"
registering drive caller "doublestep"
registering drive caller "drive"
registering drive caller "element"
registering drive caller "exponential"
registering drive caller "file"
registering drive caller "fourierseries"
registering drive caller "frequencysweep"
registering drive caller "function"
registering drive caller "linear"
registering drive caller "meter"
registering drive caller "mult"
registering drive caller "node"
registering drive caller "null"
registering drive caller "one"
registering drive caller "parabolic"
registering drive caller "periodic"
registering drive caller "piecewiselinear"
registering drive caller "postponed"
registering drive caller "ramp"
registering drive caller "random"
registering drive caller "sampleandhold"
registering drive caller "sine"
registering drive caller "step"
registering drive caller "string"
registering drive caller "tanh"
registering drive caller "time"
registering drive caller "timestep"
registering drive caller "unit"
registering template drive caller 1D "null"
registering template drive caller 3D "null"
registering template drive caller 6D "null"
registering template drive caller 3x3D "null"
registering template drive caller 6x6D "null"
registering template drive caller 1D "zero"
registering template drive caller 3D "zero"
registering template drive caller 6D "zero"
registering template drive caller 3x3D "zero"
registering template drive caller 6x6D "zero"
registering template drive caller 1D "single"
registering template drive caller 3D "single"
registering template drive caller 6D "single"
registering template drive caller 3x3D "single"
registering template drive caller 6x6D "single"
registering template drive caller 1D "component"
registering template drive caller 3D "component"
registering template drive caller 6D "component"
registering template drive caller 3x3D "component"
registering template drive caller 6x6D "component"
registering template drive caller 1D "array"
registering template drive caller 3D "array"
registering template drive caller 6D "array"
registering template drive caller 3x3D "array"
registering template drive caller 6x6D "array"
registering constitutive law 1D "array"
registering constitutive law 3D "array"
registering constitutive law 6D "array"
registering constitutive law 1D "linearelastic"
registering constitutive law 3D "linearelastic"
registering constitutive law 6D "linearelastic"
registering constitutive law 1D "linearelasticisotropic"
registering constitutive law 3D "linearelasticisotropic"
registering constitutive law 6D "linearelasticisotropic"
registering constitutive law 1D "linearelasticgeneric"
registering constitutive law 3D "linearelasticgeneric"
registering constitutive law 6D "linearelasticgeneric"
registering constitutive law 6D "linearelasticgenericaxialtorsioncoupling"
registering constitutive law 6D "linearviscoelasticgenericaxialtorsioncoupling"
registering constitutive law 1D "inversesquareelastic"
registering constitutive law 1D "logelastic"
registering constitutive law 1D "doublelinearelastic"
registering constitutive law 3D "doublelinearelastic"
registering constitutive law 1D "isotropichardeningelastic"
registering constitutive law 3D "isotropichardeningelastic"
registering constitutive law 6D "isotropichardeningelastic"
registering constitutive law 1D "contactelastic"
registering constitutive law 3D "contactelastic"
registering constitutive law 1D "symbolic"
registering constitutive law 3D "symbolic"
registering constitutive law 6D "symbolic"
registering constitutive law 1D "symbolicelastic"
registering constitutive law 3D "symbolicelastic"
registering constitutive law 6D "symbolicelastic"
registering constitutive law 1D "symbolicviscous"
registering constitutive law 3D "symbolicviscous"
registering constitutive law 6D "symbolicviscous"
registering constitutive law 1D "symbolicviscoelastic"
registering constitutive law 3D "symbolicviscoelastic"
registering constitutive law 6D "symbolicviscoelastic"
registering constitutive law 1D "linearviscous"
registering constitutive law 3D "linearviscous"
registering constitutive law 6D "linearviscous"
registering constitutive law 1D "linearviscousisotropic"
registering constitutive law 3D "linearviscousisotropic"
registering constitutive law 6D "linearviscousisotropic"
registering constitutive law 1D "linearviscousgeneric"
registering constitutive law 3D "linearviscousgeneric"
registering constitutive law 6D "linearviscousgeneric"
registering constitutive law 1D "linearviscoelastic"
registering constitutive law 3D "linearviscoelastic"
registering constitutive law 6D "linearviscoelastic"
registering constitutive law 1D "linearviscoelasticisotropic"
registering constitutive law 3D "linearviscoelasticisotropic"
registering constitutive law 6D "linearviscoelasticisotropic"
registering constitutive law 1D "linearviscoelasticgeneric"
registering constitutive law 3D "linearviscoelasticgeneric"
registering constitutive law 6D "linearviscoelasticgeneric"
registering constitutive law 1D "lineartimevariantviscoelasticgeneric"
registering constitutive law 3D "lineartimevariantviscoelasticgeneric"
registering constitutive law 6D "lineartimevariantviscoelasticgeneric"
registering constitutive law 1D "cubicelasticgeneric"
registering constitutive law 3D "cubicelasticgeneric"
registering constitutive law 1D "cubicviscoelasticgeneric"
registering constitutive law 3D "cubicviscoelasticgeneric"
registering constitutive law 1D "doublelinearviscoelastic"
registering constitutive law 3D "doublelinearviscoelastic"
registering constitutive law 1D "turbulentviscoelastic"
registering constitutive law 1D "linearelasticbistop"
registering constitutive law 3D "linearelasticbistop"
registering constitutive law 6D "linearelasticbistop"
registering constitutive law 1D "linearviscoelasticbistop"
registering constitutive law 3D "linearviscoelasticbistop"
registering constitutive law 6D "linearviscoelasticbistop"
registering constitutive law 1D "bistop"
registering constitutive law 3D "bistop"
registering constitutive law 6D "bistop"
registering constitutive law 1D "shockabsorber"
registering constitutive law 1D "annelastic"
registering constitutive law 1D "annviscoelastic"
registering constitutive law 1D "nlpviscoelastic"
registering constitutive law 1D "nlpelastic"
registering constitutive law 1D "nlpviscous"
registering constitutive law 3D "nlpviscoelastic"
registering constitutive law 3D "nlpelastic"
registering constitutive law 3D "nlpviscous"
registering constitutive law 6D "nlpviscoelastic"
registering constitutive law 6D "nlpelastic"
registering constitutive law 6D "nlpviscous"
registering constitutive law 1D "nlsfviscoelastic"
registering constitutive law 1D "nlsfelastic"
registering constitutive law 1D "nlsfviscous"
registering constitutive law 3D "nlsfviscoelastic"
registering constitutive law 3D "nlsfelastic"
registering constitutive law 3D "nlsfviscous"
registering constitutive law 6D "nlsfviscoelastic"
registering constitutive law 6D "nlsfelastic"
registering constitutive law 6D "nlsfviscous"
registering constitutive law 3D "invariantangular"
registering constitutive law 3D "axialwrapper"
registering constitutive law 1D "tdclw"
registering constitutive law 3D "tdclw"
registering constitutive law 6D "tdclw"
registering scalar function "const"
registering scalar function "linear"
registering scalar function "pow"
registering scalar function "log"
registering scalar function "exp"
registering scalar function "sum"
registering scalar function "sub"
registering scalar function "mul"
registering scalar function "div"
registering scalar function "cubicspline"
registering scalar function "multilinear"
registering scalar function "chebychev"
registering drive caller "scalarfunction"
registering constitutive law 1D "scalarfunctionelasticisotropic"
registering constitutive law 1D "scalarfunctionelasticorthotropic"
registering constitutive law 1D "scalarfunctionelastic"
registering constitutive law 3D "scalarfunctionelasticisotropic"
registering constitutive law 3D "scalarfunctionelasticorthotropic"
registering constitutive law 6D "scalarfunctionelasticisotropic"
registering constitutive law 6D "scalarfunctionelasticorthotropic"
registering description "reference"
registering description "hydraulicfluid"
registering description "c81data"
registering description "constitutivelaw"
registering description "drivecaller"
registering description "templatedrivecaller"
registering description "scalarfunction"
registering description "moduleload"
registering description "license"
registering description "warranty"
Creating scalar solver with Naive linear solver
mbdyn_cleanup_register: 0x49cfc0:0x2939c80
registering drive "fixedstep"
registering drive "variablestep"
registering drive "socket"
registering drive "socketstream"
registering drive "rtaiinput"
registering drive "stream"
registering drive "bufferstream"
registering user-defined element "loadable"
registering gust "front1D"
registering gust "scalarfunction"
registering gust "powerlaw"
registering gust "logarithmic"
registering plugin "dof"
registering plugin "node"
registering plugin "element"
MathParser::RegisterNameSpace: registering namespace "model"
Reading Structural(1)
Reading Structural(2)
Reading Structural(3)
Reading Body(4)
Reading Body(5)
Reading Joint(6)
Reading Joint(7)
Reading Joint(8)
Reading Joint(9)
Reading Joint(10)
Reading Force(11)
Reading Genel(12)
Reading Genel(13)
LOCAL connection to path="/tmp/mbdyn.sock"
unknown nonlinear solver type; using default
StructNode(1): unable to return angles
UseSocket::~UseSocket: shutdown: socket=12 status=0 time=Wed Sep 13 15:57:50 2017

UseSocket::~UseSocket: close: socket=12 status=0 time=Wed Sep 13 15:57:50 2017

An error occurred during the execution of MBDyn; aborting... 
-------------- next part --------------

begin: data;
    problem: initial value;
end: data;

# initial value problem
begin: initial value;
    initial time: 0.0;
    final time: 400.0;
    time step: 0.100000000000000006;
    max iterations: 20;
    tolerance: 1.000000e-06;
end: initial value;


begin: control data;
    structural nodes: 3;
    rigid bodies: 2;
    joints: 5;
    forces: 1;
    genels: 2;
    default orientation: orientation matrix;
end: control data;

begin: nodes;

    # 6 DOF structural node
    structural : 1, dynamic, # label, type
        position, 0.0, 0.0, -0.719999999999999973, # absolute position
        orientation, 
        matr,
        1.0, 0.0, 0.0, 
        0.0, 1.0, 0.0, 
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

    # 6 DOF structural node
    structural : 2, dynamic, # label, type
        position, 0.0, 0.0, -21.289999999999999147, # absolute position
        orientation, 
        matr,
        1.0, 0.0, 0.0, 
        0.0, 1.0, 0.0, 
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

    # 6 DOF structural node
    structural : 3, static, # label, type
        position, 0.0, 0.0, -200.0, # absolute position
        orientation, 
        matr,
        1.0, 0.0, 0.0, 
        0.0, 1.0, 0.0, 
        0.0, 0.0, 1.0, # absolute orientation
        velocity, 0.0, 0.0, 0.0, # absolute velocity
        angular velocity, 0.0, 0.0, 0.0 # absolute angular velocity
    ; # end structural node

end: nodes;

begin: elements;

    # one-mass body
    body : 4, 1, # label, node label
        463682.244000000006053597, # mass
        0.0, 0.0, 0.0, # relative centre of mass
        matr,
        35134311.0, 0.0, 0.0, 
        0.0, 35532910.659999996423721313, 0.0, 
        0.0, 0.0, 37085481.109980776906013489 # inertia matrix
    ; # end one-mass body

    # one-mass body
    body : 5, 2, # label, node label
        21723097.80000000074505806, # mass
        0.0, 0.0, 0.0, # relative centre of mass
        matr,
        464641214.569999992847442627, 0.0, 0.0, 
        0.0, 464629891.240000009536743164, 0.0, 
        0.0, 0.0, 28542224.820195272564888 # inertia matrix
    ; # end one-mass body

    joint : 6, clamp,
        3, # node label
            position, node, # absolute position
            orientation, node # absolute orientation
    ; # end clamp

    joint : 7, prismatic,
        1, # node 1 label
        2 # node 2 label
    ; # end prismatic

    joint : 8, in line,
        1, # node 1 label
            position, reference, node, 0.0, 0.0, 0.0, # relative line position
            orientation, reference, global, 
            matr,
            1.0, 0.0, 0.0, 
            0.0, 1.0, 0.0, 
            0.0, 0.0, 1.0, # relative orientation
        2 # node 2 label
    ; # end in line

    joint : 9, in plane,
        3, # node 1 label
            position, null,
            0.0, 1.0, 0.0,
        2, # node 2 label
            offset, reference, other node, null
    ; # end in plane

    joint : 10, revolute rotation,
        2, # node 1 label
            position, reference, node, null,
            orientation, reference, node, 
            matr,
            1.0, 0.0, 0.0, 
            0.0, 0.0, 1.0, 
            0.0, -1.0, 0.0,
        3, # node 2 label
            position, reference, other node, null,
            orientation, reference, node, 
            matr,
            1.0, 0.0, 0.0, 
            0.0, 0.0, 1.0, 
            0.0, -1.0, 0.0
    ; # end revolute rotation

    force : 11, external structural,
        socket,
            create, yes, # will mbdyn create socket?
            path, "/tmp/mbdyn.sock",
            sleep time, 0.0,
            coupling, tight,
            send after predict, no,
        labels, no,
        sorted, yes,
        orientation, orientation matrix,
        accelerations, yes,
        2,
            1,
            2
    ; # end external structural

    genel : 12, state space MIMO,
        6.0, # number of outputs
            1.0, structural, 1, algebraic,
            1.0, structural, 2, algebraic,
            1.0, structural, 3, algebraic,
            1.0, structural, 4, algebraic,
            1.0, structural, 5, algebraic,
            1.0, structural, 6, algebraic,
        6.0, # number of inputs
            node dof, 1.0, structural, 1, differential,
            node dof, 1.0, structural, 2, differential,
            node dof, 1.0, structural, 3, differential,
            node dof, 1.0, structural, 4, differential,
            node dof, 1.0, structural, 5, differential,
            node dof, 1.0, structural, 6, differential,
        187.0, # state order
        Matrix A,
       
        Matrix B,
        Matrix C,
        Matrix D,
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ; # end state space MIMO

    genel : 13, state space MIMO,
        6.0, # number of outputs
            2.0, structural, 1, algebraic,
            2.0, structural, 2, algebraic,
            2.0, structural, 3, algebraic,
            2.0, structural, 4, algebraic,
            2.0, structural, 5, algebraic,
            2.0, structural, 6, algebraic,
        6.0, # number of inputs
            node dof, 2.0, structural, 1, differential,
            node dof, 2.0, structural, 2, differential,
            node dof, 2.0, structural, 3, differential,
            node dof, 2.0, structural, 4, differential,
            node dof, 2.0, structural, 5, differential,
            node dof, 2.0, structural, 6, differential,
        200.0, # state order
        Matrix A,
        Matrix B,
        Matrix C,
        Matrix D,
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ; # end state space MIMO

end: elements;


More information about the MBDyn-users mailing list