       Re: Strange "little" problem with scaling

• To: mathgroup at smc.vnet.net
• Subject: [mg62676] Re: [mg62659] Strange "little" problem with scaling
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Wed, 30 Nov 2005 22:08:38 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```The Plots are correct.  They should have different shapes.  Perhaps you are
being misled by looking at the plots on different scales, with different origins.
Plot them together.

y1[x_]:=(Sin[x]-x*Cos[x])/x^3;
y2[x_]:=y1[x]/2;
Plot[y1[x],{x,0,Pi}];
Plot[y2[x],{x,0,Pi}];
Plot[{y1[x],y2[x]},{x,0,Pi},Epilog->{Red,AbsolutePointSize,
Point/@{{Pi,1/Pi^2},{Pi,1/2/Pi^2}}}];

Bob Hanlon

>
> From: "Srinath  Avadhanula" <srinathava at gmail.com>
To: mathgroup at smc.vnet.net
> Date: 2005/11/30 Wed AM 12:08:11 EST
> Subject: [mg62676] [mg62659] Strange "little" problem with scaling
>
> Hi all,
>
> I have an absurd little problem which unfortunately, I am unable to
> figure out the solution to... Consider the following very simple
> notebook:
>
> \!\(y1[x_] := \(Sin[x] - x\ Cos[x]\)\/x\^3\[IndentingNewLine]
>   y2[x_] := \(1\/2\) y1[x]\[IndentingNewLine]
>   Plot[{y1[x]}, \ {x, \ 0, \ p}]\[IndentingNewLine]
>   Plot[{y2[x]}, \ {x, \ 0, \ p}]\)
>
> The above can be copied/pasted into a new mathematica notebook. If you
> do not wish to do this, please see a screenshot at:
>
> http://robotics.eecs.berkeley.edu/~srinath/mathematica_prob.png
>
> Basically, I have defined two functions y1[x] and y2[x] which _should_
> ideally only differ by a factor of 2. However, their shapes when I plot
> them are _completely_ different! I simply do not understand what I am
> doing wrong. I am pretty sure that this is a syntax issue with the way
> I am defining the various functions.
>
> plots are correct! The correct value of y1[pi] == 1/pi^2 and y2[pi] ==
> 1/2/pi^2. It doesn't look like the plots are anywhere close to this.
>
> My Mathematica version: 5.1
>
> Many thanks for any help (I apologize in advance for this silliness)
> Srinath
>
>

```

• Prev by Date: Re: Problem with RSolve
• Next by Date: Re: FindMinimum is not obeying my bounds
• Previous by thread: Re: Strange "little" problem with scaling
• Next by thread: Re: FindMinimum is not obeying my bounds