Lambdify function to matrix

I’m not familiar with SymPy, but in this case, I’m guessing that you need to transpose one of your arrays, either ges or kes. Here’s an example with a made-up fn:

fn(x, y, z) = y*z + x 

ges = 1:5
kes = 1:5

fn.(1, ges, kes)

ges and kes are both vectors, so broadcasting will produce a vector:

5-element Vector{Int64}:
  2
  5
 10
 17
 26

However, running

fn.(1, ges, kes')

will produce a matrix:

5×5 Matrix{Int64}:
 2   3   4   5   6
 3   5   7   9  11
 4   7  10  13  16
 5   9  13  17  21
 6  11  16  21  26

and running

fn.(1, ges', kes)

will produce the same matrix transposed.

See the Julia manual here for details: Single- and multi-dimensional Arrays · The Julia Language: Broadcasting

3 Likes