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
Veronika [31]
3 years ago
9

Use the Bisection Method to find the root 2. Write a main program and a function program 3. Main Program a. define constants b.

define es c. define function handle for the function you are finding the root for. Note that the function handle you define will be a function of S and t, i.e. f(S,t) d. define Sl and Su e. t will go from 0 days to 40 days. Use 40 values for t f. use a for loop (inside main program) to loop through the values of t (one at a time) to generate a vector for S (one value at a time). Note that each value of t will give a different value for S g. use a convergence criteria corresponding to 6 significant figures h. generate plot of S vs t 4. Function Program an. algorithm for Bisection Method
Computers and Technology
1 answer:
MissTica3 years ago
5 0

Answer:

// C++ program for implementation of Bisection Method for  

// solving equations  

#include<bits/stdc++.h>  

using namespace std;  

#define EPSILON 0.01  

// An example function whose solution is determined using  

// Bisection Method. The function is x^3 - x^2 + 2  

double func(double x)  

{  

return x*x*x - x*x + 2;  

}  

// Prints root of func(x) with error of EPSILON  

void bisection(double a, double b)  

{  

if (func(a) * func(b) >= 0)  

{  

 cout << "You have not assumed right a and b\n";  

 return;  

}  

double c = a;  

while ((b-a) >= EPSILON)  

{  

 // Find middle point  

 c = (a+b)/2;  

 // Check if middle point is root  

 if (func(c) == 0.0)  

  break;  

 // Decide the side to repeat the steps  

 else if (func(c)*func(a) < 0)  

  b = c;  

 else

  a = c;  

}  

cout << "The value of root is : " << c;  

}  

// Driver program to test above function  

int main()  

{  

// Initial values assumed  

double a =-200, b = 300;  

bisection(a, b);  

return 0;  

}  

You might be interested in
What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
Nana76 [90]

Answer:

x = 29:73;

x_even = x(2:2:end);

Explanation:

In order to create a vector in Matlab you can use colon notation:

x = j:k

where <em>j</em> is 29 and <em>k</em> is 73 in your case:

x = 29:73

Then you can extract the even numbers by extracting the numbers with even index (2,4,6,etc.) of your vector:

x_even = x(2:2:end);

In the line of code above, we define <em>x_even</em> as all the elements of x with even index from index 2 till the end index of your vector, and an increment of 2 in the index: 2,4,6,etc.

If you want the odd numbers, just use the odd indices of your vector:

x_odd = x(1:2:end);

where <em>x_odd</em> contains all the elements of <em>x</em> with odd index from index 1 till the end index, and an increment of 2: 1,3,5,etc.

6 0
3 years ago
Mi amiga es una chica y es soltera y quiere novia, a cualquiera le interesa?
Kazeer [188]

Answer:

me does she speak engilsh

Explanation:

3 0
3 years ago
Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3 and then m2 calls m4, m3 calls m5.
Minchanka [31]

Answer:

M2 is the answer for the above question.

Explanation:

  • The above question states the scenario, where firstly main function calls the M1 function.
  • Then M1 function calls the function M2.
  • Then M2 function calls the function M3.
  • Then M3 function calls the function M5.
  • Then Again M2 function will resume and calls the function M4.
  • Then Again M2 function will resume because when the M4 will ends it return to the statement of the M2 function from which the M4 function has been called.
  • It is because when any function ends its execution it returns to that line of a statement from which it has been called. This is the property of programming language to call the function.
  • So when the M4 will terminate its execution then the M2 function will resume again.
4 0
3 years ago
________type of website is an interactive website kept constantly updated and relevant to the needs of its customers using a dat
Llana [10]

Answer:

Data-driven Website

Explanation:

A Data-driven website is a type of website that is continually updated by its administrators so as to meet users' needs. It is opposed to a static website whose information remains the same and is never changed once uploaded.

The data-driven website is used in a platform where information has to be continually updated. An example is an online platform where people place orders for goods and services. There are usually changing prices and new goods continually uploaded. So, to keep the consumers updated, the administrators of such platforms would use a data-driven platform.

8 0
3 years ago
To begin designing a relational database, one must define the _____ by defining each table and the fields in it. primary key phy
Ugo [173]

Answer:

To begin designing a relational database, one must define the Logical structure

Explanation:

Primary key: It is a unique key which uniquely identifies each record in a table. So this does not purely defines the relationship of the table during the beginning of the design.

Foreign key: It is a key which is closely connected to the primary key. The value of the column will accept values only if the values exists in the base table.

Physical structure: This is not going to be related to the relationship of the structure since the storage management is done by Operating system.

Only the logical structure clearly defines the relationship in the database. It will have information about the list of tables and fields. It will also mark the relationship between one table and another.

8 0
4 years ago
Other questions:
  • How many results are shown by default when using a Top or Rare Command?
    13·1 answer
  • Let's assume that the smallest possible message is 64 bytes (including the 33-byte overhead). if we use 100base-t, how long (in
    10·1 answer
  • A navigation device that transfers packets of data between two or more networks is called a _______
    12·1 answer
  • A resistor is marked with the following color bands: brown, black, red, and silver. What is the resistance of this resistor? A.
    14·2 answers
  • The manufacturer doesn't need it the buyer doesn't want it the user doesn't know they're using it
    6·1 answer
  • Unlike oracle, access does not support the decimal data type.​<br><br> a. true<br><br> b. false
    9·1 answer
  • A constructor can be overloaded with more than one function which has the same name but with what two different things
    7·1 answer
  • 6.7 — Trickier Trap 4
    7·2 answers
  • What type of storage drive contains multiple spinning platters?
    9·1 answer
  • Which of the following criteria was a key milestone for the object-relational model created in the mid-1980s?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!