Skip to main content

Adaptive multi-index stochastic collocation (surrogates) for metamodeling of multidisciplinary systems

Project description

Logo pdm-managed PyPI Python 3.11 Commits build docs tests Coverage Status Algorithm description

Efficient framework for building surrogates of multidisciplinary systems. Uses the adaptive multi-index stochastic collocation (AMISC) technique.

Installation

We highly recommend using pdm:

pip install --user pdm
cd <your-project>
pdm init
pdm add amisc

However, you can also install normally:

pip install amisc

To install from an editable local directory (e.g. for development), first fork the repo and then:

git clone https://github.com/<your-username>/amisc.git
pdm add -e ./amisc --dev  # or..
pip install -e ./amisc    # similarly

This way you can make changes to amisc locally while working on some other project for example. You can also quickly set up a dev environment with:

git clone https://github.com/<your-username>/amisc.git
cd amisc
pdm install  # reads pdm.lock and sets up an identical venv

Quickstart

import numpy as np

from amisc.system import SystemSurrogate, ComponentSpec
from amisc.rv import UniformRV

def fun1(x):
    return dict(y=x * np.sin(np.pi * x))

def fun2(x):
    return dict(y=1 / (1 + 25 * x ** 2))

x = UniformRV(0, 1, 'x')
y = UniformRV(0, 1, 'y')
z = UniformRV(0, 1, 'z')
model1 = ComponentSpec(fun1, exo_in=x, coupling_out=y)
model2 = ComponentSpec(fun2, coupling_in=y, coupling_out=z)

inputs = x
outputs = [y, z]
system = SystemSurrogate([model1, model2], inputs, outputs)
system.fit()

x_test = system.sample_inputs(10)
y_test = system.predict(x_test)

Contributing

See the contribution guidelines.

Citations

AMISC paper [1].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amisc-0.2.1.tar.gz (84.7 kB view hashes)

Uploaded Source

Built Distribution

amisc-0.2.1-py3-none-any.whl (79.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page