Code Snippets Julia

Short texts Julia 🧑‍💻 Code snippets Julia ✍️ Reading lists Julia 👀

Closed-loop control SingularException

using ModelingToolkit, OrdinaryDiffEq @parameters t D = Differential(t) @variables u(t) function Mass(; name, m = 1.0, p = 0, v = 0) ps = @parameters m=m sts = @variables pos(t)=p vel(t)=v eqs = D(pos) ~ vel ODESystem(eqs, t, [pos, vel], ps; name) end function Spring(; name, k = 1e4) ps = @parameters k=k @variables x(t)=0 […]

dtable_bench2.jl

using Dagger using Random using BenchmarkTools using OnlineStats rng = MersenneTwister(1111) n = 10_000_000 max_chunksize = 100_000 # data = (;[Symbol(“a$i”) => abs.(rand(rng,Int64, n)).%10_00 for i in 1:10]…) f = () -> while true sleep(0.2); println(length(Dagger.Sch.EAGER_STATE.x.running)) end [email protected] 10+10 #@async f() # create d = DTable((;[Symbol(“a$i”) => abs.(rand(rng,Int64, n)).%10_000 for i in 1:10]…), max_chunksize) println(“first […]

Accounting_is_hard.jl

### A Pluto.jl notebook ### # v0.16.1 using Markdown using InteractiveUtils # ╔═╡ 0a227e14-2a08-11ec-19e3-63e2b9f982d8 αρχικό = 100 # ╔═╡ d5540579-07c5-4a8e-9a9a-672b4fb72793 ΦΠΑ = 1.24 # ╔═╡ b7281bd9-3c55-4c21-ae73-59f396ea225c μαρκάπ = 1.424 # ╔═╡ b840e533-0ad8-4268-ae2a-075a28c407a4 τελικό = αρχικό * μαρκάπ * ΦΠΑ # ╔═╡ 733d86f3-76a1-4a76-ae7e-ac9f186592b2 προμήθεια_σκρουτζ = 0.08 # ╔═╡ 6cf5293c-cbf8-4084-8746-34c79ce2548f σκρουτζ = τελικό * προμήθεια_σκρουτζ # ╔═╡ […]

Hierarchical MPT Turing

[deps] Distributions = “31c24e10-a181-5473-b8eb-7969acd0382f” Memoization = “6fafb56a-5788-4b4e-91ca-c0cea6611c73” ReverseDiff = “37e2e3b7-166d-5795-8a7a-e32c996b4267” Turing = “fce5fe82-541a-59a6-adf8-730c64b5f9a0” [compat] Distributions = “0.25.0” Memoization = “0.1.0” ReverseDiff = “1.9.0” Turing = “0.18.0” import Distributions: rand, logpdf, loglikelihood struct Model{T1,T2,T3}

Hierarchical MPT Turing

[deps] Distributions = “31c24e10-a181-5473-b8eb-7969acd0382f” Memoization = “6fafb56a-5788-4b4e-91ca-c0cea6611c73” ReverseDiff = “37e2e3b7-166d-5795-8a7a-e32c996b4267” Turing = “fce5fe82-541a-59a6-adf8-730c64b5f9a0” [compat] Distributions = “0.25.0” Memoization = “0.1.0” ReverseDiff = “1.9.0” Turing = “0.18.0” import Distributions: rand, logpdf, loglikelihood struct Model{T1,T2,T3}