# Optimizing model description

**URL:** <https://discourse.julialang.org/t/optimizing-model-description/69885>\
**Category:** Modelling & Simulations\
**Created:** [October 16, 2021, 11:05am UTC](https://discourse.julialang.org/t/optimizing-model-description/69885 "2021-10-16T11:05:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [October 16, 2021, 11:05am UTC](https://discourse.julialang.org/t/optimizing-model-description/69885/1 "2021-10-16T11:05:52Z")

</div>

I need to optimize a model description for an `ODEProblem`, which is a hand-coded discretization of a PDE (so the state is a matrix). I know I should…

- avoid creating arrays in the model. My plan is to instead operate on a work array which is an input parameter to the model, and define readable array names via a `view`

At a later stage, I’ll probably convert the problem to a `DAEProblem` to store intermediate variables. When doing so, the problem disappears (I guess), in that then the arrays will be part of the `u` (and `du`) array.

What I’m curious about is the following: in the model function, I call a number of other functions.

- Is it advantageous to pass these functions into the model function via the parameter argument, or is there no loss of performance when the function is only defined in the “global” namespace?
