Skip to content

Multiple hard constraints problem setups #1909

Open
@lihangshiwo

Description

@lihangshiwo

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions