Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
challenge finite difference
#1
hey all a finite difference program would be great for anyone who is in highschool or even university who is doing finite differences and wants teh answer as quick as possible.

also a long search on google for finite difference program using Qbasic was a failure. i believe that if anyone on this forum makes a finite difference program will be the first people to ever make one and post it on the net.

so thats my challenge, make a finite difference program.

It has to calculate finite differences and put it into its equation
(ex. ax^3 + bx^2 + cx + d)

and then it needs to solve for each variable
(i.e: a, b, c, d)

at the beginning of the program it needs to ask the user something like this, "input the x-values" then say "input the y-values" then it needs to do its magic by itself without the user really having to do anything much after that.

i have already got it started but i just got an upgrade in my position at work and i have no time to comlete it. here is the begining of it:



CLS
CONST MaxValues = 8
DIM X(MaxValues) AS INTEGER
DIM Y(MaxValues) AS INTEGER
PRINT "Enter x-values. Just press Enter when finished"
DO
LINE INPUT "X = "; n$: IF n$ = "" THEN EXIT DO
Goof = 0
FOR i = 1 TO LEN(n$)
IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN
PRINT "Sorry, bad number": Goof = 1: EXIT FOR
END IF
NEXT i
IF Goof = 0 THEN HowMany = HowMany + 1: X(HowMany) = VAL(n$)
LOOP
PRINT : PRINT "OK, now enter the Y-values"
FOR GetY = 1 TO HowMany
PRINT "X = "; X(GetY); " Y = ";
DO
Goof = 0
DO
LINE INPUT n$
IF n$ = "" THEN PRINT "You must enter a value"
LOOP WHILE n$ = ""
FOR i = 1 TO LEN(n$)
IF INSTR("0123456789", MID$(n$, i, 1)) = 0 THEN
PRINT "Sorry, bad number": Goof = 1: EXIT FOR
END IF
NEXT i
LOOP WHILE Goof = 1
Y(GetY) = VAL(n$)
NEXT GetY
FOR i = 1 TO HowMany
PRINT "X ="; X(i), "Y ="; Y(i)
NEXT i
SYSTEM
Reply
#2
http://mathworld.wolfram.com/FiniteDifference.html
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#3
yeah but it doesn't have a program that a noob can use, it needs to be a copy and pastable program, this one needs to be put together still.
Reply
#4
The formula they state is exactly the same as the one you're looking for, right?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#5
ok how do you make the y-values subtrat themselves and find the differences, until all the y-values are the same adn dot any further?
Reply
#6
Honestly, I have no idea what they're talking about there. I meant implementing [8] and [9].
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#7
If that's what you want I can easily make something to do it.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#8
ok yeah go for it, make something, do what you think i want, because i believe we are talking about teh same thing were just not understaning each other.

so i say go for it and do it
Reply
#9
I'm doing it.. Almost done. Will be up tomorrow I think.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#10
Hey Cooliebai when's your homework due?
This is a tricky problem no wonder it's worth extra marks. Any code you copy will not be believed that it was wrote by you. Plaguarism is an ugly word (and difficult to spell).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)