protected void init() { GrapherConfig conf = new GrapherConfig2D(); conf.setDrawConfig(GrapherConfig2D.DRAW_AXES); graph = new Grapher2D(500, 500, conf); add(graph, BorderLayout.CENTER); add(new Button("WEST"), BorderLayout.WEST); add(new Button("EAST"), BorderLayout.EAST); sim(); pack(); setVisible(true); }
protected void sim() { sys = new Chua(); sys.setParameter("a", 15.8); // sys.setParameter("b", 0.15); dyn = new OdeSimulator(sys); dyn.setSkip(2000); dyn.setItersMax(15000); try { dyn.compute(); } catch (DynSimException e) { // TODO Auto-generated catch block e.printStackTrace(); } data = dyn.getStateSeries(); graph.addData(data, new MultirampColors()); // graph.setTickStep(2, 2); GrapherConfig conf = graph.getGrapherConfig(); conf.unsetDrawConfig(GrapherConfig2D.DRAW_AXES_TEXT); conf.setDrawConfig(GrapherConfig2D.DRAW_GRID); }