Re: Mathematica plot not matching up to excel plot tia sal22
- To: mathgroup at smc.vnet.net
- Subject: [mg102873] Re: Mathematica plot not matching up to excel plot tia sal22
- From: Sjoerd <s.c.devries at xs4all.nl>
- Date: Tue, 1 Sep 2009 03:51:09 -0400 (EDT)
- References: <h7g91i$6sl$1@smc.vnet.net>
Rick, The problem seems to be located in your polynomial functions. How did you ever arrive at the set you show here? If you plot the first one, using Plot[-792.7927814*x^2 + 78.27580762*x, {x, 0, 0.0982924752363772}] you see that indeed it ends at {x,y}={0982924752363772, 0.03442623}, i.e. the first point you list. The curve drawn by Mathematica to the left of that point does precisely what the function above should do and which is shown in your pictures. If this is not what you intended then your interpolation method must be wrong. For instance, the second polynomial doesn't start where the first one finished etc. To save yourself all the trouble I'd suggest using the function Interpolation with the set of points you started with as follows: data = {{0.0982924752363772`, 0.03442622950819672`}, {0.09860843933514662`, 0.009836065573770493`}, {0.11551404011577575`, 0.01639344262295082`}, {0.11647486513201771`, 0.0075409836065573775`}, {0.1386068062622766`, 0.0009836065573770492`}, {0.13954354091785795`, 0.0006065573770491804`}, {0.1428992013665067`, 0.001639344262295082`}, {0.14362977325138218`, 0.0034426229508196723`}, {0.14570154426819318`, 0.0004426229508196721`}, {0.1480626531956751`, 0.0009672131147540983`}, {0.1482226639070102`, 0.004918032786885246`}, {0.15241565457567238`, 0.010491803278688525`}, {0.15301410985103028`, 0.0014098360655737704`}, {0.15755349454771742`, 0.01639344262295082`}, {0.1576676067824255`, 0.0027868852459016396`}, {0.16114042245870788`, 0.005245901639344262`}, {0.1670225277837933`, 0.008032786885245901`}, {0.16809137904889226`, 0.0015901639344262294`}, {0.17049077897068735`, 0.054098360655737705`}, {0.17306134724454456`, 0.003278688524590164`}, {0.17422275621112893`, 0.004918032786885246`}, {0.1768308547310679`, 0.07868852459016394`}, {0.17708925554699576`, 0.016065573770491802`}, {0.18330304710096598`, 0.012950819672131148`}, {0.1846057016558446`, 0.0021311475409836068`}, {0.18460722315230738`, 0.018032786885245903`}, {0.1929485739267237`, 0.04262295081967213`}, {0.2014430886783927`, 0.054098360655737705`}, {0.2032650806925649`, 0.05737704918032787`}, {0.20486797721609765`, 0.008360655737704918`}, {0.2048705130435356`, 0.07377049180327869`}, {0.2160811525640005`, 0.9672131147540983`}, {0.222174238731924`, 0.2459016393442623`}, {0.22679096616546882`, 1.`}, {0.23259420725723381`, 0.29508196721311475`}, {0.23351243037251812`, 0.08524590163934426`}, {0.25420047135960416`, 0.3114754098360656`}, {0.25671220843690074`, 0.07868852459016394`}, {0.2567170265090329`, 0.4262295081967213`}, {0.3404173363364293`, 0.047540983606557376`}, {0.34457558616919143`, 0.6229508196721312`}, {0.3449374487445879`, 0.1377049180327869`}, {0.348899679116396`, 0.09344262295081968`}, {0.37263755976311314`, 0.9016393442622951`}, {0.41931504257907853`, 0.013442622950819673`}, {0.43140307839307657`, 0.02459016393442623`}, {0.5108163183538625`, 0.012459016393442624`}, {0.5786273870377631`, 0.014426229508196721`}, {0.5843629215369346`, 0.018032786885245903`}, {0.5921370077134799`, 0.06393442622950819`}, {0.6151367089930077`, 0.07213114754098361`}, {0.6182755561957112`, 0.013934426229508197`}, {0.6534964242297298`, 0.014590163934426229`}, {0.6535273613244729`, 0.00819672131147541`}, {0.7434554097567483`, 0.011147540983606558`}, {0.7635751718149881`, 0.04590163934426229`}, {0.7851302122031117`, 0.01`}, {0.8852484831948181`, 0.018032786885245903`}, {0.9164695906109468`, 0.003114754098360656`}, {0.9937390420556838`, 0.00003278688524590164`}, {0.9999274753352744`, 0.00003278688524590164`}, {1.`, 0.00001639344262295082`}} myInterpolation = Interpolation[data] Plot[myInterpolation[x], {x, 0.0982924752363772, 1}, PlotRange -> All] Cheers -- Sjoerd On Aug 31, 12:35 pm, Rick T <ratull... at gmail.com> wrote: > Mathematica plot not matching up to excel plot tia sal22 > > Greetings All > > I have a set of data values I plot in excel then I create a polynomial > so it can be plotted in mathematica. Then I create an audio file using > the piecewise function in mathematica. The problem I'm having is when > I compare the excel plot and the mathematica plot they don't match up. > > If your wondering why I use the piecewise function in mathematica it's > due to the fact it allows me to create an audio file with it. Is there > a better way to do this? > > For excel file with data points---> linkhttp://tools.onewithall.net/mathe= matica/excel_mathematica_question.xls > > For mathematica file---> linkhttp://tools.onewithall.net/mathematica/math= _question.nb > > For mathematica image only---> linkhttp://tools.onewithall.net/mathematic= a/mathematica_code_jpg.jpg > > For excel and mathematica plots compared image only --->http://tools.onew= ithall.net/mathematica/excel_mathematica_plots_compa... > > tia sal22