Giter Club home page Giter Club logo

modelreduction.jl's Introduction

ModelReduction.jl

DOIBuild StatusCoverage StatusIssues

ModelReduction.jl is a Julia package to perform model reduction methods for i.e. multibody dynamics problems. The packcage includes model order reduction methods such as the Guyan reduction and the Craig-Bampton method.

Reducing the sizes of stiffness and mass matrices of the model will greatly decrease the computation resources needed when performing dynamic analyses.

ModelReduction.jl is a part of JuliaFEM. All codes are MIT licensed.

Installing and testing the package

Install the package the same way other Julia packages are installed.

julia> Pkg.add("ModelReduction")

Test the package with Pkg.test etc.

julia> Pkg.test("ModelReduction")

Usage example

This example demonstrates how to use the Craig-Bampton method function.

Problem setup:

julia> K = [2 -1  0  0;
           -1  2 -1  0;
            0 -1  2 -1;
            0  0 -1  1]

julia> M = [2 0 0 0;
            0 2 0 0;
            0 0 2 0;
            0 0 0 1]

julia> r = [4]
julia> l = [1, 2, 3]
julia> n = 1

K = original stiffness matrix, M = original mass matrix, r = retained DOF:s, l = internal DOF:s, n = the number of the internal modes to keep. Calculate the reduced mass and stiffness matrices Mred and Kred.

julia> using ModelReduction

julia> Mred, Kred = ModelReduction.craig_bampton(K, M, r, l, n)
([2.75 -1.20711; -1.20711 1.0], [0.25 0.0; 0.0 0.292893])

Citing

If you like using our package, please consider citing our article:

@article{rapo2018implementing,
 title={Implementing model reduction to the JuliaFEM platform},
 volume={51},
 url={https://rakenteidenmekaniikka.journal.fi/article/view/69026},
 doi={10.23998/rm.69026},
 number={1},
 journal={Rakenteiden Mekaniikka},
 author={Rapo, Marja and Aho, Jukka and Koivurova, Hannu and Frondelius, Tero},
 year={2018},
 pages={36-54}
}

Contributing

Have a new great idea and want to share it with the open source community? From here and here you can look for coding styles. Here it is explained how to contribute to open source project, in general.

modelreduction.jl's People

Contributors

ahojukka5 avatar femtocleaner[bot] avatar josephcslater avatar maikkirapo avatar terofrondelius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

modelreduction.jl's Issues

Create test model, calculate static and dynamic response

Let's start this with the following test problem: we have u'' = 0 with boundary conditions u(0) = 0 and u'(1) = 1, i.e. a truss with left boundary fixed and force F=1 is affecting to the right end. Use five node discretization, nodal coordinates is therefore [0.00, 0.25, 0.50, 0.75, 1.00]. And we have four elements.

  • Calculate static response using some FEM program. Stiffness matrix K and force vector f can be exported from finite element program.
  • Calculate dynamic response using some FEM program. Mass matrix can be exported from finite element program.
  • Upload matrices to testdata.
  • Read matrices above from files using julia, calculate static and dynamic response using julia. Verify results by making unit test.

You have to complete #5 to get this done.

ERROR: Unsatisfiable requirements detected for package ModelReduction [d4b734c2]

(v1.0) pkg> update
  Updating registry at `C:\Users\tfr004\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Updating git-repo `https://github.com/JuliaPackaging/BinaryBuilder.jl.git`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package ModelReduction [d4b734c2]:
 ModelReduction [d4b734c2] log:
 ├─possible versions are: [0.0.1-0.0.2, 0.1.1] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.2, 0.1.1]
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

(v1.0) pkg>

Create function reading ABAQUS .mtx file format

Format of the operator matrix

The assembled sparse matrix operator data are written to the text file as a series of comma-separated lists. Each row in the file represents a single matrix entry; a row is written as a comma-separated list with the following elements:

  1. Row node label
  2. Degree of freedom for row node
  3. Column node label
  4. Degree of freedom for column node
  5. Matrix entry

We want to read this file format and create sparse matrices from that using I,J,V vectors.

Sample:

1,1, 1,1,  1.000000000000000e+00
2,1, 1,1, -1.000000000000000e+00
1,2, 1,2,  0.000000000000000e+00
2,1, 2,1,  2.000000000000000e+00
3,1, 2,1, -1.000000000000000e+00
2,2, 2,2,  0.000000000000000e+00
3,1, 3,1,  2.000000000000000e+00
4,1, 3,1, -1.000000000000000e+00
3,2, 3,2,  0.000000000000000e+00
4,1, 4,1,  2.000000000000000e+00
5,1, 4,1, -1.000000000000000e+00
4,2, 4,2,  0.000000000000000e+00
5,1, 5,1,  1.000000000000000e+00
5,2, 5,2,  0.000000000000000e+00

Add docstrings

Add docstrings to mass and stiffness matrix functions.

Generated examples are missing

We should use Literate.jl to generate examples from tests. This is a good example where the whole package is broken so the static examples are definitely not working. First, we need to solve issue #28.

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

Perform static condensation

For docs/src, create file theory_static_condensation.md and describe there how static condensation is done in matrix level. We can use LaTeX markup syntax. See documentation of Documenter.jl.

For test problem, calculate statically condensated matrix K_red and force vector f_red. Verify results against the ones calculated in #2. You can create some function, given proper input arguments is doing this.

Keep on mind that K_ss is huge because it contains all dofs of model to be eliminated. For that reason calculating inverse of K_ss using inv(K_ss) is not practical and matrix computation must be done piece by piece.

In reference there is no force f_s, in real application there might be (e.g. gravity force acting body), thus it must be taken into account.

References

Example doesn't work

julia> using ModelReduction

julia> guyan_reduction(K, m, s)
ERROR: UndefVarError: guyan_reduction not defined

julia> ModelReduction.guyan_reduction(K, m, s)
2×2 Array{Float64,2}:
  0.25  -0.25
 -0.25   0.25

julia>

Either fix example or export guyan_reduction method.

The second examples doesn't work either:

julia> Mred, Kred = ModelReduction.craig_bampton(K, M, r, l, n)
ERROR: UndefVarError: craig_bampton not defined

julia> ModelReduction.
eval             global_mass       global_stiffness  guyan_reduction

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.