Aissgin54 - The"Aissgin54 class public class Aissgin54 cfw...

Info icon This preview shows pages 1–2. Sign up to view the full content.

// The "Aissgin54" class. public class Aissgin54 { public static double [] [] calcTemp (double Test [] [], int i, int j) { Test [i] [j] = (1. / 4) * (Test [i - 1] [j] + Test [i + 1] [j] + Test [i] [j - 1] + Test [i] [j + 1]); return Test; } public static double [] [] calcTemp2 (double Test2 [] [], int i, int j) { Test2 [i] [j] = (1. / 4) * (Test2 [i - 1] [j] + Test2 [i + 1] [j] + Test2 [i] [j - 1] + Test2 [i] [j + 1]); return Test2; } public static double [] [] initialize () { double Test [] [] = new double [10] [10]; for (int a = 1 ; a < 10 ; a++) { for (int b = 1 ; b < 10 ; b++) { Test [a] [b] = 50; } } for (int b = 0 ; b < 10 ; b++) { Test [0] [b] = 20; Test [b] [0] = 20; Test [9] [b] = 20; Test [b] [9] = 20; } Test [2] [7] = 100; return Test; } public static void main (String [] args) { double Test [] [] = new double [10] [10]; Test = initialize ();
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double Test2 = new double [10] [10]; Test2 = initialize (); double mon = 0; double work; for (int y = 0 ; y < 100 ; y++) { for (int i = 1 ; i < 9 ; i++) { for (int j = 1 ; j < 9 ; j++) { Test = calcTemp (Test, i, j); if ((i == 2) && (j == 7)) { Test [i] [j] = 100; } } } if (y >= 1) { for (int i = 1 ; i < 9 ; i++) { for (int j = 1 ; j < 9 ; j++) { Test2 = calcTemp2 (Test2, i, j); if ((i == 2) && (j == 7)) { Test2 [i] [j] = 100; } } } } for (int i = 1 ; i < 9 ; i++) { for (int j = 1 ; j < 9 ; j++) { work = (Test2 [i] [j]) - (Test [i] [j]); if (mon < work) { mon = work; m } } } if (mon < 0.01) { break; } mon = 0; } System.out.print ("Steady State Temperature at (4,4) is " + Test [4] [4]); [ //System.out.println (mon + " g\n" + gre); } // main method } // Aissgin54 class }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern