Hi. im just quite new to c program and i need help on who can give me the source code. This is about Interval search method or OSM in numerical method analysis.

The program should solve a given equation f(x)

example: f(x)= x^2+2x+3

Given the function f(x)=0 (this would be the equation given)

STEP

1. Set the initial value xi.( This should ask the user to input a value of xi)

2. Set the initial increment dx.( This should ask the user to input a value of dx)

3. set the termination condition e.( This will be the absulute value of f(xi+dx) also called the error.)

4. Subsititute (xi+dx) to f(x). (The resulting substitution is now called f(xi+dx). )

xi + dx= (xi+dx), (xi+dx) substituted to the value of x of f(x) w/c results to f(xi+dx)

5. Note the sign of f(x). If there is a change of sign in f(xi+dx) reduce the value of dx. (If the sign of the equation changes after the substitution it should ask to decrease the value of dx by .0001)


6. Check the value of ek=f(xi+dx)>e.( The ek is the new e after the change in sign)

7. Repeat procedure 4 to 6.

pls teach me how. Im just a beginner.

Edited 7 Years Ago by jezareal: n/a

Hi. im just quite new to c program and i need help on who can give me the source code.

I'm sorry to tell you you're off to a bad start. If you want source code, search. Search the web, search forums. Or make your own attempt. Find something to start with that you feel comfortable with and comes closest to what you want.

But just make sure you don't simply list "your requirements" as if people are supposed to automagically serve you up some source code.

The program should solve a given equation f(x)

example: f(x)= x^2+2x+3

Given the function f(x)=0 (this would be the equation given)

STEP

1. Set the initial value xi.( This should ask the user to input a value of xi)

2. Set the initial increment dx.( This should ask the user to input a value of dx)

3. set the termination condition e.( This will be the absulute value of f(xi+dx) also called the error.)

4. Subsititute (xi+dx) to f(x). (The resulting substitution is now called f(xi+dx). )

xi + dx= (xi+dx), (xi+dx) substituted to the value of x of f(x) w/c results to f(xi+dx)

5. Note the sign of f(x). If there is a change of sign in f(xi+dx) reduce the value of dx. (If the sign of the equation changes after the substitution it should ask to decrease the value of dx by .0001)


6. Check the value of ek=f(xi+dx)>e.( The ek is the new e after the change in sign)

7. Repeat procedure 4 to 6.

Oops. Too late.

pls teach me how. Im just a beginner.

Okay. Let's back up and start over.

  1. Read this announcement.
  2. Again, search for some code to start with, or write your own.
  3. Once you have this code, make an attempt at adapting it. (Maybe even consider mentioning the source by providing a link to where you found the base code if you found it from a search.)
  4. Mention the issues you are having with the code -- what are the things that you would like to do different, or what are errors you encounter (copy and paste is wonderful for these), etc.
  5. Post the code you are working with. Don't paraphrase it; post code that is complete and compilable and demonstrates the errors or issues you have. And post code in code tags.

Edited 7 Years Ago by Dave Sinkula: n/a

Comments
What a way of bending over to "really" help.
More patient than I would have been.
This article has been dead for over six months. Start a new discussion instead.