ValueError: Equations of type 'parameter' cannot have a flag 'linked', only the following flags are allowed: ['constant', 'shared']

Hi @paulbrodersen,
great question (and an example reproducing something from Zenke (2015) would be a nice addition to the documentation :blush: ). The reason for the error is that the linked flag is only allowed in NeuronGroup equations, it cannot be used in Synapses. This is because when we establish a link with linked_var, we establish a mapping of indices between the two groups – this does not work for synapses in the general case, since their number is not fixed. However, this is an issue for non-trivial mappings, and we could actually allow linked variables in Synapses for linking to groups of size 1 (as in your example), where there’s no ambiguity about the mapping.

Until we add this feature, there’s a workaround you can use: the linked variable mechanism does several checks, verifies that the mapping is feasible and so on, and then establishes an internal reference to the variable from the other group. You can skip the linked variable mechanism and directly use the internal mechanism. For that, you have to remove G : Hz (linked) from the synaptic equations, and replace the synapses.G = ... assignment by:

synapses.variables.add_reference("G", group=global_factor, index='0')

(the index='0' is a special case for scalar/shared variables, that are always index as [0]).

Hope that works for you!