How to model diffusion through a membrane?

This is a follow-up on How to handle discontinuity in diffusion coefficient?

Consider diffusion of $ u(t,x)$ on the domain $ x \in [0,2]$ with some simple boundary conditions such as $ u(0) = 2, u(1) = 1$ .

Our domain is split into two parts: $ [0,1)$ on the left and $ (1,2]$ on the right, with different diffusion coefficients, e.g. $ D^\text{left} = 1, D^\text{right} = 3$ .

The diffusion equation is: $ $ \partial_t u = \partial_x (D \partial_x u) $ $

So far, this is the summary of the linked question.


This time we also have a membrane at $ x=1$ , imposing the following condition on the fluxes at $ x=1$ : $ $ D^\text{left} \partial_x u^\text{left} = D^\text{right} \partial_x u^\text{right} = d^\text{membrane} (u^\text{right} – u^\text{left}) $ $

What is the cleanest way to model this with NDSolve? Is there a way to preserve the sharp conditions at $ x=1$ ? Perhaps one approximation that could be used is to consider a membrane of finite thickness, having a very high diffusion coefficient of its own. However, this is really a hack. Is it possible to solve the equation on the two half-domains “separately” and couple the boundary conditions at $ x=1$ ?

training SimpLE model for link prediction on knowledge graph

Referring to this paper by Prof Kazemi, Prof Poole on SimpLE model for link prediction on knowledge graph.

In page 3, the paragraph on learning SimpLE Models, I understand that we have a batch of positive triples from the knowledge graph, where for each positive triple in the batch, we generate $ n$ negative triple by corrupting it. So does that mean the batch size just increased by a factor of $ n$ and there are only negative examples in the batch?

I think I understand the optimization function but I don’t understand how we generated the labeled batch. Clarification would help!

Is Artificial intelligence simply taking decisions on the basis of values produced by a machine learning model

I am researching on AI and its working. Whenever I try to search for AI algorithms, ML algorithms come up. Then, I read the differences between ML & AI. One of the key points mentioned was “AI is decision making” & “Machine learning is generating values and learn new things”.

I come up with a conclusion that ML allows us to take generate some sort of values and using AI we can make decisions with those values.

But I am confused with “The weather forecast” problem. Our machine learning model will directly generate the decision that will it rain or not? Is our ML model lies in the AI domain or I am wrong? Help me!

Database design – model a ‘Company’ with ‘Owner’, ‘Partner’, ‘Employee’

I’m working on an app that has mainly two entities: Company and User. A User can be an employee, owner, or a partner.

My current approach of modelling this is: enter image description here

Capacity is enum with possible values: employee, owner, partner

Someone got me confused suggesting I should have three separate tables for each of these capacities, which I don’t think is right.

I’m terribly unsure whether the capacity could grow to more in future.

Should I create another capacity table and reference it in Personnel as a foreign key, in case we wish to add more capacity? Would that be a scalable (and right) approach?

Thank you.

What is Herbrand interpreration and model?

I was reading the book “Foundations of Logic Programming” written by J.W.LIoyd. In the book, there were definitions of interpretation and model, and when it comes to herbrand interpretation and model, I am having difficulties. It provided an example, but I did not understand it.

Example. Let $ S$ be $ \{ p(a), \exists x \~p(x) \}$ . Note that the second formula $ S$ is not a clause. We claim that $ S$ has a model. It suffices to let $ D$ be the set $ \{ 0,1\}$ , assign 0 to $ a$ and assign to $ p$ the mapping which maps 0 to true and 1 to false. Clearly this gives a model for $ S$ . However, $ S$ does not have an Herbrand model. This only Herbrand interpretations for $ S$ are $ \emptyset$ and $ \{ p(a)\}$ . But neither of these is a model for $ S$ .

In my understanding, by assigning 0 to $ a$ and 1 to $ x$ to the formulas of $ S$ make them true:

$ $ p(0) = true $ $

$ $ \exists x \~p(x)[x/1] = \~p(1) = true $ $

Therefore, $ \{ 0,1\}$ is a model for $ S$ But I did not really understand how do we know $ [a=0,x=1]$ is not a herbrand model for $ S$ .

I asked the question in Theoretical Computer Science section, however was advised to post in CS. Could anyone explain it to me? Thanks in advance.