Comments (4)
Sure, i'll have a look tomorrow
from universal_differential_equations.
@RajDandekar I don't get any error when I run this code, I guess part of it is missing, but yeah, you need
tspan = (0.0f0,6.2831f0)
tsave = range(tspan[1],tspan[2],length=100)
inside: function find_σ_exact(tsave,γd)
if you want to solve the original. I don't know if that's what you need though...
from universal_differential_equations.
Oh wait, I forgot to add the Optimization line. I get the error when I try to optimize the parameters using the below lines of code:
##ERROR: NO METHOD MATCHING LENGTH (SCIML NullParameters)
adtype = Optimization.AutoZygote()
optf = Optimization.OptimizationFunction((x,p) -> loss_adjoint(x,γd), adtype)
optprob = Optimization.OptimizationProblem(optf, α)
res1 = Optimization.solve(optprob, ADAM(0.0001), callback = callback, maxiters = 15000)
@ccrnn Now you should get the error
from universal_differential_equations.
So, I found an error, but it's not the error you need... Something to do with tsave was causing a stack overflow. The solver works with a simplification:
using DiffEqFlux, Lux, Flux
using DifferentialEquations
using Plots, Statistics
using Sundials, Optimization, OptimizationFlux
function FENEP!(out,du,u,p,t,γd)
# DAE definition for FENE-p
θ₁₁,θ₂₂,θ₁₂, τ₁₁,τ₂₂,τ₁₂ = u
λ,η,L = [2.0, 2.0, 4.0]
a = L^2 /(L^2 -3)
fλ = (L^2 + (λ/η/a)*(τ₂₂+τ₁₁))/(L^2 - 3)
out[1] = τ₁₁ + du[1] - 2*λ*γd(t)*τ₁₂/fλ
out[2] = τ₂₂ + du[2]
out[3] = τ₁₂ + du[3] - λ*γd(t)*τ₂₂/fλ - η/fλ * γd(t)
out[4] = θ₁₁ - λ*τ₁₁/fλ
out[5] = θ₂₂ - λ*τ₂₂/fλ
out[6] = θ₁₂ - λ*τ₁₂/fλ
end
#function find_σ_exact(tsave,γd)
# finds the exact solution of the FENE-p equations given a strain rate fn and
# time points to save at
ω = 1.0f0
γd = t -> 12.0f0*cos.(ω.*t)
λ = 2.0
L = 2.0
η = 4.0
p = [λ,η,L]
u₀ = zeros(6)
du₀ = [0.0, 0.0, η*γd(0.0)*(L^2-3)/L^2, 0.0,0.0,0.0]
tspan = (0.00,6.00)
tsave = 0.06
differential_vars = [true,true,true,false,false,false]
h(out, du,u,p,t) = FENEP!(out, du,u,p,t,γd)
prob = DAEProblem(h,du₀,u₀,tspan,differential_vars=differential_vars)
sol = solve(prob,IDA(),saveat=Float64.(tsave))
return [Float32(σ[6]) for σ in sol.u]
But your error is still happening.
Past this, I just don't understand well enough what is going on - I don't really understand what is being predicted or how f0, f1, etc are related to the model. Why f0 has 2 inputs to the chain. etcetc. I never saw the original working of this, so it makes it (even) more difficult. Sorry to not be more help!
from universal_differential_equations.
Related Issues (20)
- "MethodError: objects of type SparseIdentificationResult are not callable"
- issue with regression with SInDy HOT 4
- line 207 error DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths 22 and 106") HOT 1
- recompile after activating HOT 1
- type SparseIdentificationResult has no field basis HOT 15
- `MethodError: no method matching SInDy` in DelayLotkaVolterra/VolterraExp.jl HOT 12
- Application to a different system of ODEs HOT 4
- training method for multiple neural-nets in universal ODEs HOT 2
- Instability detected in Fisher-KPP example HOT 4
- LotkaVolterra manifest file outdated HOT 12
- Lotka volterra UDE not recovered as per paper HOT 6
- outdated / soon to be outdated example codes HOT 1
- Has this paper been published on a journal or a conference? HOT 1
- UDE giving Linear Approximation / NeuralODEMM problems
- SEIR Example HOT 8
- Hudson Bay HOT 17
- LV Scenario 2 HOT 4
- OptimizationFunction Definition HOT 3
- No matching function wrapper found HOT 5
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 universal_differential_equations.