1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
3 years ago
8

Find the root using bisection method with initials 1 and 2 for function 0.005(e^(2x))cos(x) in matlab and error 1e-10?

Computers and Technology
1 answer:
frutty [35]3 years ago
5 0

Answer:

The root is:

c=1.5708

Explanation:

Use this script in Matlab:

-------------------------------------------------------------------------------------

function  [c, err, yc] = bisect (f, a, b, delta)

% f the function introduce as n anonymous function

%       - a y b are the initial and the final value respectively

%       - delta is the tolerance or error.

%           - c is the root

%       - yc = f(c)

%        - err is the stimated error for  c

ya = feval(f, a);

yb = feval(f, b);

if  ya*yb > 0, return, end

max1 = 1 + round((log(b-a) - log(delta)) / log(2));

for  k = 1:max1

c = (a + b) / 2;

yc = feval(f, c);

if  yc == 0

 a = c;

 b = c;

elseif  yb*yc > 0

 b = c;

 yb = yc;

else

 a = c;

 ya = yc;

end

if  b-a < delta, break, end

end

c = (a + b) / 2;

err = abs(b - a);

yc = feval(f, c);

-------------------------------------------------------------------------------------

Enter the function in matlab like this:

f= @(x) 0.005*(exp(2*x)*cos(x))

You should get this result:

f =

 function_handle with value:

   @(x)0.005*(exp(2*x)*cos(x))

Now run the code like this:

[c, err, yc] = bisect (f, 1, 2, 1e-10)

You should get this result:

c =

   1.5708

err =

  5.8208e-11

yc =

 -3.0708e-12

In addition, you can use the plot function to verify your results:

fplot(f,[1,2])

grid on

You might be interested in
Write a method that takes two arguments: two integers. The integers are then squared, added and the result printed on the screen
diamong [38]

Answer:

import java.util.Scanner;

class Main

{

   

     public static void main(String[] args)  

     {

     System.out.println(" Enter the the two numbers:");

     Scanner input = new Scanner(System.in);

     int a = input.nextInt();

     int b = input.nextInt();

     int c = sumsquareFunction(a, b);

     System.out.println("Sum of Square of two numbers are:" + c);

     }

public static int sumsquareFunction(int n1, int n2) {

     int c= n1*n1 + n2*n2;

     return c;  

  }

}

Explanation:

Please check the answer.

6 0
3 years ago
We look for trends when we are looking at data. What is a trend?
yulyashka [42]
A subject of what people say at the time, most used, famous at the present time
4 0
3 years ago
Read 2 more answers
What are the differences between a slate PC, ultrabook, and a tablet?
Vinvika [58]

Answer: The differences between ultra-book, tablet and slate PC  are mentioned as follows:-

  • Ultra-book is the notebook structure thin and slim device whereas tablets are type of computer shaped laptops in small size and slate PC has detachable display screen and is a replacement of tablet .
  • Ultra-books have large and handy keyboards, tablets have touchscreen and no keyboard presence whereas slate PC has the touchscreen operated through stylus or fingers.
  • Ultra-book have good storage space while tablets and slate PC's have less storage space in comparison.
4 0
3 years ago
Which type of basic building blocks (constructs) is the following algorithm?
Ksju [112]

Answer:

Sequence

Explanation:

6 0
3 years ago
Please help! ;(
Art [367]
Okay u have to use my teqnieq and search it up because i said so and it wil get u the right answer
8 0
3 years ago
Read 2 more answers
Other questions:
  • Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw(
    14·1 answer
  • A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the
    15·1 answer
  • What is a telecomunications system? 1) A system that enables the transmission of data over public or private networks. 2) A comm
    11·1 answer
  • How do I get rid of this?
    14·2 answers
  • Where do players resurrect if they have been destroyed in a game?
    13·1 answer
  • Complete the statement below using the correct term.<br>Website managers use<br>every day​
    11·2 answers
  • Choose the correct answer
    6·1 answer
  • Um ok that makes sooo much sence
    11·2 answers
  • Where can i make a 3d animation for free ( pls don't trick me)
    12·1 answer
  • in a block in a blockchain what represents the transactional data, sender, receiver, and number of coins? group of answer choice
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!