///////////////////////////////////////////////////////////////////////////////// // Solve IVP // x''+w^2x=0 , x(0)=0, x'(0)=v0 (1) // over the interval 0 #include #include "/usr/local/dislin/dislin.h" /*path to the dislin library*/ int main() { metafl("XWIN"); // output into (small) screen //metafl("CONS"); // output into full screen scrmod("REVERS"); // reverse colors; works for screen output, PS, TIFF and PNG files //-------------------------------------------------- /* metafl("PNG"); // output format setfil("test.png"); // name of the output file scrmod("REVERS"); // reverse colors winsiz(1280,640); // relosution of image file page(2970*2,2970);// define a plot size*/ //---------------------------------------------------- disini(); //dislin initialisation int w=1; int v0=1; float x = 0.0; // initial space float y = v0; // initial space float t = 0.0; //initial time float h = 0.025; // time step float Tend = 50; //end of the time interval name("x","x"); //axis labels name("y","y"); graf(-6,6,-6,1,-3,3,-3,1); // plots a two-dimensional axis system // setrgb(0,0,1); // set blue color /* while ( t <= Tend ) { x = x + h*y; y = y-h*w*x; t = t + h; rlsymb(21,x,y); // plot the symbol (t,x)one the plane } */ disfin(); //finish dislin printf("READY\n"); //print READY at the end of the program }