Jump to content
Arul

Unknown value using compose

Recommended Posts

Hi all,

 

In below equation Nf is unknown and remaining are known values. How to write the code using compose to find out the Nf?

 

image.png.8d186084e02dfff1c6503e7a2a5555f6.png

Share this post


Link to post
Share on other sites

"info" ,  used in this command  :

[x,fval,info] = fzero(x_zeros, [xstart xend]); 

was added in version 2019.  To run the script in earlier version, remove it :

[x,fval] = fzero(x_zeros, [xstart xend]); 

and of course remove the test starting with  "if info ==1"

 

Share this post


Link to post
Share on other sites

Hi Arul,

 

I have modified the script a little bit according to the help of 'fzero'
 

clc,clear

function output = equation(Nf)
    dEps = 0.5;
    Eps = 0.8;
    Sigma = 90;
    E = 30;
    c = 0.8;
    b = 0.9;
    
    output = Sigma/E*(2*Nf)^b + Eps*(2*Nf)^c-dEps/2;
end

options = optimset('TolX', 1.0e-8);
interval = [0, 6];
[x,fval] = fzero(@equation, interval, options)

It's running in 2017.3 without any problem.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×