Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Write MATLAB code that calculate the three roots of a cubic equation of state using MATLAB's roots function. After determining the three roots, your

image text in transcribed

3. Write MATLAB code that calculate the three roots of a cubic equation of state using MATLAB's roots function. After determining the three roots, your code should display the number of distinct values of the roots: ("Three identical roots," "Two identical roots," or "Three distinct roots"). Your code should then state if the roots are real or complex ("All roots are real" or "Two roots are complex"). Hints: MATLAB is solving for the roots numerically, not symbolically, so the result is a (very precise) numerical approximation. Determining if roots are identical using rl--r2 may not work. To determine if floating point values of the roots are equal, define a tolerance (tol-0.0001, for example) and determine if abs(r1-r2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions