Skip to content

Instantly share code, notes, and snippets.

using DifferentialEquations
using Plots
function all_model(dz,z,h,p,t)
b0,k0,T1,L1,g1l,a1,Al,t3,t4,et1,et2,m1,ka,kel,kpt,Kt,erel,km,vpt,kte,Km,d,g2l,g0,k,x,th1,th2,Rm,R50,a,n,tau1,tau2 = p
hist1 = h(p,t-tau1)[1]
hist2 = h(p,t-tau1)[3]
hist3 = h(p,t-tau2)[1]
hist4 = h(p,t-tau2)[3]
hist5 = h(p,t-tau1)[7]
ERROR: BoundsError: attempt to access 1-element Array{Float64,1} at index [2]
Stacktrace:
[1] getindex(::Array{Float64,1}, ::Int64) at ./array.jl:744
[2] ode_interpolation(::Float64, ::Function, ::Nothing, ::Type, ::Tuple{Float64,Float64,Float64,Float64,Float64,Int64,Int64,Float64,Float64,Float64,Float64,Int64,Float64,Int64,Float64,Float64,Float64,Float64,Int64,Float64,Float64,Int64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Float64,Int64,Float64,Int64}, ::Symbol) at /home/andrei/.julia/packages/OrdinaryDiffEq/6TJck/src/dense/generic_dense.jl:275
[3] InterpolationData at /home/andrei/.julia/packages/OrdinaryDiffEq/6TJck/src/interp_func.jl:73 [inlined] (repeats 2 times)
[4] #_#27(::Nothing, ::DelayDiffEq.HistoryFunction{var"#h0#47"{Array{Float64,1}},DelayDiffEq.HistoryODEIntegrator{BS3,true,Array{Float64,1},Float64,Float64,Array{Array{Float64,1},1},ODESolution{Float64,2,Array{Array{Float64,1},1},Nothing,Nothing,Array{Float64,1},Array{Array{Array{Float64,1},1},1},ODEProblem{Array{Float6
-module(hwork1).
-export([area/1,perimeter/1,enclose/1,bits/1,bits_tail/1]).
max_three(X,Y,Z)->
max(max(X,Y),Z).
area({circle,{_X,_Y},R})->
math:pi()*R*R;
area({rectangle,{_X,_Y},H,W}) ->
-module(index_hw).
-export([get_file_contents/1,show_file_contents/1,main/1]).
% Used to read a file into a list of lines.
% Example files available in:
% gettysburg-address.txt (short)
% dickens-christmas.txt (long)
% Get the contents of a text file into a list of lines.
-module(hofs).
-export[double_All/1,evens/1,prod/1,zip/2,zip_with/3,zip_with_hof/3,zip_hof/2].
double(X)->
2*X.
double_All(Lst) ->
lists:map(fun double/1, Lst).
even(X) ->
X rem 2 == 0.
-module(rps).
-export([tournament/2]).
beat(rock) ->
paper;
beat(scissors) ->
rock;
beat(paper) ->
scissors.
lose(rock)->
@adhalanay
adhalanay / super.erl
Created August 11, 2020 09:50
Supervisor assignment
-module(super).
-export([super/0]).
super() ->
process_flag(trap_exit, true),
E = spawn_link(echo,listener,[]),
register(echo,E),
io:format("echo spawned.~n"),
T = spawn_link(talk,worker,[]),
register(talk,T),