Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.
|
|
Patrick
Posts:
4
Registered:
2/12/12
|
|
Re: Simple non-linear equation solving question
Posted:
Feb 13, 2012 12:32 AM
|
|
Thanks for the response. My Matlab version is 7.10.0 (R2010a).
The full code:
clear all clc close all
x=[-.5:.01:1];
m=-x.^3 + (sin(x)).^2;
plot(x,m)
clear x x = sym('x'); solve(-x.^3 + (sin(x)).^2)
Which provides a plot, and:
ans = matrix([[0]])
From the plot, I can see that there is also a solution at about 0.803.
Thanks again...
"Nasser M. Abbasi" <nma@12000.org> wrote in message <jha64h$kls$1@speranza.aioe.org>... > On 2/12/2012 10:42 PM, Patrick wrote: > > Hi, > > > > I'm trying to solve the following non-linear equation: 0=-x^3 + (sin(x))^2 > > > > EDU>> solve(-x^3+sin(x)^2) > > > > ans = > > > > matrix([[0]]) > > > > By graphing this equation, it appears that there are solutions at 0 and 0.803. What am I doing wrong? > > > > Thanks... > > Which verssion do you have? > > on mine: > > MATLAB Version 7.12.0.635 (R2011a) > > I get > > -------------------- > EDU>> syms x > solve(-x^3+sin(x)^2) > > ans = > > 0 > ---------------------- > > matrix([[0]]) means zero solution also? i..e a vector, which one > entry, and that entry is zero. so same answer I have. > > So, I do not know how you got 0.803 there. What command you used > to plot? Please show complete code you did, not one line. > > --Nasser
|
|
|
|