A metal bar is divided into 10 segments, each with its owntemperature. The ends
ID: 3614720 • Letter: A
Question
A metal bar is divided into 10 segments, each with its owntemperature. The ends of the bar are connected to heat sourceswhich keep their temperatures constant. Hence, temp[0] and temp[9]are always the same values. Assume initial temperature of the restof the segments is 0 degrees.After a short time nterval, the new temperaute of each middlesegment becomes the average of the old temperatures of the twoneighboring segments.
temp[] is initialized as
100.00 0.00 0.00 0.00 0.00 0.000.00 0.00 0.00 80.00
After one time step, temperatures will be
100.00 50.00 0.00 0.00 0.00 0.00 0.00 0.00 40.00 80.00
And again
100.00 50.00 25.00 0.00 0.00 0.00 0.00 20.00 40.00 80.00
etc. etc.
have user input temps for segment 0 and segment 9.
I have no idea how to keep some elements of the array at thesame value while averaging some of them . any hints??? thanks! willrate highest