Skip to content

Commit ca74492

Browse files
committed
Minor updates docs
1 parent 21bcfc0 commit ca74492

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/src/examples.jl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,23 @@ plot!(p, grid = true)
132132

133133
# Generate Timeline
134134
datat = timeline(t_start = 0, t_end = 20.0, step = 0.02) # Create a timeline from 0 to 20 seconds with a step size of 0.02 seconds
135-
# Generate Stress Data (Ramp & hold)
135+
## Generate Stress Data (Ramp & hold)
136136
dramp_stress = stressfunction(datat, ramp(offset = 4.0, gradient = 0.8)) # Generate a ramp stress function with offset 4.0 and gradient 0.8
137137
dhold_stress = dramp_stress - stressfunction(datat, ramp(offset = 5.0, gradient = 0.8)) # Generate a hold stress function by subtracting a shifted ramp
138-
# Define the rheological model and predict
138+
139+
## Define the rheological model and predict
139140
model = RheoModel(SLS_Zener, (η = 1, kᵦ = 1, kᵧ = 1))
140141
data = modelpredict(dhold_stress, model)
141-
# Fit three models to the data
142+
143+
## Fit three models to the data
142144
SLS_Zener_model = modelfit(data, SLS_Zener, stress_imposed)
143145
Maxwell_model = modelfit(data, Maxwell, stress_imposed)
144146
BurgersLiquid_model = modelfit(data, BurgersLiquid, stress_imposed)
145-
# Call the extractfitdata function to extract fitting data
147+
148+
## Call the extractfitdata function to extract fitting data
146149
extracted_data = extractfitdata(data)
147-
# Determine which model fits best by comparing errors
150+
151+
## Determine which model fits best by comparing errors
148152
function find_best_model(extracted_data)
149153
best_model = ""
150154
min_error = Inf
@@ -165,13 +169,15 @@ end
165169

166170
best_model, min_error = find_best_model(extracted_data)
167171

168-
# Create strain-only data for model predictions
172+
## Create strain-only data for model predictions
169173
stress_only_data = onlystress(data)
170-
# Get model predictions for plotting
174+
175+
## Get model predictions for plotting
171176
SLS_Zener_predict = modelpredict(stress_only_data, SLS_Zener_model)
172177
Maxwell_predict = modelpredict(stress_only_data, Maxwell_model)
173178
BurgersLiquid_predict = modelpredict(stress_only_data, BurgersLiquid_model)
174-
# Plot data and fitted models
179+
180+
## Plot data and fitted models
175181
p = scatter(data.t, data.ϵ,
176182
color = :green,
177183
label = "Original Data",
@@ -183,6 +189,7 @@ p = scatter(data.t, data.ϵ,
183189
grid = true,
184190
framestyle = :box
185191
)
192+
186193
## Overlay fitted models
187194
plot!(p, SLS_Zener_predict.t, SLS_Zener_predict.ϵ, color = :red, linestyle = :solid, linewidth = 3, label = "SLS_Zener Model")
188195
plot!(p, Maxwell_predict.t, Maxwell_predict.ϵ, color = :blue, linestyle = :dash, linewidth = 3, label = "Maxwell Model")

0 commit comments

Comments
 (0)