Results 1 to 2 of 2

Math Help - Solving Nonlinear Equation in Matlab

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    1

    Solving Nonlinear Equation in Matlab

    I need to solve for B and n in for these two equations using the gamma
    function.
    175=n*gamma(1+1/B)
    25=n*sqrt(gamma(1+2/B)-(gamma(1+1/B))^2)


    This is the code I have formulated but my professor informed me I did
    something wrong and am getting the incorrect answer. The B variable
    should probably be around 1. Any help would be appreciated.


    clear all; close all; clc;

    eq1='175=x*gamma(1+(1/y))';
    eq2='25=x*sqrt(gamma(1+(2/y))-(gamma(1+(1/y)))^2)';
    vars='x,y'
    W=solve(eq1,eq2,vars);

    n=eval(W.x)
    B=eval(W.y)
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by aggie09 View Post
    I need to solve for B and n in for these two equations using the gamma
    function.
    175=n*gamma(1+1/B)
    25=n*sqrt(gamma(1+2/B)-(gamma(1+1/B))^2)


    This is the code I have formulated but my professor informed me I did
    something wrong and am getting the incorrect answer. The B variable
    should probably be around 1. Any help would be appreciated.


    clear all; close all; clc;

    eq1='175=x*gamma(1+(1/y))';
    eq2='25=x*sqrt(gamma(1+(2/y))-(gamma(1+(1/y)))^2)';
    vars='x,y'
    W=solve(eq1,eq2,vars);

    n=eval(W.x)
    B=eval(W.y)
    >help solve

    will tell you why you do not have a symbolic solution. "solve" solves algebraic equations, if it cant solve them it returns a numeric solution which is what you have.

    There appears to be more than one solution, there is another with B~= +8.330

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. solving an nonlinear exp equation
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: June 13th 2011, 09:04 AM
  2. [SOLVED] Solving simple Nonlinear equation ?
    Posted in the Pre-Calculus Forum
    Replies: 9
    Last Post: April 6th 2009, 12:46 AM
  3. Nonlinear differential equation MATLAB
    Posted in the Advanced Applied Math Forum
    Replies: 1
    Last Post: December 30th 2008, 07:27 AM
  4. MATLAB Second order nonlinear differential equation
    Posted in the Math Software Forum
    Replies: 2
    Last Post: December 15th 2008, 08:00 PM
  5. help in solving nonlinear equation
    Posted in the Algebra Forum
    Replies: 4
    Last Post: December 13th 2008, 07:55 AM

Search Tags


/mathhelpforum @mathhelpforum