Skip to content

Time dependent boundary conditions from an empirical function #612

Answered by david-zwicker
SpectroEric asked this question in Q&A
Discussion options

You must be logged in to vote

I guess the right hand side of the expression is interpreted as a sympy expression, so it might not be surprising that only the sympy implementation of the function works. Instead of using a sympy function, you could also directly use a python function with signature func(value, dx, x, t), i.e., the following might work

def sini(value, dx, x, t):
        cases = 3          # try the different cases
        match cases:
            case 2:
                erg = np.sin(t)
            case 3:
                erg = np.interp(t, zeiten, zeitwerte)
            case 4:
                erg = interp_nb(t, zeiten, zeitwerte)
        return erg

eq = PDE({"c": "laplace(c)"}, bc={"value_expression": s…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SpectroEric
Comment options

@david-zwicker
Comment options

Answer selected by SpectroEric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants