# Structural SImplify Unable to perform broadcast equation

**URL:** <https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967>\
**Category:** Modelling & Simulations\
**Tags:** modelingtoolkit, model-simplification\
**Created:** [June 21, 2024, 9:00am UTC](https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967 "2024-06-21T09:00:35Z")\
**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 21, 2024, 9:00am UTC](https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967/1 "2024-06-21T09:00:35Z")

</div>

Hello,

In a model I habe been building, I go to perform structural simplify upon it and it results in the following error `MethodError: no method matching length(::SymbolicUtils.BasicSymbolic{Any})`.

The code to blame for this appears to be the following, specifically the first line calculating ΔE.

```julia
function fgr_electron_generation(egrid::Symbolics.Arr{Num, 1},DOS::Spline1D,ftot::Symbolics.Arr{Num, 1},hv::Num)
    ΔE = egrid.-hv
    ftotspl=get_interpolate(egrid,ftot)
    return DOS.(ΔE).*ftotspl.(ΔE).*(1 .-ftotspl.(egrid))
end

```

This function is nested inside the following vector of equations.

```julia
eqs = [Δfe ~ fgr_electron_generation(egrid,DOS,ftot,hv),
          Δfh ~ fgr_hole_generation(egrid,DOS,ftot,hv),
          pc_sf ~ fgr_particleconservation(DOS,Δfh,Δfe,egrid,μ),
          Δfshape ~ (Δfe*pc_sf)-Δfh,
          δ ~ laser/fgr_excitation_internalenergy(Δfshape,DOS,egrid,μ),
          Δflas ~ δ.*Δfshape]

```

I have been unable to reproduce an MWE so unfortunately I have had to give you the more convoluted real code. Sorry about that. Any help would be great? Thank you

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 24, 2024, 3:48pm UTC](https://discourse.julialang.org/t/structural-simplify-unable-to-perform-broadcast-equation/115967/2 "2024-06-24T15:48:06Z")

</div>

In general structural simplify works with broadcast, so without an MWE I am not entirely sure what the issue is here.
