Question: Chrome File Edit View History Bookmarks Profiles Tab Window Help Co Q 8 Sun Feb 4 9:48PM ... TESTUDO | Office of the x Dashboard

 Chrome File Edit View History Bookmarks Profiles Tab Window Help CoQ 8 Sun Feb 4 9:48PM ... TESTUDO | Office of thex Dashboard X A MATLAB Grader X ChatGPT x Bard - ChatBased Al To x New Tab X + C go grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variable.. MPaused . . . MATLAB Grader Modou Sarr CONTENTS Close Courses &

Chrome File Edit View History Bookmarks Profiles Tab Window Help Co Q 8 Sun Feb 4 9:48PM ... TESTUDO | Office of the x Dashboard X A MATLAB Grader X ChatGPT x Bard - Chat Based Al To x New Tab X + C go grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variable.. M Paused . . . MATLAB Grader Modou Sarr CONTENTS Close Courses & Content LMS Integration Documentation & Support Assignment 1 x A2.4 Script: Finding Approximate Solutions for Equations in One Variable 19 solutions submitted (max: Unlimited) | View my solutions V Assignment 2 A2.1 Script: Symbolically Solving Introduction Equations for One Variable We've seen that the solve command can solve for a variable symbolically, meaning Matlab is doing symbolic manipulation behind the scenes and finding the exact answer. However many equations cannot be solved symbolically for an exact answer. Consider the following situation - the line y = x crosses the curve y = cos x which can be seen by A2.2 Script: Solving Systems of graphing: Equations A2.3 Script: Plotting Expressions 5 A x A2.4 Script: Finding Approximate Solutions for Equations in One W Variable 2 Assignment 3 > Assignment 4 O > Assignment 5 -2 > Assignment 6 -3 > Assignment 7 -4 Assignment 8 0 5 Q3 0 0 4 200m tv G 9 R max 4 G CFG P- AaChrome File Edit View History Bookmarks Profiles SITLN L) A j TESTUDO | Officeof th x @ Dashboard X 4\\ MATLAB Grader X | ] ChatGPT x 4, Bard-ChatBased Al X & NewTab y | > O 25 grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variabl... ) @ 0O @Paused : MATLAB Grader [V[Te CIVISE- T4 CONTENTS Close Courses & Content ~ LMS Integration = Documentation & Support ~ Thus the equation x = cos x has this x-value (looks like slightly less than 1?) as a solution but this solution can't be found by manipulation - you can't manipulate the equation x = cosx to get x by itself - and in fact finding an exact solution might be impossible - yes, things can look simple and be basically impossible! Finding an Approximate Solution Matlab can however give an approximate solution fairly easily. The simplest command that Matlab has for finding an approximate solution is the vpasolve command, which stands for variable precision arithmetic solve. To find an approximate solution to the equation x = cos x we simply type: syms x vpasolve(x == cos(x)) and the result is: ans = 0.73908513321516064165531208767387 Note that this is not an exact solution, it is approximate, though it is certainly very accurate. Interestingly if you had just tried solve by itself (what's to lose?) we see what Matlab does... solve(x == cos(x)) This will give us: Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve. > In sym/solve (line 304) ans = 0.73908513321516064165531208767387 This tells us that Matlab tried to use solve but had an issue in line 304 (somewhere in its own code, on some line that we don't know about!) and it gave up and did vpasolve anyway. Dealing with Multiple Approximate Solutions This is great for the above example but consider the function y = x 10 cos x whose graph is shown below. The x-intercepts for this graph correspond to solutions to the equation x 10cos x = 0, these are the places where the blue graph of y = x 10 cos x below crosses the red x-axis: . Chrome File Edit View History Bookmarks Profiles Tab Window Help Co Q 8 Sun Feb 4 9:48PM ... TESTUDO | Office of the x Dashboard X A MATLAB Grader X ChatGPT x Bard - Chat Based Al To x New Tab X + C go grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variable.. 1 M Paused . . . MATLAB Grader Modou Sarr CONTENTS Close Courses & Content LMS Integration Documentation & Support Dealing with Multiple Approximate Solutions This is great for the above example but consider the function y = x - 10 cos x whose graph is shown below. The x-intercepts for this graph correspond to solutions to the equation x - 10 cos x = 0, these are the places where the blue graph of y = x - 10 cos x below crosses the red x-axis: 25 20 15 10 O -5 -10 -15 -20 -25 -20 -15 -10 -5 0 5 10 15 20 The picture makes it clear that there are seven x-intercepts and so the equation x - 10 cos x = 0 has seven solutions. So what happens if we use vpasolve? Let's see: 4 zoom "tv G R max 4 G CFG AaChrome File Edit View History Bookmarks Profiles i 0 SN A o+ TESTUDO | Office of th X @ Dashboard X | 4\\ MATLAB Grader X | ) ChatGPT X 4. Bard-ChatBased AT X & NewTab y O 25 grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variabl... ) @ 0O @Paused : MATLAB Grader [V[Te CIVISE- T4 CONTENTS Close Courses & Content ~ LMS Integration = Documentation & Support ~ The picture makes it clear that there are seven x-intercepts and so the equation x 10 cos x = 0 has seven solutions. So what happens if we use vpasolve? Let's see: vpasolve(x-10xcos(x) == @) This gives us: ans = 5.2671164340763294016087337493567 This returned one particular approximate solution - looks like the rightmost one when we cross-reference the picture. Why did Matlab find this one? The answer is that it uses some fairly technical methods to find approximate solutions and it returns the first one it finds using these methods. If we would like Matlab to find another approximate solution we need to tell it approximately where to start looking. For example the leftmost solution is near x = 10 so we'll tell Matlab to look near there: % Let's look near x = -10. This doesn't have to be an integer! vpasolve(x-10%cos(x) == 0,-10) This gives us: ans = -9.6788840184882553406230293735339 Of course we had to know to start with that there was a solution right around there and this is typically done by qualitative methods like graphing. Finding All Approximate Solutions Matlab cannot easily find all approximate solutions to an equation like this since there is no easy way for it to find out how many solutions there should be and where to start looking for each. There are more technical ways to go about this but we won't cover them here. Assignment Write a script which does all of the following in order: 1. Find the approximate solution (there is only one) to the equation e* = 2 cos(x 1) and assigns this to al. 2. Find the approximate smallest solution to the equation x + sin(x) + 3 cos(2x) = 0 and assigns this to a2. You'll need to graph it (however you wish) and value which is close to the desired solution. 3. Find all three approximate solutions to the equation 0.15x + 2"* = 0 assigns them in increasing order to x1, x2, and x3. You'll need to graph it (howev Chrome File Edit View History Bookma Profiles T: Window Help CHEO N K_: grader.mathworks.com/courses/131341-math-206-spring-24/problems/1364201-a2-4-script-finding-approximate-solutions-for-equations-in-one-variabl... {() @ 0O @Paused : MATLAB Grader [V[Te CIVISE- T4 CONTENTS Close Courses & Content = LMS Integration = Documentation & Support ~ This returned one particular approximate solution - looks like the rightmost one when we cross-reference the picture. Why did Matlab find this one? The answer is that it uses some fairly technical methods to find approximate solutions and it returns the first one it finds using these methods. If we would like Matlab to find another approximate solution we need to tell it approximately where to start looking. For example the leftmost solution is near x = 10 so we'll tell Matlab to look near there: % Let's look near x = -10. This doesn't have to be an integer! vpasolve(x-10*cos(x) == 0,-10) This gives us: ans = -9.6788840184882553406230293735339 Of course we had to know to start with that there was a solution right around there and this is typically done by qualitative methods like graphing. Finding All Approximate Solutions Matlab cannot easily find all approximate solutions to an equation like this since there is no easy way for it to find out how many solutions there should be and where to start looking for each. There are more technical ways to go about this but we won't cover them here. Assignment Write a script which does all of the following in order: 1. Find the approximate solution (there is only one) to the equation * = 2 cos(x 1) and assigns this to al. 2. Find the approximate smallest solution to the equation x + sin(x) + 3 cos(2x) = 0 and assigns this to a2. You'll need to graph it (however you wish) and use a starting value which is close to the desired solution. 3. Find all three approximate solutions to the equation 0.15x + 2"* = 0 assigns them in increasing order to x1, x2, and x3. You'll need to graph it (however you wish) and experiment with different starting values until you're sure you've got all five. Assume x is in radians. Scri pt e B save ' Reset EE MATLAB Documentation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!