Do you want to run or compile the program with n assigned to each of those values in turn? Are you hoping to save out the file with unique names?
Your script will only "keep" the last value that you have substituted at this point, so it doesn't seem like you want it in a loop unless you save it with different names.
Also why do you have $model instead of just model? Is that variable defined elsewhere...?
If you are trying to save 50 different cpp files with different names, then put $i in your destination file name:
for i in $(seq 1 50);
do
sed -e "s/double n=.*/double n=$i.0;/" model_c2.cpp > model_$i_c2.cpp
done
This will make 50 files called model_1_c2.cpp ... model_50_c2.cpp
I think the searching for every n= is a bit dangerous, as it will replace ANY line with any other variable ending in n. I've added the double back in as a bit of an assurance against this...