Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: solve help
Posted:
Jun 24, 2013 10:59 AM


"ZACHARY HULL" <grasshopper5@hotmail.com> wrote in message news:kq4oc3$jg3$1@newscl01ah.mathworks.com... > Good day all, > > I am working a problem that requires me to use the 'solve' function of > matlab. > > The script below is what I solving for: > > t = linspace(0,pi,200); > ft = exp(sin(t)); > %plot(t,ft) > ft_max = max(ft); > t_max = max(t); > tf = asin(log(ft_max)); > display(['The extremum is located at (',num2str(tf),',',num2str(ft_max),') > and it is a maximum.']) > > ans = The extremum is located at (1.5629,2.7182) and it is a maximum. > > This is solving the problem without the use of the solve function. > ____________________________________________________________ > However, when I attempt to use 'solve' (required for the problem) the > equation ft below for variable t, this is my result: > > (script) > syms t > t = linspace(0,pi,200);
This assignment to t makes it numeric again. It is no longer symbolic after this line. That means:
> ft = exp(sin(t));
ft is also numeric, and this:
> tf = solve(ft,t)
attempts to solve for the solution of a vector of numbers with the independent variable also a vector of numbers.
But even if you removed the line where you assigned LINSPACE into t, it wouldn't work. Your equation has no real solution. For real finite z, exp(z) is always positive. Well, in double precision it can underflow. But you can't generate a value that would cause exp(z) to underflow when z is computed as sin(t) unless t is complex.
 Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com



