Finding the Maximum/Minimum value of a function
Mostrar comentarios más antiguos
This seems to be quite a simple thing to do, but for some ungodly reason i am having unimaginable trouble doing so, on my Casio calculator its simple as Pie, you put in the function and say find maximum between this point and this point, however I cant for the life of me figure out how to do it on this, and i tried a whole bunch of things that kept giving me errors, i was hoping if someone could help me with this it will be amazing.
What i would like to know is.... How to find the maximum of a function, I am not posting the whole code, just the thing that i am having trouble with..... and this is it....
x(t)=0.03106*exp(-21.43*t)*sin(32.2*t)
v(t)=diff(x(t));
a(t)=diff(v(t));
jerk(t)=diff(a(t));
G=solve(jerk(t)==0,t>0)
G=vpa(G,8)
ezplot (a(t),[0,0.5]) ; title a(t)
Now this is where the problem begins... to solve for maximum acceleration I am differentiating acceleration and then making that equal to ZERO, which should give me the time at which acceleration is ZERO However It is outputting a value for G which is not coherent with the ezplot, why? and how do I fix this?
Any help would be very greatfully appreciated and thanks in advance!!!
Just a little bit more info, It seems that whatever is "outisde" the ezplot the equation COMPLETELY diregards, it is wierd but i am telling the truth, at one point i wanted to find the maximum of x(t), which say it was at t=0.5 but it showed me the maximum to be t=0.46 JUST because the top of the graph was cut and 0.46 was the "maximum" of the graph that ezplot saw what is going on???? if someone can please confirm I am not insane that would be great.
2 comentarios
Walter Roberson
el 23 de Ag. de 2015
Is it correct that before this you have defined
syms x(t) v(t) a(t) jerk(t)
Eli Kroitor
el 25 de Ag. de 2015
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!