[SLE] Software to extrapolate figures?
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there? -- Pob hwyl / Best wishes Kevin Donnelly www.kyfieithu.co.uk - KDE yn Gymraeg www.eurfa.org.uk - Geiriadur rhydd i'r Gymraeg www.rhedadur.org.uk - Rhedeg berfau Cymraeg www.cymrux.org.uk - Linux Cymraeg ar un CD -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Kevin Donnelly wrote:
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there?
It's way off topic, but least squares would be the standard method here and I think that's exactly what the physics coursework would be asking your son to do. That would be a lot more illuminating as how to go about such problems in general than putting it into a black box and watch the numbers come out. There is software to do least squares, but this is exactly the sort of problem you should do by hand by hand. Regards, -- Jos van Kan registered Linux user #152704 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Sunday 25 June 2006 23:06, Jos van Kan wrote:
Kevin Donnelly wrote:
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there?
It's way off topic, but least squares would be the standard method here and I think that's exactly what the physics coursework would be asking your son to do. That would be a lot more illuminating as how to go about such problems in general than putting it into a black box and watch the numbers come out. There is software to do least squares, but this is exactly the sort of problem you should do by hand by hand.
No, he's already done the coursework, which involved plotting actual results by hand - he's in year 4 secondary, so least squares would be a bit beyond them! The above is for the conclusions part, where he wants to say something like "if you change a, b might change as follows". He can just extrapolate the curve manually on the graph paper, but I thought there might be something that could do that more neatly. No matter. Thanks to all for the responses. -- Pob hwyl / Best wishes Kevin Donnelly www.kyfieithu.co.uk - KDE yn Gymraeg www.eurfa.org.uk - Geiriadur rhydd i'r Gymraeg www.rhedadur.org.uk - Rhedeg berfau Cymraeg www.cymrux.org.uk - Linux Cymraeg ar un CD -- Pob hwyl / Best wishes Kevin Donnelly www.kyfieithu.co.uk - KDE yn Gymraeg www.eurfa.org.uk - Geiriadur rhydd i'r Gymraeg www.rhedadur.org.uk - Rhedeg berfau Cymraeg www.cymrux.org.uk - Linux Cymraeg ar un CD -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Kevin Donnelly
No, he's already done the coursework, which involved plotting actual results by hand - he's in year 4 secondary, so least squares would be a bit beyond them!
He can add one or more artificial points and handle the problem as an interpolation. He can place them outside the visible axis range to make them "invisible".
He can just extrapolate the curve manually on the graph paper, but I thought there might be something that could do that more neatly.
There are many software packages which can fit a curve (based on an appropriate mathematical model) to a set of data points (http://root.cern.ch/, http://www.r-project.org/, ...) but they are written for scientists or statisticians ... -- A.M. -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
QtiPlot which is what he is using, will plot out functions Just do a curve fit and in the top window Qtiplot will post the equation of the line. use this equation to plot out a separate function giving it the limits that you want to predict to. I just did this on my copy and it works great for a linear and a Polynomial fits. You have to play with the limits to get the graph the way you want it. BoB C
Kevin Donnelly
writes: No, he's already done the coursework, which involved plotting actual results by hand - he's in year 4 secondary, so least squares would be a bit beyond them!
He can add one or more artificial points and handle the problem as an interpolation. He can place them outside the visible axis range to make them "invisible".
He can just extrapolate the curve manually on the graph paper, but I thought there might be something that could do that more neatly.
There are many software packages which can fit a curve (based on an appropriate mathematical model) to a set of data points (http://root.cern.ch/, http://www.r-project.org/, ...) but they are written for scientists or statisticians ...
-- A.M.
-- Robert Cunningham Sr. Physics Laboratory Coordinator /RSO Kettering University -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Sun, 2006-06-25 at 22:44 +0100, Kevin Donnelly wrote:
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there?
Been a long time since I've been in a physics class, but I don't quite follow the question. If this is a linear circuit (or otherwise), Ohm's law says E=I*R. If he has a constant-current(I) source and a basic resistance, then E vs R is a straight line (until something burns up, that is). If it is a non-linear resistance (ie a semi-conductor material), then predictions are difficult as there are "cut-off" points and "saturation" points to the graph. That said, many graphing calculators will extrapolate formulae from data points, I'd think lab-plot et al would also have that capability. Tom -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Kevin Donnelly wrote:
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there?
Sounds like maybe the instructor wants a curve-fit routine to predict a curve (straight line ?), then plug that curve into any plotting routine to fulfill the intent of the class problem. If he got an equation for the predicted curve, then we are just looking for any good plot routine, like gnuplot http://dmoz.org/Science/Math/Software/Graphing/Gnuplot/ The big high power stuff like Octave and Scilab take more learning time than is left for the weekend :-( Python likewise, so I googled and found another online tool: http://www.tecplot.com/support/tecplot_faqs.htm There are more at http://dmoz.org/Science/Math/Software/Graphing/ -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On 25-Jun-06 Kevin Donnelly wrote:
My son is doing physics coursework, and has a set of figures plotting voltage against resistance. He's used Qtiplot to draw a graph of the resulting curve, but does anybody know of any software which would allow this line to be extrapolated to show likely resistance for a given level of voltage - ie go beyond the actual data from the experiment to show what might happen if the experiment had been extended? It may be that Qtiplot can do this, but I can't find out how. If not, are there any other candidates out there?
-- Pob hwyl / Best wishes
Kevin Donnelly
This is of course a statistical question and, as others have
also said, everything depends on the nature of the relationship
between voltage and resistance in the context that his data
arise from. For extrapolation, you need confidence that an
apparent relationship observed in the data, over the numerical
range in the data, continues to hold outside that range.
For "passive" circuit elements, the relationship between voltage
(V), current (I) and resistance (R) in an element is the familiar
V = I*R
so that provided current (I) is held constant voltage will be
proportional to resistance (until, as someone said, something
burns out). However, an experimental situation in which current
is help constant might be unusual especially in a school
physics, though it is possible to set it up. Another more easily
set up situation is where different external resistances Rext
are connected across a battery which has an "intrinsic voltage"
V0 and an internal resistance Rint, so that the voltage V0 is
driving current round the total resistance (Rint + Rext) and
is split between internal and external in the ratio Rint:Rext.
The the voltage measures across the external resistance would
be given by
V = V0*Rext/(Rint + Rext)
which is not linear as Rext varies (though approximately so for
small values of Rext). And so on.
Non-linear relationships are generally tricky to fit to data
statistically, for various reasons, and it is perhaps unlikely
that such a task would form part of a school Physics coursework
project (though thoughtless examiners might think it was
appropriate).
Be that all as it may, your substantive question concerns the
availability for Linux of software which can fit relationships
to data. I am not going to promote the use of OpenOffice's
equivalent of Excel, since while that will appear to do the
job it will in fact have made up its own mind as to what is
right in your case, possibly will have made errors in the
calculations, and will very probably produce graphs/charts
which are inappropriately formatted. This is not a criticism
of OpenOffice, but of the original software that it emulates
(in this case Excel).
Nevertheless, such an approach may well be what your son's
teachers/examiners expect.
To do a real job, you need software which is written to do
a proper job from the statistical point of view. The best
that I know that will run on Linux is the OpenSource 'R':
http://www.r-project.org
(which is probably available on the SuSE installation disks),
but there is an initial steep learning curve and in any case
it expects you to know at least something about statistical
methods (it's really written for professionals).
An alternative is 'octave' (probably also on SuSE disks),
general-purpose numerical analysis software which is oriented
towards computations with arrays (which is basically what
statistical methods require), and the kind of curve-fitting
problem you described can be programmed (if not already in
one of the 'toolbox' libraries) relatively straightforwardly.
'Octave', by the way, is very closely related to the commercial
software 'MatLab' (just as 'R' is related to 'S-Plus').
Hoping this helps,
Iechyd da / Cheers,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding)
Kevin Donnelly later wrote:
No, he's already done the coursework, which involved plotting actual results by hand - he's in year 4 secondary, so least squares would be a bit beyond them! The above is for the conclusions part, where he wants to say something like "if you change a, b might change as follows". He can just extrapolate the curve manually on the graph paper, but I thought there might be something that could do that more neatly.
Depends what you mean by "neatly". If he's doing it by hand
anyway, then simply drawing a longer line with the ruler
is just as neat as the line he drew in the first place!
However, if you're looking for an approach which in some
sense calculates the extrapolation, rather than simply draws
it (so if "neater" in the sense of "cleaner"), then you are
entering the territory of least squares and all that!
That being said, when it comes to drawing graphs and diagrams
in the midst of nicely formatted text, don't ignore what's
been available in Linux (and indeed Unix) since the year dot
(which in the case of Unix is 1970). Namely the 'groff' package,
which is what's used for producing the formatted man pages,
but is capable of much much fancier stuff than that.
As an example (which makes use of the 'pic' component of groff),
oriented towards your query:
1. Make a text file containing the data on resistance (col 1)
and voltage (col 2) as follows:
50 4.9
55 5.5
60 5.6
65 7.0
70 6.9
75 7.6
80 7.9
85 8.5
90 8.7
95 9.1
100 10.0
and call this file "data.txt" (only the above numbers, and
no blank lines).
2. Make a text file containing the following text:
.LP
Here is my graph of Voltage versus Resistance.
.PS
circrad=0.5
yscale=5
start=1
define blob {
circle radius circrad at ($1,$2*yscale)
}
x0=0 ; y0=0; x1=0; y1=0
define lines {
if start then {
x0=$1 ; y0=$2*yscale ; x1=x0; y1=y0
start=0
} else {
x0=x1 ; y0=y1 ; x1=$1 ; y1=$2*yscale
line from (x0,y0) to (x1,y1)
}
}
.PE
.PS 4i
copy "data.txt" thru blob
copy "data.txt" thru lines
line from (0,0) to (150,0) "" "" "" "" "" "\fBResistance\fP"
for i=0 to 15 do {
r=10*i
line from (r,0) to (r,-0.2*yscale)
"" "" sprintf("%.0f",r) at end of last line
}
line from (0,0) to (0,16*yscale)
for i=0 to 8 do {
v=2*i
line from (0,v*yscale) to (-2,v*yscale)
sprintf("%.0f ",v) rjust at end of last line
}
line invis from (-15,0) to (-15,16*yscale) "\fBVoltage\fP" aligned
dashwid=2
line dashed from (0,0.2*yscale) to (150,14.7*yscale)
.PE
.sp 3
.LP
The dashed line was drawn by eye through the experimental data.
It can be used for extrapolation.
However, it does not go through the origin, which it should!
and call this file "physics_ex.tr"
3. Now, on any Linux system, execute the command
groff -p physics_ex.tr > physics_ex.ps
and you will have a PostScript file with a very nice diagram in it.
If you want neat, this gives you neat!
The key to the plotting of the data points is the "copy thru"
command, which in its first instance plots the points from the data
file, and in the second instance draws the lines joining the points.
Then there's a dashed line through two points which the student
could have read off from graph paper having drawn a line by eye
with a ruler.
All the rest is furniture.
The above may look formidable at first sight, but it's not nearly
as bad as it looks when you get down to it (provided you get the
syntax right). In fact, it's not a hundred miles from the good
old Turtle Graphics which some of us might remember!
In the past I've used this sort of thing with schoolchildren.
For example with a 14-year-old who was by no means a mathemtician,
and had been set a project task of designing a cut cardboard
shape which was to be folded into a box with a lid, with folding
tabs to glue the whole thing together.
Once I'd set up the basic framework on similar lines to the above,
the rest was a matter of choosing the numbers so as to produce
a good result, and the child progressively caught on to the
idea of using numbers (x,y) for the position of a point, and
then to composing the elements of an object using such points
(i.e. the rectangles for the sides and lid etc., and trapezoidal
shapes for the folding tags, and putting these in the right
positions); so in fact picked up a bit of coordinate geometry
on the side!
Best wsihes,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding)
participants (7)
-
Alexandr Malusek
-
Jos van Kan
-
Kevin Donnelly
-
Robert Cunningham
-
Stanley Long
-
Ted.Harding@nessie.mcc.ac.uk
-
Tom Patton