Skip to content

klunkean/pyfurc

Repository files navigation

PyPI GA Documentation Status Python Version

What is pyfurc?

pyfurc is a python module that facilitates calculations for non-linear mechanical systems exhibiting bifurcations with the generalized path-following FORTRAN program AUTO-07p directly in python.

Energy expressions, degrees of freedom and loads are defined using sympy symbolic math processing functionality, and equilibrium equations are automatically derived symbolically.

pyfurc then generates FORTRAN code for the bifurcation problem, calls the AUTO-07p routines and reads the result into a pandas DataFrame for post-processing in python.

The basic functionality looks like this:

drawing

Solving a bifurcation problem can be this simple:

import pyfurc as pf
import sympy as sp
import matplotlib.pyplot as plt

phi = pf.Dof("\\varphi")
P = pf.Load("P")

cT = 10/3.1415
ell = 0.5

V = pf.Energy(1/2*cT*phi**2-P*ell*(1-sp.cos(phi)))
bf = pf.BifurcationProblem(V, name="hinged_cantilever")
bf.set_parameter("RL1", 12.73)  #set maximum load

solver = pf.BifurcationProblemSolver(bf)
solver.solve()  # solve problem

for dat in bf.solution.raw_data:
    plt.plot(dat["U(1)"], dat["PAR(1)"])

To get started, check out the Quickstart section below or take a look at the in-depth installation guides in the Documentation.

Part of the documentation is an in-depth tutorial where a simple example problem is solved in different ways.

Quickstart

Prerequisites:

  • Running Linux distribution (only tested on Ubuntu so far)
  • Python 3.8.2+
  • pip

For installing pyfurc run

pip3 install pyfurc

Documentation and Tutorial

The Documentation is hosted on readthedocs.