From: Benjamin R. <ben...@ou...> - 2010-06-08 18:48:31
|
I think I found your errors. First, you are correct, the scientific notation in python is as you understand, there is nothing wrong with that. Instead, you have a problem with order of operations. In the last quantity, you have "((x**2)/4*(1e4**2)*(3e14**2))" According to the equation that you wrote out in the attached image, you need: "((x**2)/*(*4*(*2*e4**2)*(3e14**2))*)*" Note that you needed parentheses for the entire denominator. Also, the 1e4**2 should have been 2e4**2. This gives me values between 4.3125e-48 and 5.5359e-48. Ben Root On Tue, Jun 8, 2010 at 12:47 PM, Waléria Antunes David < wal...@gm...> wrote: > I understand what you are saying, but my functions are these, attached. > > > Scientific notation in Python is not so? > > *Math * *Python* > > > Pinc = 10-6 Pinc = 1e-6 > > 3,0x1014 3e14 > > > ? > > > Then, changing my functions of the images attached for python is as bellow: > > > y1 = -108*(x**2)/(3e14**2) > > y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2)))) > > Is not it? > > > > > > > On Tue, Jun 8, 2010 at 1:34 PM, Gökhan Sever <gok...@gm...>wrote: > >> >> >> On Tue, Jun 8, 2010 at 10:19 AM, Waléria Antunes David < >> wal...@gm...> wrote: >> >>> Hello!!! >>> >>> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And >>> I'd like to make a question. I'm in trouble to generate a two functions >>> graph. >>> >>> I have a problem to generate a graph of the two functions. I have this >>> functions, is bellow: >>> >>> *y1 = -108*(x**2)/(3e14**2)* >>> >>> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))* >>> >>> >>> You might need to check your y2. You are mixing integers and floats which >> possible have resulted with some rounding errors. I get e+30 when I assert >> the terms as floats in y2. >> >> For the plotting: y1 is around -e-20 whereas y2 goes up to e+30. You can't >> see the trend easily on one axes even if you could scale >> them logarithmically (hint logarithm is only defined for positive numbers). >> You can make a positive assumption for the y1 and plot them on one y-axes >> >> yscale('log') >> axis(ymin=1e+20, ymax=1e+30) >> >> Still this won't let you see the functions trends that you are looking to >> see. I would suggest you to use multipe figures or investing a bit more >> time to use parasite axes example of JJ. >> >> >> >> >> -- >> Gökhan >> > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |