I’m making a function that calculates the equation for the error of a given symbolic equation.
using Symbolics
function findErrorFromSym(sym)
vars = Symbolics.get_variables(sym)
@variables varErrs[eachindex(vars)]
Dvars = [expand_derivatives(Differential(i)(sym)) for i in vars]
symErr = sqrt(sum((Dvars[i]*varErrs[i])^2 for i in eachindex(vars)))
return symErr
end
But I’m currently just using an array of variables to store the error of each variable, but this is ugly and unintuitive when working with an equation with a’s b’s and c’s.
How can I make dynamically named symbols that just have “Err” on the end?