Skip to content

tharunnayak14/Solving-Differential-Equations-using-Neural-Networks-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Solving-Differential-Equations-using-Neural-Networks-

Consider the first order ODE: dΨ(x)/dx = f(x, Ψ) (1)

with x ∈ [0, 1] and with the Initial Condition Ψ(0) = A.

A trial solution is written as: Ψtrial(x) = A + xN(x, p)
where N(x, p) is the output of a ANN with one input unit for x and weights p.
Now all we need is a loss function, Ψtrial(x) is the solution of the differential equation

d Ψtrial(x) /dx ≈ f(x, Ψtrial)
d Ψtrial(x) /dx - f(x, Ψtrial) ≈ 0 (2)

we are trying to do is get (2) close to zero, then our trial solution approximates the analytical solution to a great accuracy.

So we define the loss function as:

LOSS = ∑{ (d Ψtrial(x) /dx) - f(x, Ψtrial) }2    for all x ∈ [0, 1]

Now we can use this loss to compute the gradients and do weight updation


Question 1


question1

  Ψ(0) = 0 and x ∈ [0, 2]

2021-12-03 13 34 43 localhost a9f9d05fcd77


Question 2


qu2

  Ψ(0) = 1 and x ∈ [0, 1]

2021-12-03 13 36 30 localhost 768b914a053a

Consider the 2nd order ode:

d2Ψ(x)/dx2 = f(x, Ψ, dΨ/dx)


2021-12-01 21 47 34 arxiv org 46bf989a93d7

2021-12-01 21 44 45 arxiv org 482d49c0b910

The loss function is same as in the case of first order ode


Question 3


2021-12-01 21 41 29 arxiv org d6d2402de42c

  Ψ(0) = 1, dΨ(0)/dx = 1, x ∈ [0, 2]

2021-12-03 13 38 59 localhost 7b533322a39a


Question 4


2021-12-01 21 41 29 arxiv org d6d2402de42c

  Ψ(0) = 1, Ψ(1) = sin(1)*e^(-1/5), x ∈ [0, 1]

2021-12-03 13 43 36 localhost bf27478d0ae6

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors