Results 1 to 4 of 4

Math Help - relative error graph

  1. #1
    Newbie
    Joined
    Apr 2010
    Posts
    2

    relative error graph

    can u pls solve this? i tried all what i know.

    the elationship between the resistance R of the thermistor and the temperature is given by
    (1/T)-1.129241*10^(-3)=2.341077*10^(-4)*log(R)+8.775468*10^(-8)*(log(R))^(3)

    where T is in Kelvin and R is in ohms.
    A thermistor error of no more than 0.01C is acceptable. To find the range of the
    resistance that is within this acceptable limit at 19C , we need to solve
    1/19.01+ 273.15=1.129241×10^(-3) + 2.341077×10^(−4)*ln(R) + 8.775468 × 10^(−8)* {ln(R)}^(3)
    and
    1/18.99 + 273.15= 1.129241× 10^(−3) + 2.341077 × 10^(−4) ln(R) + 8.775468 × 10^(−8) {ln(R)}^3
    Use Newton’s method to find the resistance at 18.99C. Find the absolute relative
    approximate error at the end of each iteration, and plot relative approximate error versus
    iteration number.





    clear all
    clc
    R=solve('(1/(18.99+273.15))-1.129241*10^(-3)=2.341077*10^(-4)*log(R)+8.775468*10^(-8)*(log(R))^(3)'); %gercek R degeri
    Ri=3; tol=273.15+0.01; error=273.15+10;
    k=1; a=1;

    while error>=tol
    f=1.129241*10^(-3)+2.341077*10^(-4)*log(Ri)+8.775468*10^(-8)*(log(Ri))^(3)-(1/(18.99+273.15));
    df=((2.341077*10^(-4))/(Ri))+(8.775468*10^(-8)*3*(log(Ri))^2)/Ri;
    Rnew=Ri-(f/df);
    fnew=1.129241*10^(-3)+2.341077*10^(-4)*log(Rnew)+8.775468*10^(-8)*(log(Rnew))^(3)-(1/(18.99+273.15));
    error=abs(fnew);
    relativeerror=(error/R);
    Ri=Rnew
    k=k+1;
    end
    plot(k,relativeerror)



    i wrote program this but i cant take the plot of all iteration what do u sugges??
    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 emforny View Post
    can u pls solve this? i tried all what i know.

    the elationship between the resistance R of the thermistor and the temperature is given by
    (1/T)-1.129241*10^(-3)=2.341077*10^(-4)*log(R)+8.775468*10^(-8)*(log(R))^(3)

    where T is in Kelvin and R is in ohms.
    A thermistor error of no more than 0.01C is acceptable. To find the range of the
    resistance that is within this acceptable limit at 19C , we need to solve
    1/19.01+ 273.15=1.129241×10^(-3) + 2.341077×10^(−4)*ln(R) + 8.775468 × 10^(−8)* {ln(R)}^(3)
    and
    1/18.99 + 273.15= 1.129241× 10^(−3) + 2.341077 × 10^(−4) ln(R) + 8.775468 × 10^(−8) {ln(R)}^3
    Use Newton’s method to find the resistance at 18.99C. Find the absolute relative
    approximate error at the end of each iteration, and plot relative approximate error versus
    iteration number.





    clear all
    clc
    R=solve('(1/(18.99+273.15))-1.129241*10^(-3)=2.341077*10^(-4)*log(R)+8.775468*10^(-8)*(log(R))^(3)'); %gercek R degeri
    Ri=3; tol=273.15+0.01; error=273.15+10;
    k=1; a=1;

    while error>=tol
    f=1.129241*10^(-3)+2.341077*10^(-4)*log(Ri)+8.775468*10^(-8)*(log(Ri))^(3)-(1/(18.99+273.15));
    df=((2.341077*10^(-4))/(Ri))+(8.775468*10^(-8)*3*(log(Ri))^2)/Ri;
    Rnew=Ri-(f/df);
    fnew=1.129241*10^(-3)+2.341077*10^(-4)*log(Rnew)+8.775468*10^(-8)*(log(Rnew))^(3)-(1/(18.99+273.15));
    error=abs(fnew);
    relativeerror=(error/R);
    Ri=Rnew
    k=k+1;
    end
    plot(k,relativeerror)



    i wrote program this but i cant take the plot of all iteration what do u sugges??
    You would make a good start by simplifying your equations (by collecting all the constant terms for example)

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2010
    Posts
    2
    Quote Originally Posted by CaptainBlack View Post
    You would make a good start by simplifying your equations (by collecting all the constant terms for example)

    CB
    clear all
    clc
    R=solve('0.0023=2.3411e-004*log(R)+8.7755e-008*(log(R))^(3)'); %gercek R degeri
    Ri=3; tol=0.01; error=273.15+10;
    k=1; a=1;

    while error>=tol
    f=0.0011+2.3411e-004*log(Ri)+8.7755e-008*(log(Ri))^(3)-0.0034;
    df=(19891740993802833*log(Ri)^2)/(75557863725914323419136*Ri) + 4318567255096143/(18446744073709551616*Ri);
    Rnew=Ri-(f/df);
    fnew=1.129241*10^(-3)+2.341077*10^(-4)*log(Rnew)+8.775468*10^(-8)*(log(Rnew))^(3)-(1/(18.99+273.15));
    error=abs(fnew);
    relativeerror=(error/R);
    Ri=Rnew
    k=k+1;
    plot(k,relativeerror)
    end



    like tihs??? i have to deliver this homework today i do all of these and i dont to take a lower grade i just cant make a plot the matlab
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    It grates not to have you change this into decent code but try:

    Code:
    clear all
    clc
    R=solve('0.0023=2.3411e-004*log(R)+8.7755e-008*(log(R))^(3)'); %gercek R degeri
    Ri=3; tol=0.01; error=273.15+10;
    k=1; a=1;
    
    RE=[];
    
    while error>=tol
        f=0.0011+2.3411e-004*log(Ri)+8.7755e-008*(log(Ri))^(3)-0.0034;
        df=(19891740993802833*log(Ri)^2)/(75557863725914323419136*Ri)+ ...
              4318567255096143/(18446744073709551616*Ri);
    
        Rnew=Ri-(f/df);
        fnew=1.129241*10^(-3)+2.341077*10^(-4)*log(Rnew)+ ---
                8.775468*10^(-8)*(log(Rnew))^(3)-(1/(18.99+273.15));
        error=abs(fnew);
        relativeerror=(error/R);
        RE=[RE,relative error];
        Ri=Rnew
        k=k+1;
        %plot(k,relativeerror)
    end
    
    plot(RE)
    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Relative error
    Posted in the Math Topics Forum
    Replies: 3
    Last Post: August 8th 2010, 11:35 AM
  2. Relative and absolute error
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 3rd 2010, 09:31 AM
  3. Relative Error & Maximum Error
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: March 10th 2010, 02:40 AM
  4. Relative Error through Differentials
    Posted in the Calculus Forum
    Replies: 2
    Last Post: July 6th 2009, 09:02 PM
  5. absolute and relative error
    Posted in the Math Topics Forum
    Replies: 5
    Last Post: September 1st 2008, 09:35 PM

Search Tags


/mathhelpforum @mathhelpforum