juliagni / geometricproblems.jl Goto Github PK
View Code? Open in Web Editor NEWExample problems for GeometricIntegrators.jl
License: MIT License
Example problems for GeometricIntegrators.jl
License: MIT License
@JuliaRegistrator register
@JuliaRegistrator register
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
We should have the same names for similar things in all the modules, i.e. parameters
-> params
, Δt
-> tstep
etc.
Can you give a reference in the docs for this problem?
Also, the problem is now formulated in math terms using Symbolics.jl and moving away from MTK.jl. I suggest using and testing modelingtoolkitize
to preserve the generality of GeometricProblems.
The plots in the docs should not depend on GeometricMachineLearning. @benedict-96 please redo those without relying on GeometricMachineLearning.
The following code has been removed for now:
```@example
HTML("""<object type="image/svg+xml" class="display-light-only" data=$(joinpath(Main.buildpath, "images/coupled_harmonic_oscillator.png"))></object>""") # hide
```
```@example
HTML("""<object type="image/svg+xml" class="display-dark-only" data=$(joinpath(Main.buildpath, "images/coupled_harmonic_oscillator_dark.png"))></object>""") # hide
```
The following shows the ``q_1`` component of the system for different values of ``k``:
```@example
using GeometricIntegrators: integrate, ImplicitMidpoint # hide
using GeometricProblems.CoupledHarmonicOscillator: hodeproblem, default_parameters, tspan, tstep, q₀, p₀ # hide
using GeometricEquations: EnsembleProblem # hide
using GeometricMachineLearning: DataLoader # hide
using Plots # hide
# hide
const m₁ = default_parameters.m₁ # hide
const m₂ = default_parameters.m₂ # hide
const k₁ = default_parameters.k₁ # hide
const k₂ = default_parameters.k₂ # hide
const k = [0.0, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0] # hide
# hide
params_collection = [(m₁ = m₁, m₂ = m₂, k₁ = k₁, k₂ = k₂, k = k_val) for k_val in k] # hide
ensemble_problem = EnsembleProblem(hodeproblem().equation, tspan, tstep, (q = q₀, p = p₀), params_collection) # hide
ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint()) # hide
# hide
dl = DataLoader(ensemble_solution) # hide
q₁ = dl.input.q[1, :, :] # hide
h = tspan[2] / (size(q₁, 1) - 1) # hide
t = 0.0:h:tspan[2] # hide
n_param_sets = length(params_collection) #hide
labels = reshape(["k = "*string(params.k) for params in params_collection], 1, n_param_sets) # hide
# hide
const one_plot = false # hide
const psize = (900, 600) # hide
plot_q₁ = one_plot ? plot(t, q₁, size=psize) : plot(t, q₁, layout=(n_param_sets, 1), size=psize, label=labels, legend=:topright) # hide
```
@JuliaRegistrator register
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.