[Date Index]
[Thread Index]
[Author Index]
Re: Re: Plot in Background of Manipulate
*To*: mathgroup at smc.vnet.net
*Subject*: [mg95247] Re: Re: Plot in Background of Manipulate
*From*: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
*Date*: Mon, 12 Jan 2009 06:25:03 -0500 (EST)
Hi, Mike,
to add a bit to what David Park has written, I often use a simple approach like that you are looking for. But
I do this not in order to fit experiment, but to fit a theoretical result which admits only numeric calculation,
but which I need to use later in further analytical transformations. Find the example below. It is straightforward
to apply the same approach to fit your experimental data, if you have an idea, of what the fitting function should
look like.
(* This is the data to be fitted and its plot *)
dataToBeFitted =
Table[{z, NIntegrate[x^z*Exp[-z*x^2], {x, 0, 2}]}, {z, 0, 2, 0.1}];
plotOfDataToBeFitted = ListPlot[expdata, PlotStyle -> {Red, PointSize[0.015]}];
(* This is a necessary plot of the fitting function manipulated by 3 parameters *)
(* a, b and c with the data to be fitted on the background. Try this *)
Manipulate[
Show[{plotOfDataToBeFitted,
Plot[(a + b*Exp[-x^c]), {x, 0, 2}]}], {{a, -1.8}, -3,
3}, {{b, 6.3}, 0, 10}, {{c, 0.3}, 0.1, 3}]
(* End of the example *)
Like this I find sometimes pretty good analytic approximations to functions obtainable only in a numeric form.
Good luck, :-) , Alexei
The following is a solution using the Presentations package. I hardly ever
use Manipulate to make dynamic displays. It is too baroque and it is much
easier to format and construct a presentation directly. You did not give
actual information about his data and model so here I have used a rather
simple example of matching a variable Sin curve to one that is randomly
generated.
Needs["Presentations`Master`"]
Module[
{amplitude = 1, phase = 0,
ampexp = RandomReal[{-5, 5}], phaseexp = RandomReal[{0, 2 \[Pi]}]},
panelpage[
pagelet[
phrase["Amplitude: ", Slider[Dynamic[amplitude], {0, 4}],
Spacer[10], InputField[Dynamic[amplitude], FieldSize -> {5, 1}]],
phrase["Phase: ", Slider[Dynamic[phase], {0, 2 \[Pi]}],
Spacer[10], InputField[Dynamic[phase], FieldSize -> {5, 1}]],
Draw2D[
{(* Experimental curve *)
Gray, Draw[ampexp Sin[t + phaseexp], {t, 0, 2 \[Pi]}],
(* Adjustable theoretical curve *)
Black,
Dynamic@Draw[amplitude Sin[t + phase], {t, 0, 2 \[Pi]}]},
AspectRatio -> 1,
PlotRange -> {{-.1, 2 \[Pi] + .1}, {-6.1, 6.1}},
Frame -> True,
ImageSize -> 400]
](* pagelet *),
Style["Dynamic Matching of Experimental Curve", 16]
](* panelpage *)
]
The gray curve is the hypothetical experimental curve, generated randomly
each time the input is evaluated. The sliders can be used to adjust the
black theoretical curve to the experimental curve.
Peter Lindsay at the Mathematical Institute in the University of St Andrews
[ www.mcs.st-and.ac.uk ] has kindly undertaken to maintain an archive that
provides downloadable notebooks and PDF files for various Presentations
solutions that have appeared on MathGroup.
http://blackbook.mcs.st-and.ac.uk/~Peter/djmpark/html/ <http://blackbook.mcs.st-and.ac.uk/%7EPeter/djmpark/html/>
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/ <http://home.comcast.net/%7Edjmpark/>
From: makn87 at yahoo.com [mailto:makn87 at yahoo.com]
If someone could please help with the following, I would really
appreciate.
I am plotting of some logarithmic scattering curves based on
theoretical modes and am using manipulate to change a few paramaters.
In the same notebook, I have plotted experimental results using
ListLogLogPlot (on the exact same scale as I have using the manipulate
command).
I would like to have my experimental plots, plotted in the background
of the manipulate window, so that I can adjust the parameters in
manipulate to the point that my theoretical curve matches my
experimental curve.
So far I have only been able to plot the experimental plots side by
side with the manipulate generated plots by simply making each plot an
elements of a list. How do I combine them?
Thanks,
Mike
--
Alexei Boulbitch, Dr., Habil.
Senior Scientist
IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg
Phone: +352 2454 2566
Fax: +352 2454 3566
Website: 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.
Prev by Date:
**RE: Keeping plot annotations after regenerating a plot**
Next by Date:
**Re: Graphics in PlotMarkers buggy in Mathematica 7**
Previous by thread:
**Re: Plot in Background of Manipulate**
Next by thread:
**Re: Solve / NSolve**
| |