rk4odes/rk4.py
def graph(self, *args, **kwargs):
        """
        Solution Graph with values obtained from each iteration.
        """

        if len(self.ts) == 0 or len(self.ys) == 0:
            raise ValueError('Need to solve first')

        plt.title("Solution graph")
        plt.plot(self.ts, self.ys, *args, **kwargs)
        plt.scatter(self.ts[len(self.ts) - 1], self.ys[len(self.ys) - 1],
                    facecolor='k', s=50,
                    label='y({})={}'.format(round(self.ts[len(self.ts) - 1], 4),
                    self.ys[len(self.ys) - 1]))
        plt.xlabel("$ t $")
        plt.ylabel("$ y(t) $")
        plt.legend()
        plt.grid()
        plt.show()

        Solution Graph with values obtained from each iteration.
        
Solution Graph with values obtained from each iteration.
Solution Graph with values obtained from each iteration .
def graph(self, *args, **kwargs):
        if len(self.ts) == 0 or len(self.ys) == 0:
            raise ValueError('Need to solve first')
        plt.title("Solution graph")
        plt.plot(self.ts, self.ys, *args, **kwargs)
        plt.scatter(self.ts[len(self.ts) - 1], self.ys[len(self.ys) - 1],
                    facecolor='k', s=50,
                    label='y({})={}'.format(round(self.ts[len(self.ts) - 1], 4),
                    self.ys[len(self.ys) - 1]))
        plt.xlabel("$ t $")
        plt.ylabel("$ y(t) $")
        plt.legend()
        plt.grid()
        plt.show()
def graph ( self , * args , ** kwargs ) : if len ( self . ts ) == 0 or len ( self . ys ) == 0 : raise ValueError ( 'Need to solve first' ) plt . title ( "Solution graph" ) plt . plot ( self . ts , self . ys , * args , ** kwargs ) plt . scatter ( self . ts [ len ( self . ts ) - 1 ] , self . ys [ len ( self . ys ) - 1 ] , facecolor = 'k' , s = 50 , label = 'y({})={}' . format ( round ( self . ts [ len ( self . ts ) - 1 ] , 4 ) , self . ys [ len ( self . ys ) - 1 ] ) ) plt . xlabel ( "$ t $" ) plt . ylabel ( "$ y(t) $" ) plt . legend ( ) plt . grid ( ) plt . show ( )
Solution Graph with values obtained from each iteration.
Solution Graph with values obtained from each iteration .
"""
        Solution Graph with values obtained from each iteration.
        """
self