Comments (8)
The solution bundle method is used in this file - https://github.com/Isaac-Somerville/Neural-Networks-for-Solving-Differential-Equations/blob/main/ThreeBodyProblem/threeBodyOriginalMethod.py ?
Yes. The other files in the ThreeBodyProblem folder use this method as well, but also include curriculum learning
from neural-networks-for-solving-differential-equations.
Okay, also can you tell me if I use spring mass system where there are double derivatives, according to your naming system, would it be like.
x = trialSolution(x0, xOut, t)
dxTrial = dTrialSolution(xOut, dxOut, t)
d2xTrial = dTrialSolution(***, d2xOut, t)
What should be in place of ***?
should it be the value I get if I pass xOut through the network?
from neural-networks-for-solving-differential-equations.
For second derivatives, you would require another function, d2TrialSolution, that uses the analytic expression for the second derivative of trialSolution. It would look something like this:
def d2TrialSolution(varOut, dVarOut, d2VarOut, t):
"""
Second derivative w.r.t. t of trial solution for a given variable varOut at times t with initial values varInitial
Arguments:
varOut (tensor of shape (batchSize,1)) -- network output for variable at times t
dVarOut (tensor of shape (batchSize,1)) -- derivative of network output for variable w.r.t. t at times t
d2VarOut (tensor of shape (batchSize,1)) -- second derivative of network output for variable w.r.t. t at times t
t (tensor of shape (batchSize,1)) -- times at which variable is evaluated
Returns:
d2trialSoln (tensor of shape (batchSize,1)) -- second derivative of trial solution for given variable at
times t with initial values varInitial"""
# d2TrialSoln = (torch.exp(-t)) * dVarOut + ((1 - torch.exp(-t)) * d2VarOut) - torch.exp(-t) * varOut + torch.exp(-t) * dVarOut
d2TrialSoln = ((1 - torch.exp(-t)) * d2VarOut) + (torch.exp(-t) * (2 * d2VarOut - varOut))
return d2TrialSoln
In the train function you would be required to evaluate d2xOut in the same was dxOut was calculated:
d2xOut = grad(dxOut,t,torch.ones_like(dxOut),retain_graph=True, create_graph=True)[0]
Problems 5, 7 and 8 have more examples of doing this for second derivatives, as well as calculating mixed partial derivatives using autograd.
Hope this helps!
from neural-networks-for-solving-differential-equations.
@Isaac-Somerville
https://github.com/Isaac-Somerville/Neural-Networks-for-Solving-Differential-Equations/blob/main/LagarisProblems/prob5.py
Is this and prob7 and prob8 in LagarisProblems folder are using solution bundle?
from neural-networks-for-solving-differential-equations.
from neural-networks-for-solving-differential-equations.
Okay, and should it be d2TrialSoln = ((1 - torch.exp(-t)) * d2VarOut) + (torch.exp(-t) * (2 * dVarOut - varOut))
from neural-networks-for-solving-differential-equations.
Yes that's right
from neural-networks-for-solving-differential-equations.
@Isaac-Somerville
adam.txt
I modified your code to work for spring mass dampener system (md2x/dt2 + bdx/dt + k(x-L)=0). But, for me it doesn't give promising results. Can you suggest what changes I need to make?
from neural-networks-for-solving-differential-equations.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neural-networks-for-solving-differential-equations.