174174```
175175
176176If a type contains the value of state variables, it can define [ ` state_values ` ] ( @ref ) to
177- enable the usage of [ ` getu ` ] ( @ref ) and [ ` setu ` ] ( @ref ) . These methods retturn getter/
177+ enable the usage of [ ` getsym ` ] ( @ref ) and [ ` setsym ` ] ( @ref ) . These methods retturn getter/
178178setter functions to access or update the value of a state variable (or a collection of
179- them). If the type also supports generating [ ` observed ` ] ( @ref ) functions, ` getu ` also
179+ them). If the type also supports generating [ ` observed ` ] ( @ref ) functions, ` getsym ` also
180180enables returning functions to access the value of arbitrary expressions involving
181181the system's symbols. This also requires that the type implement
182182[ ` parameter_values ` ] ( @ref ) and [ ` current_time ` ] ( @ref ) (if the system is time-dependent).
@@ -202,21 +202,21 @@ Then the following example would work:
202202``` julia
203203sys = ExampleSystem (Dict (:x => 1 , :y => 2 , :z => 3 ), Dict (:a => 1 , :b => 2 ), :t , Dict ())
204204integrator = ExampleIntegrator ([1.0 , 2.0 , 3.0 ], [4.0 , 5.0 ], 6.0 , sys)
205- getx = getu (sys, :x )
205+ getx = getsym (sys, :x )
206206getx (integrator) # 1.0
207207
208- get_expr = getu (sys, :(x + y + t))
208+ get_expr = getsym (sys, :(x + y + t))
209209get_expr (integrator) # 13.0
210210
211- setx! = setu (sys, :y )
211+ setx! = setsym (sys, :y )
212212setx! (integrator, 0.0 )
213213getx (integrator) # 0.0
214214```
215215
216216In case a type stores timeseries data (such as solutions), then it must also implement
217217the [ ` Timeseries ` ] ( @ref ) trait. The type would then return a timeseries from
218218[ ` state_values ` ] ( @ref ) and [ ` current_time ` ] ( @ref ) and the function returned from
219- [ ` getu ` ] ( @ref ) would then return a timeseries as well. For example, consider the
219+ [ ` getsym ` ] ( @ref ) would then return a timeseries as well. For example, consider the
220220` ExampleSolution ` below:
221221
222222``` julia
@@ -242,20 +242,20 @@ Then the following example would work:
242242``` julia
243243# using the same system that the ExampleIntegrator used
244244sol = ExampleSolution ([[1.0 , 2.0 , 3.0 ], [1.5 , 2.5 , 3.5 ]], [4.0 , 5.0 ], [6.0 , 7.0 ], sys)
245- getx = getu (sys, :x )
245+ getx = getsym (sys, :x )
246246getx (sol) # [1.0, 1.5]
247247
248- get_expr = getu (sys, :(x + y + t))
248+ get_expr = getsym (sys, :(x + y + t))
249249get_expr (sol) # [9.0, 11.0]
250250
251- get_arr = getu (sys, [:y , :(x + a)])
251+ get_arr = getsym (sys, [:y , :(x + a)])
252252get_arr (sol) # [[2.0, 5.0], [2.5, 5.5]]
253253
254- get_tuple = getu (sys, (:z , :(z * t)))
254+ get_tuple = getsym (sys, (:z , :(z * t)))
255255get_tuple (sol) # [(3.0, 18.0), (3.5, 24.5)]
256256```
257257
258- Note that ` setu ` is not designed to work for ` Timeseries ` objects.
258+ Note that ` setsym ` is not designed to work for ` Timeseries ` objects.
259259
260260If a type needs to perform some additional actions when updating the state/parameters
261261or if it is not possible to return a mutable reference to the state/parameter vector
@@ -315,7 +315,7 @@ setp(integrator, :b)(integrator, 3.0) # functionally the same as above
315315
316316If a solution object includes modified parameter values (such as through callbacks) during the
317317simulation, it must implement several additional functions for correct functioning of
318- [ ` getu ` ] ( @ref ) and [ ` getp ` ] ( @ref ) . [ ` ParameterTimeseriesCollection ` ] ( @ref ) helps in
318+ [ ` getsym ` ] ( @ref ) and [ ` getp ` ] ( @ref ) . [ ` ParameterTimeseriesCollection ` ] ( @ref ) helps in
319319implementing parameter timeseries objects. The following mockup gives an example of
320320correct implementation of these functions and the indexing syntax they enable.
321321
@@ -457,12 +457,12 @@ sol.ps[:(b + c)] # observed quantities work too
457457```
458458
459459``` @example param_timeseries
460- getu (sol, :b)(sol) # works
460+ getsym (sol, :b)(sol) # works
461461```
462462
463463``` @example param_timeseries
464464try
465- getu (sol, [:b, :d])(sol) # errors since :b and :d belong to different timeseries
465+ getsym (sol, [:b, :d])(sol) # errors since :b and :d belong to different timeseries
466466catch e
467467 showerror(stdout, e)
468468end
0 commit comments