Need help creating a function m-file for the bisection method for the following equation...
Show older comments
I'm really stuck on an assignment that regards the bisection method. This is due to me missing all of my lectures for the module because I have transferred course from Chemical to Mechanical Engineering. I can't get help from within the University as it is outside of term-time now and I am back home.
I am having great difficulty with the following task for which I have been given these values:
k = 1; n = 0.6833; U = 1.0714; Pgrad = -3.333333.....
I am then given the following equation defining the pressure gradient in a pipe of radius 'R' (the only unknown in the equation):
Pgrad = -2k * ( ( U * (3n + 1) ) / ( n * R ^ (1 + 1/n) ) ) ^ n
Use the bisection method to determine an approximate value of R, with an absolute error of less than 1 x 10^-6.
I'm not expecting someone to come up with the whole m-file or anything, but any help whatsoever would be greatly appreciated. I've spent hours and hours trying to catch up with where I should be on the course and even resorted to watching videos on Youtube to see if any could help.
Even if people could just try and point me in the right direction.
Thanks
(Here is the question from the actual assignment sheet)

1 Comment
Rothanak
on 9 Jun 2023
Find the value of 3: a. Write in file M file of it define function. b. Find the root using bisection method in interval [1,2].
Accepted Answer
More Answers (1)
Walter Roberson
on 15 Dec 2013
fun = @(R) -2k * ( ( U * (3n + 1) ) / ( n * R ^ (1 + 1/n) ) ) ^ n - Pgrad
now apply the bisection method to find the R such that fun® = 0
Hint: there is an analytic solution, which is
R = exp((ln(U*(3*n+1)/n)*n-ln(-(1/2)*Pgrad/k))/(n+1))
To as many decimal places as your provide,
R = (20/22776664389) * 7^(6833/16833) * 11^(6833/16833) * 487^(6833/16833) * 4357^(6833/16833) * 2^(15835/16833) * 5^(15835/16833) * 6833^(10000/16833) * 3^(6833/16833) * 239^(6833/16833) * 4649^(6833/16833)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!