# Register\_array\_symbolic changing arrays into arrays of single length 'tuples'

**URL:** <https://discourse.julialang.org/t/register-array-symbolic-changing-arrays-into-arrays-of-single-length-tuples/115858>\
**Category:** Modelling & Simulations\
**Tags:** symbolics\
**Created:** [June 19, 2024, 1:09pm UTC](https://discourse.julialang.org/t/register-array-symbolic-changing-arrays-into-arrays-of-single-length-tuples/115858 "2024-06-19T13:09:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HSnowden](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Post date:** [June 19, 2024, 1:09pm UTC](https://discourse.julialang.org/t/register-array-symbolic-changing-arrays-into-arrays-of-single-length-tuples/115858/1 "2024-06-19T13:09:20Z")

</div>

Hello,

When I use register\_array\_symbolic and define the size of the array to equal the length of an input, rather than returning a single array of length(x) it returns an object that is composed of x 1-length subarrays.

Here is an MWE:

```julia
using Symbolics,ModelingToolkit

function summing_vectors(vec1::Vector{Float64},vec2::Vector{Float64})
    return vec1.+vec2
end
@register_array_symbolic summing_vectors(vec1::AbstractVector,vec2::AbstractVector) begin
    size = length(vec1)
    eltype= eltype(vec1)
end

@variables (output(t))[1:200] (input_1(t))[1:200] (input_2(t))[1:200]

output = summing_vectors(input_1,input_2)
size(output)

```

The size of output is not a 200 length array like input\_1/2 but instead the result is:

```julia
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)

```

What am I doing wrong to make the return length be a single array?

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [June 19, 2024, 1:16pm UTC](https://discourse.julialang.org/t/register-array-symbolic-changing-arrays-into-arrays-of-single-length-tuples/115858/2 "2024-06-19T13:16:19Z")

</div>

use

```julia
size = (length(vec1),)

```

```julia
@register_array_symbolic summing_vectors(vec1::AbstractVector,vec2::AbstractVector) begin
    size = (length(vec1),)
    eltype= eltype(vec1)
end

@variables (output(t))[1:200] (input_1(t))[1:200] (input_2(t))[1:200]

output = summing_vectors(input_1,input_2)
size(output)

```

```julia-repl
julia> size(output)
(200,)

```
