I am interesting in modelling a damage model, where if a PINNs output exceeds a value then the governing equations changes, in linear elastic model only i need to check for the energy associated with deformation, and when it exceeds a certain value it needs to change the governing equation.

I am interested in solving: {r1, r2 are pre-defined, |p| is value associated with energy, f is variable of interest}

f = -Max(|p| - r1,0)/r2

Unfortunately, the Max is not working,

Thus I tried to approach the same by defining criteria check on by importing the equations for the same. But then it encounters type error with Sympy and float and I am unable to convert the sympy to numpy/float

Max should work, its registered in our sympy converter. With no additional information, its hard to tell what the issue is. One option could be to rewrite this function to use the Heaviside operator instead:

a = (|p| - r1)
f = -Heaviside(a) * (a) / r2

Edit: I’m assuming this is referring this error here:

line 376, in __nonzero__
raise TypeError("cannot determine truth value of Relational")
TypeError: cannot determine truth value of Relational
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

For documentation purposes, this is a continuation of this thread: