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

Multiple hard constraints problem setups #1909

Open
lihangshiwo opened this issue Dec 6, 2024 · 0 comments
Open

Multiple hard constraints problem setups #1909

lihangshiwo opened this issue Dec 6, 2024 · 0 comments

Comments

@lihangshiwo
Copy link

lihangshiwo commented Dec 6, 2024

dear lulu,
I am trying to solve a simple problem with two different Dirichlet conditions, on the left boundary E=0 and on the inner circular boundary E=x+y (sum of horizontal and vertical coordinates), the problem is schematically shown below:

L0XPMUDW)5RWN7C055X%6IM

Defining these two hard boundaries separately is as simple as the following code:

def output_transform(inputs, outputs):
    x, y= inputs[:, 0:1], inputs[:, 1:2]

    R_square = R ** 2
    dist_square = x ** 2 + y ** 2
    res = dist_square - R_square

    E1 = x + y + res * outputs

    return E1

and

def output_transform(inputs, outputs):
    x, y = inputs[:, 0:1], inputs[:, 1:2]

    E2 = (1 - torch.exp(x-(-1))) * outputs
    return E2

But when I try to satisfy them all at the same time, I don't know how, and here's a failed attempt:

def output_transform(inputs, outputs):
    x, y= inputs[:, 0:1], inputs[:, 1:2]

    R_square = R ** 2
    dist_square = x ** 2 + y ** 2
    res = dist_square - R_square

    E = (x + y + res * outputs)* (1 - torch.exp(x-(-1)))

    return E

The problem doesn't seem to be very complicated, any help from anyone would be appreciated!

@lihangshiwo lihangshiwo changed the title Multiple hard border problem setups Multiple hard constraints problem setups Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant