Did you hookup the function to your materials? make sure you didnIf you are still using the curly brackets after real cp; and before return cp; , remove themnif the error still there after doing the above, add this line before return cp;n#if RP_HOSTnif (cp != 0) {nMessage(Temperature = %f , Cp = %f, T, cp);n}n#endifnThese lines will print lots of lines ... so probably the computer will get slower and the solver will print lots of messages ... but this is to know if the function works for some cells or it is not read at alln