Marey.Sim
0.7.0
dotnet add package Marey.Sim --version 0.7.0
NuGet\Install-Package Marey.Sim -Version 0.7.0
<PackageReference Include="Marey.Sim" Version="0.7.0" />
<PackageVersion Include="Marey.Sim" Version="0.7.0" />
<PackageReference Include="Marey.Sim" />
paket add Marey.Sim --version 0.7.0
#r "nuget: Marey.Sim, 0.7.0"
#:package Marey.Sim@0.7.0
#addin nuget:?package=Marey.Sim&version=0.7.0
#tool nuget:?package=Marey.Sim&version=0.7.0
Marey.Sim
Simulation for Marey, a dimensionally-typed visualization system for F#. A simulation is a start and a step, and its trajectory is an animation: it seeks, it films, and a seek to any time is exactly the state a straight run reaches.
#r "nuget: Marey.Sim"
#r "nuget: Marey.Backend.Svg"
open Marey
open Marey.UnitsOfMeasure
// A driven, damped pendulum: an angle in rad and a rate in rad/s, stepped by RK4 at 1 ms.
let pendulum: Flow2T<rad, rad/s, s> =
fun t th om -> struct (om, -9.81<rad/s^2> * sin (float th) - 0.2</s> * om + 0.5<rad/s^2> * cos (1.3 * float t))
let sim = Sim.ofStep 1e-3<s> (Ode.rk4 pendulum) (struct (0.5<rad>, 0.0<rad/s>))
let trajectory = Sim.trajectory 1.0<s> 60.0<s> sim
let path = Array.init 600 (fun i -> trajectory.At(float i * 0.1<s>))
Chart.line Derived.radian (U.div Derived.radian U.second) (path |> Array.map (fun (struct (th, _)) -> th)) (path |> Array.map (fun (struct (_, om)) -> om))
|> Chart.toSvg SvgBackend.render "pendulum.svg" (Chart.size 640.0 480.0)
- Integrators typed by the shape of the state.
Ode.verletandOde.leapfrogover positions and velocities in one unit, with the acceleration checked to be in that unit per second squared;Ode.euler,Ode.rk4andOde.dopri5(Dormand–Prince 4(5), dense output) over a plane flow with time; andeulerWith,rk4With,dopri5Withover any record given aTangent. A rate in the wrong unit does not compile. - Trajectories.
Sim.trajectory every horizoncheckpoints one straight run and seeks by replay, bit for bit equal to the run, on any thread. Invariants (Sim.withInvariant) and their drift (Sim.drift,Drift.chart). - Events. A function of the state crossing zero, located in time, with a response; a minimum
separation ends a Zeno sequence at rest instead of looping.
Collide.stepresolves hard-disc contacts exactly within a step, with a grid broad phase. - Sections and particles.
Poincare.stroboscopicandPoincare.section.Unsteadyfields, analytic or from grids (ofSnapshots,ofFunction), carried byParticles.stepstage by stage; streaklines and pathlines. - Grid solvers.
Fdm.heat(explicit, with its stability limit refused in seconds),Fdm.heatImplicit(Crank–Nicolson by ADI),Fdm.wave,Fdm.poisson, on the compact five-point stencil with Dirichlet, Neumann and periodic sides. - Fluids.
Stam.step, stable fluids on a staggered grid with the pressure by multigrid, walls or periodic edges, viscosity, a dye in its own unit and a buoyancy per unit of it;Lbm.step, lattice Boltzmann D2Q9 with obstacles, walls, an inflow and an outflow, refusing a relaxation time at or below ½ with the numbers.Marey.Backend.Gpusteps both on a GPU (GpuSim).
Compiles under Fable. A chaotic system run in a browser and the same one under .NET are different
trajectories after tens of seconds, because JavaScript's sin and exp differ in the last bit;
both are correct to the integrator's order.
- The guide's chapter
- Examples:
integrators.fsx,double-pendulum.fsx,double-gyre.fsx,heat.fsx,fluid.fsx,cylinder.fsx
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FSharp.Core (>= 8.0.100)
- Marey.Anim (>= 0.7.0)
- Marey.Core (>= 0.7.0)
- Marey.Fields (>= 0.7.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Marey.Sim:
| Package | Downloads |
|---|---|
|
Marey.Backend.Gpu
GPU rendering for Marey: Skia on OpenGL, with batched marks drawn by the GPU directly. A figure, a film's frames or a million points, offscreen; fluid solvers and LIC on the GPU. |
GitHub repositories
This package is not used by any popular GitHub repositories.