Page 1 of 1

'y' is a reserved word?

Posted: Mon Jun 13, 2022 5:54 pm
by fietkiewicz
Is the following invalid because 'y' is a reserved word?

Code: Select all

NEURON {
	SUFFIX test5
}

STATE { y }

BREAKPOINT {
	SOLVE states METHOD derivimplicit
}

INITIAL {
	y = 10.0
}

DERIVATIVE states {
	y' = 0
}
I get the following compilation error:

Code: Select all

test5.c:109:16: error: redefinition of 'y0' as different kind of symbol
 static double y0 = 0;
 
Other names are fine.

Re: 'y' is a reserved word?

Posted: Fri Jun 17, 2022 12:15 pm
by hines
y cannot be the name of a STATE as that automatically declares y0 for the initial value. Unfortunately y0() is the Bessel function of the first order and is declared in math.h.

Re: 'y' is a reserved word?

Posted: Thu Jun 23, 2022 1:02 pm
by fietkiewicz
Thanks for explaining.