Lagrange
#1
Posted 13 June 2007 - 11:32 AM
Thanks
#2
Posted 13 June 2007 - 10:19 PM
Well, it isn't difficult to write a program for this (in CPLua, of course), but do you really need it? Lagrange interpolation is usually not the best choice. Do yourself a favor, use cubic splines instead. It's way more precise in most cases. I've included linear and cubic spline interpolations in LNA, but not Lagrange (and I'm not planning to add it).Is there any program/add in that could make Lagrange interpolation.?
#3
Posted 14 June 2007 - 07:28 AM
#4
Posted 15 June 2007 - 03:38 PM
English edition of what? If you mean a version of Lagrange interpolation, my answer is no. It can be easily done in CPLua, but, as I have explained before, Lagrange interpolation is superseded by Cubic Spline interpolation. I 'm not planning to add poor algorithms in LNA, and Lagrange interpolation is a poor algorithm, useful only for pedagogical purposes. In general, introductory algorithms will never included in LNA.Can you release english edition,please?!
#5
Posted 05 July 2007 - 02:54 PM
i want to aplly an interpolation to, example:
2 line matrix:
x: | 1433| 2750| 3683| 4200| 4516|
y: | 5000|10000|15000|20000|28000|
i want to know y, when x=3940..
something like this...
i still can?t do this.. Can someone show me how? Thanks.
#6
Posted 05 July 2007 - 06:22 PM
Use LNA to do cubic spline interpolation. For example, the following CPLua code will return y for a user-defined x:thank you all.
i want to aplly an interpolation to, example:
2 line matrix:
x: | 1433| 2750| 3683| 4200| 4516|
y: | 5000|10000|15000|20000|28000|
i want to know y, when x=3940..
something like this...
i still can?t do this.. Can someone show me how? Thanks.
require("LNA/CSpline") local xdata,ydata,scoeff,x xdata={1433,2750,3683,4200,4516} ydata={5000,10000,15000,20000,28000} scoeff=CreateSpline(xdata,ydata) x=input("Give x:") print(CubicSpline(x,0,xdata,scoeff))You can also calculate interpolating 1st and 2nd order derivatives if you want. See LNA manual, especially pages 48-52
P.S.: Why do I spend hours ans hours to write LNA's documentation, since none wants to read it?
#8
Posted 06 July 2007 - 02:30 PM
Hmmm, you are totally confused here. CSpline is part of LNA, a project I'm developing for ClassPad, so you need to install LNA. LNA, in turn, needs a programming language called CPLua to run, so you need CPLua as well (you really don't know anything about CPLua? you use CPBasic so far? )i don't understant that much of LNA.
but i'll try..
I already write that code, but i need LNA/CSpline.. Where can i get it?
LNA's documentation?
Do you refer do the PDF version that is in this page???
So, if you want to use the program I have posted, you have to:
(1) Install CPLua. Here is the link, but you really need to read stuff about CPLua itself first.
(2) Install (in fact, transfer) LNA. Here is LNA's topic in the File Sharing, where you will find links to download LNA and its documentation. You will certainly need to read the documentation, at least parts of it.
(3) Write the program I have posted in CPLua's editor and run it.
P.S.: If you expect you will be able to use LNA's capabilities without reading anything, you will be highly disappointed.
#9
Posted 06 July 2007 - 04:58 PM
You bet..
-CPBasic so far?
Yes.. when i need something more, I'm too busy(studying) and i haven't time to learn...
This evening i'll take a look.. THANK YOU..
#10
Posted 07 July 2007 - 08:11 AM
Do yourself a favour: whenever you have some free time to spend, run, do not walk, to the CPLua project topic, and forget CPBasic once and for all.-CPBasic so far?
Yes.. when i need something more, I'm too busy(studying) and i haven't time to learn...
#11
Posted 09 July 2007 - 09:56 AM
runtime Error:
LNA/CSpline:115: attempt to compare string with number
i edited the program to:
require("LNA/CSpline")
local xdata,ydata,scoeff,x
xdata={1433,2750,3683,4200,4516}
ydata={5000,10000,15000,20000,28000}
scoeff=CreateSpline(xdata,ydata)
x=3940
print(CubicSpline(x,0,xdata,scoeff))
now it works..
#12
Posted 09 July 2007 - 01:44 PM
The correct line should be
x=tonumber(input("Give x:"))
#13
Posted 09 July 2007 - 04:40 PM
#14
Posted 09 July 2007 - 07:24 PM
the only programmation language i know is C... the 'mother' of all languages i think.
where can i learn a bit more of this CPLua language??
#15
Posted 10 July 2007 - 09:45 AM
Totally incorrect. The first high-level programming language was Fortran, introduced in 1956, decades before C. Since then, Fortran has been upgraded several times, and today is a full module-oriented programming language, ideal for mathematical programming (where C/C++ s*cks hard).the only programmation language i know is C... the 'mother' of all languages i think.
Start here, and please search casiocalc a little bit, before asking something already answered.where can i learn a bit more of this CPLua language??
#16
Posted 10 July 2007 - 10:51 AM
Totally incorrect. The first high-level programming language was Fortran, introduced in 1956, decades before C. Since then, Fortran has been upgraded several times, and today is a full module-oriented programming language, ideal for mathematical programming (where C/C++ s*cks hard).
Start here, and please search casiocalc a little bit, before asking something already answered.
Perhaps i exagereated when i said 'the mother of all languages'..
But C is a very inportant language .This language influenced: awk, csh, C++, C#, Objective-C, BitC, D, Concurrent C, Java, JavaScript, Limbo, Perl,PHP..
I've already saw that PDF guide. i only asked beacause you know the language and i wanted the best guide...
Thanks
#17
Posted 10 July 2007 - 03:07 PM
(Fortunately for you, the Lua language is closer from C than Fortran, so don't worry )
#18
Posted 12 July 2007 - 01:11 AM
#include all_your_base_are_belong_to_us.h
#19
Posted 12 July 2007 - 04:44 PM
"Engrish"? . If you mean "English", I strongly disagree. English is a rather poor language, compared to my native language, or German, or French .Engrish is the best of the programming languages
#include all_your_base_are_belong_to_us.h
Anyway, there is no "best programming language". You want to write a mathematical program? Fortran. An applet game? Java. An operating system? C++. A graphical user interface? all of the above languages will do, and even more.
#20
Posted 13 July 2007 - 01:17 AM
#21
Posted 13 July 2007 - 12:55 PM
Ok, I admit it (but don't tell it to anyone): I knew nothing about "Engrish" and the "All our base are belong to us" joke . Funny and horrible translation, even my English is better than this .Dude!.. Engrish!.. WITH R.. see Engrish on Wikipedia. For sure you don't remember the ALL YOUR BASE ARE BELONG TO US joke
ALL YOUR ClassPad ARE BELONG TO ME
#22 Guest_Guest_akdov_*_*
Posted 09 March 2010 - 09:49 AM
im working on lagrange interpolation right now,
if i start with this loop (from C++)
for (i=0; i<=n; i++)
{
cin >> x[i] >> y[i];
}
translating it to casio,
for 0->I to N step 1
"X[I]" ? -> // going to wat ? how can i put an index in casio ?
"Y[I]" ? -> //same question
Next
#23
Posted 09 March 2010 - 09:13 PM
i need help in translating C++ programs into casio ones:
im working on lagrange interpolation right now,
if i start with this loop (from C++)
for (i=0; i<=n; i++)
{
cin >> x[i] >> y[i];
}
translating it to casio,
for 0->I to N step 1
"X[I]" ? -> // going to wat ? how can i put an index in casio ?
"Y[I]" ? -> //same question
Next
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users