Skip to content

Commit ec1a596

Browse files
committed
add example for transient sensitivity
1 parent 9b84725 commit ec1a596

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

examples/ModelBig.mat

3.81 MB
Binary file not shown.

examples/test_bm.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using DJUICE
2+
using MAT
3+
using GLMakie
4+
5+
#Load model from MATLAB file
6+
file = matopen(joinpath(@__DIR__, ".", "","ModelBig.mat"))
7+
8+
mat = read(file, "md")
9+
close(file)
10+
md = model(mat, friction=DJUICE.SchoofFriction())
11+
12+
md.timestepping.time_step = 0.1
13+
#make model run faster
14+
#md.stressbalance.maxiter = 100
15+
#
16+
##Now call AD!
17+
md.inversion.iscontrol = 1
18+
#md.friction.coefficient = 30*ones(size(md.friction.coefficient))
19+
md.inversion.independent = md.friction.C
20+
md.inversion.independent_string = "FrictionC"
21+
md.inversion.dependent_string = ["IceVolumeAboveFloatation"]
22+
md.inversion.vx_obs = md.initialization.vx
23+
md.inversion.vy_obs = md.initialization.vy
24+
25+
26+
#md = solve(md, :sb)
27+
md = solve(md, :Transient)
28+
29+
# the gradient
30+
#g = md.results["StressbalanceSolution"]["Gradient"]
31+
32+
#plotmodel(md, abs.(g), caxis=(0.0,5e-3))

0 commit comments

Comments
 (0)