Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-formulation of PolynomialProperty #364

Open
dlohmeier opened this issue Mar 14, 2022 · 0 comments
Open

Re-formulation of PolynomialProperty #364

dlohmeier opened this issue Mar 14, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dlohmeier
Copy link
Collaborator

Problem description
There is a fluid property called FluidPropertyPolynominal. In the constructor, a list of x- and y-values is required. It then converts it to a set of parameters for a polynomial through a fit:

    const = np.polyfit(x_values, y_values, polynominal_degree)
    self.prop_getter = np.poly1d(const)

I think that this is not exactly the preferred behavior for this property, as we would like to hand over the parameters to the constructor.

Possible solution
My suggestions:

  • change the constructor such that it receives the polynomial parameters (the const) directly
  • create a @classmethod that does the polynomial fit for x- and y-values and hands the result over to the constructor
  • it might make sense to integrate the linear property into the polynomial property (or make it inherit from it)

Could we make such a change? Especially @jkisse @SimonRubenDrauz

@dlohmeier dlohmeier added the enhancement New feature or request label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant