Giter Site home page Giter Site logo

Comments (4)

pmli avatar pmli commented on June 12, 2024

What do you want to use this for? To create a constant time-dependent parameter? That can be done with the following:

from pymor.parameters.base import Parameters

n = 2
mu = Parameters(t=1, f=n).parse({'t': 1.5, 'f': str(n * [1])})
mu       # Mu({'f': ExpressionFunction('[1, 1]', variable='t'), 't': array([1.5])})
mu['t']  # array([1.5])
mu['f']  # array([1, 1])

Although, if the time-dependent parameter is constant, it could just be a regular parameter.

from pymor.parameters.base import Parameters

n = 2
mu = Parameters(t=1, f=n).parse({'t': 1.5, 'f': n * [1]})
mu       # Mu({'f': array([1, 1]), 't': array([1.5])})
mu['t']  # array([1.5])
mu['f']  # array([1, 1])

It would probably still be good for parse to give better error messages or even make it work with ConstantFunctions.

from pymor.

artpelling avatar artpelling commented on June 12, 2024

What do you want to use this for? To create a constant time-dependent parameter?

Thanks for the snippets. I am using it here as an input to compute which only accepts a NumPy array or Function.

from pymor.

sdrave avatar sdrave commented on June 12, 2024

What do you want to use this for? To create a constant time-dependent parameter?

Thanks for the snippets. I am using it here as an input to compute which only accepts a NumPy array or Function.

I'm confused. Wouldn't it be more straightforward (and efficient) to use input = np.zeros(self.dim_input)?

from pymor.

artpelling avatar artpelling commented on June 12, 2024

I'm confused. Wouldn't it be more straightforward (and efficient) to use input = np.zeros(self.dim_input)?

Good point. In this case yes. In impulse_resp, however, I need a Function.

from pymor.

Related Issues (20)

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.