Jabz

433 Reputation

5 Badges

12 years, 296 days

MaplePrimes Activity


These are replies submitted by Jabz

Thank you for the explanation. So i would get a more accurate time if i use 'time()' instead of 'time[real]'. I'll try just time and see what happens. Thanks again

This way is much better. I didn't know that the whole code is needed inside the time[real](). The time still changes tho but it dosen't matter as long as it gives an accurate time.
 

Thank you for the help much appriciated

This way is much better. I didn't know that the whole code is needed inside the time[real](). The time still changes tho but it dosen't matter as long as it gives an accurate time.
 

Thank you for the help much appriciated

Sorry i am still  very new to maple. Can you plz explain what you mean by 'more steps' and 'worming up'. I don't understand.
 

 

Sorry i am still  very new to maple. Can you plz explain what you mean by 'more steps' and 'worming up'. I don't understand.
 

 

I gt the procedure working fully now i had to add another loop and add i:=nops(o): for the loop to stop.

Thank u Scott for ur assistance

I gt the procedure working fully now i had to add another loop and add i:=nops(o): for the loop to stop.

Thank u Scott for ur assistance

Thank u for ur reply. I had an attempt at making a nth section procedure but there is a problem in the loop.
 

 

restart:
n:=3:
 a:=3:
 b:=5:
   f:=x->x^2 - 2*x - 11:
 
   L:=[seq((i*b+a*(n-i))/n,i=1..n)];
    M:=[a,op(L)];
     o:=[seq(evalf((M[i])),i=1..n+1)];

for i from 1 to (nops(o)-1) do
 f (o[i]) * f(o[i+1]) < 0:
    if sign(f(o[i])) * sign(f(o[i+1])) < 0 then
     a:=o[i]:
     b:=o[i+1]:
   fi:
od;

 

this returns an nothing not even an error what have i done wrong?

P.s. this is not the procedure i want to get the program working properly first before i put it in a procedure.

Thank u for ur reply. I had an attempt at making a nth section procedure but there is a problem in the loop.
 

 

restart:
n:=3:
 a:=3:
 b:=5:
   f:=x->x^2 - 2*x - 11:
 
   L:=[seq((i*b+a*(n-i))/n,i=1..n)];
    M:=[a,op(L)];
     o:=[seq(evalf((M[i])),i=1..n+1)];

for i from 1 to (nops(o)-1) do
 f (o[i]) * f(o[i+1]) < 0:
    if sign(f(o[i])) * sign(f(o[i+1])) < 0 then
     a:=o[i]:
     b:=o[i+1]:
   fi:
od;

 

this returns an nothing not even an error what have i done wrong?

P.s. this is not the procedure i want to get the program working properly first before i put it in a procedure.

thank u very much 4 ur help.

 

 

I don't understand y i keep on getting the answer

x = H( t - 2 ) ( ( e ^ - 4 ( t - 2 ) + e ^ - ( t - 2) ) / 3 ) - 4 / 3 e ^ - 4 ( t - 2 ) + 10 / 3 e ^ - ( t - 2 )
 

when i do it by hand. I must have made a mistake wen i done the partial fractions. I'll check that

 

thnx

thank u very much 4 ur help.

 

 

I don't understand y i keep on getting the answer

x = H( t - 2 ) ( ( e ^ - 4 ( t - 2 ) + e ^ - ( t - 2) ) / 3 ) - 4 / 3 e ^ - 4 ( t - 2 ) + 10 / 3 e ^ - ( t - 2 )
 

when i do it by hand. I must have made a mistake wen i done the partial fractions. I'll check that

 

thnx

This code seems to work can sm1 plz tell me if its correct.
 

 

restart:
n:=3:
    s:=Matrix([[2,1/3,-2/3],[-5/4,-5,5/4],[21/5,-14/5,7]]):
       b:=[2/3,-15/2,98/5]:
          X:=[0,0,0]:
             maxitr:=11:

 for k from 1 to maxitr do
    print(`Iteration number`);
      k;
       print(`Previous iteration value`);
         X_0:=X;


          for i from 1 to n do

            summ:=0.0:

          for j from 1 to n do

            if (i<>j) then
            summ:=summ + (s[i,j]*X[j]);

         end if;
       end do:

     X[i]:=(b[i]-summ)/s(i,i);
    end do;

   print(`new iterative value`);
       X;
end do;


 

This code seems to work can sm1 plz tell me if its correct.
 

 

restart:
n:=3:
    s:=Matrix([[2,1/3,-2/3],[-5/4,-5,5/4],[21/5,-14/5,7]]):
       b:=[2/3,-15/2,98/5]:
          X:=[0,0,0]:
             maxitr:=11:

 for k from 1 to maxitr do
    print(`Iteration number`);
      k;
       print(`Previous iteration value`);
         X_0:=X;


          for i from 1 to n do

            summ:=0.0:

          for j from 1 to n do

            if (i<>j) then
            summ:=summ + (s[i,j]*X[j]);

         end if;
       end do:

     X[i]:=(b[i]-summ)/s(i,i);
    end do;

   print(`new iterative value`);
       X;
end do;


 

that was a miss print. this is the problem

restart:
 NEWTON_RAPH:= proc(f,z,M)
   local x,A:
    x := z:
    for A to M do:
      x := (x -(f(x)/D(f)(x)) -((((D@@2)(f))*((f(x))^2))/(2*(D(f)(x))^3)))
       end do:
    evalf(x):
  end proc:
 f:= x-> x^2-5:
 NEWTON_RAPH(f,1,10);
                                     1.
 

that was a miss print. this is the problem

restart:
 NEWTON_RAPH:= proc(f,z,M)
   local x,A:
    x := z:
    for A to M do:
      x := (x -(f(x)/D(f)(x)) -((((D@@2)(f))*((f(x))^2))/(2*(D(f)(x))^3)))
       end do:
    evalf(x):
  end proc:
 f:= x-> x^2-5:
 NEWTON_RAPH(f,1,10);
                                     1.
 

4 5 6 7 8 9 Page 6 of 9