GithubHelp home page GithubHelp logo

josephcslater / mousai Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 11.0 10.94 MB

Harmonic balance solvers

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.67% Python 99.33%
vibration nonlinear dynamics harmonic resonance aeroelasticity

mousai's Introduction

Mousai

Join the chat at https://gitter.im/mousai_hb/Lobby

image

image

image

image

PyPi Download stats

image

Python-based Harmonic Balance solvers and relevant tools.

Please see the manual for usage and installation, and a nice overview from my Dayton Engineering Sciences Symposium 2017 presentation. You can play around with it by selecting the launch binder button above.

Mousai can solve sets of first-order and second-order ordinary differential equations written in state-space form (solved for acceleration for second-order form) subject to a harmonic excitation. All you need to provide is the name of a Python function which may simply be a wrapper to an external code. The function must accept:

  1. The states (displacements and derivatives for second order forms)
  2. Time (interpreted as time within the period)
  3. Fundamental frequency of the harmonic representation

The function must return the state derivatives (acceleration for second order form). It is expected that in most cases this will simply be a python wrapper function to call an external finite element, electro-magnetic, molecular dynamic, computational fluid dynamic, or other simulation code.

No traditional numerical integration is performed in harmonic balance, so issues of stability, reliability, etc. are separate concerns. An inability to determine a solution is reported if failure occurs. A good initial guess is always helpful, sometimes essential, and may simply have the form of a nearby solution. Sweeping through frequencies or increasing amplitudes of excitation is the best way to ensure swift convergence.

Quasi-linear models can (not yet implemented) obtain good low amplitude solutions that can be used as starting guesses for solutions (appropriate scaling may also help).

The manual is still under development, but the Tutorial provides two examples of solutions to the Duffing Oscillator, one in first order form, the other in second order form.

The Reference section of the manual illustrates supporting code for building out more time-refined solutions, finding velocities from displacements, and specifics on function calls.

Please see the manual for usage and installation.

Please see release notes for updates, fixes, and plans.

If you use this for any work, please cite it as: Slater, Joseph C., "Mousai: An Open Source Harmonic Balance Solver for Nonlinear Systems," 13th ASME Dayton Engineering Sciences Symposium, Oct. 30, 2017, Dayton, OH.

Like this module, buy me a coffee!

mousai's People

Contributors

dlax avatar gitter-badger avatar josephcslater avatar mackenzie29 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mousai's Issues

lack of initial guess causes fail: try with fewer points and fewer harmonics to initiate.

def duff_osc_ss(x, params):
    omega = params['omega']
    t = params['cur_time']
    xdot = np.array([[x[1]],[-x[0]-.1*x[0]**3-.1*x[1]+1*sin(omega*t)]])
    return xdot


t, x, e, amps, phases = ms.hb_freq(duff_osc_ss, num_variables = 2, omega = 0.1,
                                   eqform='first_order', num_harmonics=5, num_time_steps=51,             
                                   mask_constant=True, f_rtol = 1e-8)#, f_rtol=1e-8)
time, xc = ms.time_history(t, x)
plt.plot(time, xc.T, label='5 harmonics')

Results in failed start.

num_harmonics =1 works fine. This would be a good fall-back call should convergence fail.

Pseudo Arc-length continuation

I've started adding an implementation of pseudo-arc length continuation to the code. I've checked it to be working for the SDOF Duffing oscillator. You can have a look at the code in the branch "Nidish" in my fork of the project (https://github.com/Nidish96/mousai/tree/Nidish).
I'll raise a pull request once I'm done qualifying the rest. I'm raising this issue here for any suggestions you may give me. I'm having the following things on my agenda:

  • Implement Jacobian through finite-differences for both Frequency domain as well as Time domain user supplied routines
  • Qualify the code for MDOF systems
  • Switch to a better solver
  • Create a time-marching-based Monodromy stability estimation method

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.