MATLAB Answers

Solving a equation for the X value with the given Y value

78 views (last 30 days)
Hi all,
I have a function like this "y = @(x) (x./E) + (x./K).^(1/n);" with E = 209000, K = 1230, n = 0.1610 respectively. Basically, it is a Ramberg-Osgood equation. How can I solve it with the input of y = [0:0.0006:0.006] for x value?
Thanks in advance.
Kon

  2 Comments

Yat Sheng Kong
Yat Sheng Kong on 2 Apr 2019
Hi ravi,
Thanks for your comment. Then I get a very small value like "0 2.87081339712919e-09 5.74162679425837e-09 8.61244019138756e-09 1.14832535885167e-08 1.43540669856459e-08 1.72248803827751e-08 2.00956937799043e-08 2.29665071770335e-08 2.58373205741627e-08 2.87081339712919e-08" in which I think it used this "y(0:0.0006:0.006)" as x-value for y output. What I try to obtain is the opposite way. The value of input of 0.0006, the output should be around 122.7.
Capture.JPG

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 2 Apr 2019
Result=zeros(numel(y),1);
for k=2:numel(y)
Result(k)=fzero(@(x)(x./E) + (x./K).^(1/n)-y(k),100*k);
end

  2 Comments

Yat Sheng Kong
Yat Sheng Kong on 2 Apr 2019
Thanks for this and I really appreciated it. By the way, can I know how to determine the initial value x0?
madhan ravi
madhan ravi on 2 Apr 2019
It’s just a guess, plot using fplot() to get an idea.

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by