Re: How to plot y=f(x) or given y interval?
- To: mathgroup at smc.vnet.net
- Subject: [mg119218] Re: How to plot y=f(x) or given y interval?
- From: Alexei Boulbitch <alexei.boulbitch at iee.lu>
- Date: Wed, 25 May 2011 06:58:50 -0400 (EDT)
Hi, It is possible. The basis of the most simple approach is to plot it by a usual way and to determine (at least, approximately) your interval along Ox, and then to plot by a usual way. Here the peculiarity arises, if the function is non-monotone. Here is a simple example: assume the function is f[x_] := x*Exp[-x] and the interval spans from y=0.1 to y=0.3. Let us first look at the graph: Plot[f[x], {x, 0, 5}] and see that it is non-monotone. Let us then find the roots: FindRoot[0.1 == x*Exp[-x], {x, 0.5}] FindRoot[0.1 == x*Exp[-x], {x, 4}] FindRoot[0.3 == x*Exp[-x], {x, 0.8}] FindRoot[0.3 == x*Exp[-x], {x, 2}] {x -> 0.111833} {x -> 3.57715} {x -> 0.489402} {x -> 1.78134} and now let us plot. We will need to form a piecewise function out of our function pieces: pl1 = Plot[If[x<= 0.48, f[x], 0], {x, 0.11, 3.6}]; pl2 = Plot[If[x<= 0.48, 0, f[x]], {x, 1.1, 3.6}]; Show[{pl1, pl2}] Have fun, Alexei HI, How can I plot a function y=f(x) for a given y interval? Thank in advance Araripe -- Alexei Boulbitch, Dr. habil. Senior Scientist Material Development IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 CONTERN Luxembourg Tel: +352 2454 2566 Fax: +352 2454 3566 Mobile: +49 (0) 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu www.iee.lu -- This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.