TransWikia.com

Plotting isothermals and adiabats

Physics Asked by lralvare on May 3, 2021

first time poster in this site.

I am trying to create a small program to make a graph of the Carnot cycle.

For isothermals I am simply trying to look for points where P*V would give the same Temperature so that I can display an isothermal curve.

However, I am having absolutely no luck with trying to plot an adiabatic curve.
I know I want a steeper curve, but thats about it. Is there some sort of simpler way to draw out an adiabatic curve? Can I set any variable constant and try to draw the curve like an isotherm?

Any information is appreciated.

        //ISOTHERMS
//i = x axis; j = y axis;
// for values 1 - 350
// plot y values from isothermal equation -- P*V = constant T
// j = k/i

 int k1 = 5000;
 //int k1 = 1500;
    //int k1 = 15000;
       //int k2 = 20000;
       int k2 = 15000;
       //int k2 = 30000;

  g.setColor(Color.red);
  for( int i = 1; i < 350; i++) 
  {
    int j1 = k1/i;
    int j2 = k2/i;
    //if(j1 < 350) 
        g.drawLine(i+50, j1+50, i+50, j1+50);
    //if(j2 < 350) 
        g.drawLine(i+50, j2+50, i+50, j2+50);

  }

    //ADIABATS
  //P*V^gamma = constant T
  double gamma = 1.67;

 for( int m = 1; m < 500; m++) 
 {

   // int h1 = (int) (1400000/(Math.pow(m,1.97)));
   int h1 = (int) (1000000/(Math.pow(m,2)));
    //int h2 = (int) (3500000/(Math.pow(m,1.97)));
   int h2 = (int) (2400000/(Math.pow(m,2)));
    //if(j1 < 350) 
    g.setColor(Color.blue);
        g.drawLine(m+50, h1+50, m+50, h1+50);
    //if(j2 < 350) 
        g.drawLine(m+50, h2+50, m+50, h2+50);



  }

test for drawing isotherms and adiabats

One Answer

$PV^{gamma}=Const$, where $gamma = C_p/C_v$

Answered by Chet Miller on May 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP