Giter Club home page Giter Club logo

phaseportrait's Introduction

PyPI Downloads PyPI Version

Commit activity License Build

Python Version Wheel





from matplotlib import pyplot
import numpy

import phaseportrait

def pendulum(θ, ):
    return , - numpy.sin(θ)

SimplePendulum = phaseportrait.PhasePortrait2D(pendulum, [-9, 9], Title='Simple pendulum', xlabel=r"$\Theta$", ylabel=r"$\dot{\Theta}$")
SimplePendulum.plot()

Documentation

To check out phaseportrait's documentation, view some examples and read more about it, check our website or try our Graphical User Interface!

Installation

Installing via pip:

Phaseportrait releases are available as wheel packages for macOS, Windows and Linux on PyPI. Install it using pip:

$ pip install phaseportrait

Installing from source:

Open a terminal on desired route and type the following:

$ git clone https://github.com/phaseportrait/phaseportrait

Manual installation

Visit phase-portrait webpage on GitHub. Click on green button saying Code, and download it in zip format. Save and unzip on desired directory.

What's this?

The idea behind this project was to create a simple way to make phase portraits in 2D and 3D in Python, as we couldn't find something similar on the internet, so we got down to work. (Update: found jmoy/plotdf, offers similar 2D phase plots but it is very limited).

Eventually, we did some work on bifurcations, 1D maps and chaos in 3D trayectories.

This idea came while taking a course in non linear dynamics and chaos, during the 3rd year of physics degree, brought by our desire of visualizing things and programming.

We want to state that we are self-taught into making this kind of stuff, and we've tried to make things as professionally as possible, any comments about improving our work are welcome!

Authors

Contributing

This proyect is open-source, everyone can download, use and contribute. To do that, several options are offered:

phaseportrait's People

Contributors

loracio avatar quanticpony avatar

Stargazers

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

Watchers

 avatar  avatar

phaseportrait's Issues

Interactive phaseportraits in jupyter notebooks

Comment rather than issue on using sliders in juptyer notebooks. In the current version one needs to load this in python. Below is one way to make it work in jupyter notebooks.

For example in the examples.ipynb, it currently says:

PolarCoordinates = PhasePortrait2D(dFPolar, [-3, 3], Polar=True, Title='Limit cycle')
PolarCoordinates.add_slider('μ', valinit=0.5)
PolarCoordinates.add_slider('η', valinit=0)
PolarCoordinates.plot()

One way to do this in jupyter notebook is:

from ipywidgets import interactive

# from https://stackoverflow.com/questions/12738031/creating-a-new-function-as-return-in-python-function
def dFPolar_outer(μ,η):
    def dFPolar_inner(r, θ, *, μ=μ,η=η):
        return μ*r*(1 - r*r), 1+η*θ
    return dFPolar_inner

def interactive_phaseportrait(μ,η):
    PolarCoordinates = PhasePortrait2D(dFPolar_outer(μ,η), [-3, 3], Polar=True, Title='Limit cycle')
    PolarCoordinates.plot()

interactive(interactive_phaseportrait, 
                                 μ = (0.0,1,0.1), 
                                 η = (0.0,1,0.1), 
            continuous_update=False)

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.