Skip to content

Instantly share code, notes, and snippets.

@moustachio-belvedere
Created February 16, 2020 23:31
Show Gist options
  • Save moustachio-belvedere/767ad779f1ee1f286615b20aa445dc11 to your computer and use it in GitHub Desktop.
Save moustachio-belvedere/767ad779f1ee1f286615b20aa445dc11 to your computer and use it in GitHub Desktop.
using RHEOS
dt = 0.01;
t = collect(0.0:dt:10.0);
# fm_model = Fract_Maxwell.Ga(t, [1.0, 1.0, 1.0, 0.0]);
# maxwell = Maxwell.Ga(t, [1.0, 1.0]);
# all(i -> isapprox(fm_model[i], maxwell[i]), eachindex(t))
testmodel = RheoModelClass(
# Model name
name="fractmaxwell",
# Model parameters,
p = [:cₐ, :a, :cᵦ, :β],
# Relaxation modulus
G = quote
cᵦ*t^(-β)*mittleff(a - β, 1 - β, -cᵦ*t^(a - β)/cₐ)
end,
# Constraints
constraint = quote
all([ (a<1) & (a>0)
(β<1) & (β>0)
-a+β < 0 ])
end
);
testmodeloutput = testmodel.Ga(t, [1.0, 1.0, 1.0, 0.5]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment