Skip to content

Commit c6fee39

Browse files
committed
Updated fitpredict.jl docs
1 parent d8b9cd5 commit c6fee39

File tree

3 files changed

+28
-38
lines changed

3 files changed

+28
-38
lines changed

docs/src/fitpredictFreq.jl

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,22 @@ rheofreqdatatype(data_ext)
5959

6060
fractKV_predict = dynamicmodelpredict(data_ext, FractKV_model)
6161

62-
## Now we can plot data and model together for comparison
62+
# Now we can plot data and model together for comparison
6363
using Plots
64-
65-
# Create the plot
64+
## Create the plot
6665
p = plot(
6766
xaxis = :log10,
6867
yaxis = :log10,
6968
xlabel = "Frequency",
7069
ylabel = "Storage and Loss moduli",
71-
legend = :topright
70+
legend = :topright, linewidth=4, framestyle = :box
7271
)
73-
74-
# Plot data points
72+
## Plot data points
7573
scatter!(p, data.ω, data.Gp, markersize = 5, color = :blue, label = "Gp data")
7674
scatter!(p, data.ω, data.Gpp, markersize = 5, color = :red, label = "Gpp data")
77-
78-
# Plot model predictions
75+
## Plot model predictions
7976
plot!(p, fractKV_predict.ω, fractKV_predict.Gp, linestyle = :dash, color = :blue, label = "Gp model")
8077
plot!(p, fractKV_predict.ω, fractKV_predict.Gpp, linestyle = :dash, color = :red, label = "Gpp model")
81-
8278
#!nb p #hide
8379

8480
# #### Simulate Different Model Behaviours
@@ -96,13 +92,12 @@ dσ = stressfunction(dσ, hstep())
9692
FractKV_creepPredict = modelsteppredict(dσ, FractKV_model)
9793
## Visualisation of the simulated response
9894
using Plots
99-
10095
p = plot(size = (700, 500) )
10196
plot!(p, FractKV_creepPredict.t,
10297
FractKV_creepPredict.ϵ,
10398
xlabel = "Time",
10499
ylabel = "Strain",
105-
legend = false,
100+
legend = false, linewidth=4, framestyle = :box
106101
)
107102
#!nb p #hide
108103

docs/src/fitpredictTime.jl

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,17 @@ using Plots
8282
p = plot(size = (700, 500))
8383
plot!(p , data.t, data.σ,
8484
seriestype = :scatter, # "o" markers
85-
markersize = 5,
85+
markersize = 6,
8686
label = "Data",
8787
xlabel = "Time",
8888
ylabel = "Stress",
89-
legend = :topright
90-
)
91-
92-
# Overlay the model prediction
89+
legend = :topright,
90+
framestyle = :box)
91+
## Overlay the model prediction
9392
plot!(p, maxwell_predict.t, maxwell_predict.σ,
9493
color = :red,
95-
label = "Maxwell Model"
96-
)
97-
94+
label = "Maxwell Model",
95+
linewidth=4, framestyle = :box)
9896
#!nb p #hide
9997

10098
# #### Simulate different model behaviours
@@ -120,14 +118,14 @@ plot!(p, maxwell_creepPredict.t,
120118
linestyle = :dash,
121119
label = "Applied Stress",
122120
xlabel = "Time",
123-
ylabel = "Strain"
124-
)
121+
ylabel = "Strain",
122+
linewidth=4, framestyle = :box)
125123
## Visualisation of the simulated response
126124
plot!(p, maxwell_creepPredict.t,
127125
maxwell_creepPredict.ϵ,
128126
linestyle = :solid,
129-
label = "Simulated Strain"
130-
)
127+
label = "Simulated Strain",
128+
linewidth=4, framestyle = :box)
131129
#!nb p #hide
132130

133131
#md # !!! warning "Important"
@@ -150,12 +148,9 @@ plot!(p, maxwell_creepPredict.t, maxwell_creepPredict.σ,
150148
linestyle = :dash,
151149
label = "Applied Stress",
152150
xlabel = "Time",
153-
ylabel = "Strain"
154-
)
155-
156-
# Overlay the simulated strain response
151+
ylabel = "Strain", linewidth=4, framestyle = :box)
152+
## Overlay the simulated strain response
157153
plot!(p, maxwell_creepPredict.t, maxwell_creepPredict.ϵ,
158154
linestyle = :solid,
159-
label = "Simulated Strain"
160-
)
155+
label = "Simulated Strain", linewidth=4, framestyle = :box)
161156
#!nb p #hide

docs/src/gendata.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,47 +47,47 @@ plot!(p, dstep.t, dstep.ϵ,
4747
subplot = 1,
4848
ylim = (-0.1, 5.4),
4949
title = "Step",
50-
linewidth=4, framestyle = :box)
50+
lable = "", linewidth=4, framestyle = :box)
5151

5252
## Ramp generation
5353
dramp = strainfunction(datat, ramp(offset = 2.0, gradient = 0.8))
5454
plot!(p, dramp.t, dramp.ϵ,
5555
subplot = 2,
5656
ylim = (-0.1, :auto),
5757
title = "Ramp",
58-
linewidth=4, framestyle = :box)
58+
lable = "", linewidth=4, framestyle = :box)
5959

6060
## Stairs generation
6161
dstairs = strainfunction(datat, stairs(offset = 5.0, amp = 0.1, width = 1))
6262
plot!(p, dstairs.t, dstairs.ϵ,
6363
subplot = 3,
6464
ylim = (-0.1, :auto),
6565
title = "Stairs",
66-
linewidth=4, framestyle = :box)
66+
lable = "", linewidth=4, framestyle = :box)
6767

6868
## Square generation
6969
dsquare = strainfunction(datat, square(offset = 5.0, amp = 0.5, period = 4, width = 1))
7070
plot!(p, dsquare.t, dsquare.ϵ,
7171
subplot = 4,
7272
ylim = (-0.05, 0.6),
7373
title = "Square",
74-
linewidth=4, framestyle = :box)
74+
lable = "", linewidth=4, framestyle = :box)
7575

7676
## Sawtooth generation
7777
dsawtooth = strainfunction(datat, sawtooth(offset = 5.0, amp = 2, period = 5))
7878
plot!(p, dsawtooth.t, dsawtooth.ϵ,
7979
subplot = 5,
8080
ylim = (-0.1, 2.2),
8181
title = "Sawtooth",
82-
linewidth=4, framestyle = :box)
82+
lable = "", linewidth=4, framestyle = :box)
8383

8484
## Triangle generation
8585
dtriangle = strainfunction(datat, triangle(offset = 4.0, amp = 1, period = 4))
8686
plot!(p, dtriangle.t, dtriangle.ϵ,
8787
subplot = 6,
8888
ylim = (-0.1, 1.2),
8989
title = "Triangle",
90-
linewidth=4, framestyle = :box)
90+
lable = "", linewidth=4, framestyle = :box)
9191

9292
#!nb p #hide
9393

@@ -106,22 +106,22 @@ plot!(p, dhold.t, dhold.ϵ,
106106
subplot = 2,
107107
ylim = (-0.1, 2.8),
108108
title = "Ramp & hold",
109-
linewidth=4, framestyle = :box)
109+
lable = "", linewidth=4, framestyle = :box)
110110

111111
## Step with oscillatory loading
112112
doscil = dstep + dsquare
113113
plot!(p, doscil.t, doscil.ϵ,
114114
subplot = 1,
115115
ylim = (-0.5, 6),
116116
title = "Oscillations",
117-
linewidth=4, framestyle = :box)
117+
lable = "", linewidth=4, framestyle = :box)
118118

119119
## Ramp & hold & oscillation
120120
dcomplex = dhold + dsquare
121121
plot!(p, dcomplex.t, dcomplex.ϵ,
122122
subplot = 3,
123123
ylim = (-0.1, 3.2),
124124
title = "Ramp & hold & oscillations",
125-
linewidth=4, framestyle = :box)
125+
lable = "", linewidth=4, framestyle = :box)
126126

127127
#!nb p #hide

0 commit comments

Comments
 (0)