![]() ![]() Max_y = feval(symengine,'numeric::solve',fifth_derivative,'x=-pi.pi','AllRealRoots') Here's an example of how you might use the latter for your system: syms xįifth_derivative = diff(fourth_derivative) In particular, the numeric::realroots ( documentation) and numeric::solve ( documentation)functions are of interest. What can you do? In Matlab you can take advantage of some of the feature of MuPAD that have not yet been fully-integrated into the Symbolic Math toolbox. If it had not found any solution it would have attempted to find a root numerically (similar to calling vpasolve directly). In your case, it appears that it found one root at zero, but it did not find any other so it stopped. The first thing it tries is to find an exact symbolic solution. I recommend reading the documentation for solve. It tries many things in order to return solutions, but it does not guarantee that it will return all solutions (indeed, your system, being periodic, has an infinite number). Matlab's solve function is a general method. As many of these roots can't be found analytically for your system, they must be found numerically. Reliably finding multiple roots is challenging. Title('Max and Min of fourth derivative') Plot(crit_pts, subs(fifth_derivative,crit_pts), 'ro') ![]() % Plotting to show that my code can't find the max % This is the correct value of the maximum of yĬorrect_max_y = eval(subs(fourth_derivative,pi)) Max_y = eval(subs(fourth_derivative,crit_pts)) % This is the y value that my code thinks is the maximum Logically, what my program does is that it looks at the function $f(x)$, finds the fourth derivative, finds the critical points looking at the fifth derivative, and then substitutes those values into the fourth derivative to find the maximum $y$-value.įor i = 1:4 % Computes fourth derivative of fx I am still relatively new to MATLAB, so it might be the way I go about trying to find multiple critical points. I am having problems trying to to write code in MATLAB to solve the problem. I know that the answer should be 6100 and occurs at $x_0=-\pi$ and $x_1=\pi$. I am trying to find the maximum $y$-value of the fourth derivative of the function $f(x) = \frac$. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |