<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><span>Caros, boa tarde!</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Alguém poderia por gentileza auxiliar com a duvida relativa ao codigo abaixo?</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span># RCMR</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px;
 color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>y <- expression(exp(a+b/x))</span></div><div style="background-color: transparent;">D(y,'x') #primeira derivada</div><div style="background-color: transparent;">dy.dx <- expression(-(exp(a + b/x) * (b/x^2))) #resultado da primeira derivada<br></div><div style="background-color: transparent;">D(dy.dx, 'x') #segunda derivada</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;">fx <- function(a,b,x) exp(a + b/x) * (b * (2 * x)/(x^2)^2) + exp(a + b/x) * (b/x^2) * (b/x^2) #resultado da segunda derivada</span></div><div style="background-color: transparent;"><span style="background-color: transparent;">optim(c(1), fx, a=3.3,b=-1.2,method="BFGS")<br></span></div><div style="background-color: transparent; color:
 rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"># A ideia é encontrar o ponto de inflexao para o modelo representado pelo objeto y. Por definição o ponto de inflexao é o valor de x que faz a segunda derivada da </span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"># função igual a zero. Montei este rcmr porém não estou certo se a otimização de fx está igualando a zero, até porque os resultados não estão condizentes.</span></div><div
 style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"># Gostaria se possível também de alguma dica de algum livro que tenha dicas de cálculos matemáticos com o R pois gostaria de adaptar algumas rotinas do maple </span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"># para o R, até porque recentemente precisei isolar um termo de um modelo não linear que manualmente não é tão simples e gostaria de fazer estes calculos com o </span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color:
 transparent;"># R e nao </span><span style="background-color: transparent;">mais com o maple. Segue um exemplo simples de um calculo que gostaria de reproduzir com o R</span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="background-color: transparent;"><br></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;">y = b0 + b1x</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;">b0=?</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;">b0 = y - b1x # esta é a saída que gostaria de
 encontrar com o R. Ate cheguei a ver um pouco sobre o pacote Ryacas mas sem muito sucesso.</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><span style="font-size: 12pt;">Ja deixo aqui meus agradecimentos</span><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><br></div><div style="font-family: courier, monaco, monospace, sans-serif; font-size: 12pt;"><font size="3"><b>====================================</b></font></div><div style="font-family: courier, monaco, monospace, sans-serif; font-size: 12pt;"><font size="3"><b>Samuel P. C. Carvalho<br></b><font color="#000000" size="2">Engº Florestal [UFLA]</font></font></div><div
 style="font-family: courier, monaco, monospace, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><font size="3"><font color="#000000" size="2">Mestre em Ciências Florestais [UFLA]</font></font></div><div style="font-family: courier, monaco, monospace, sans-serif; font-size: 12pt;"><font color="#000000" size="2">Doutor em Recursos Florestais [ESALQ/USP]</font></div><div style="font-family: courier, monaco, monospace, sans-serif; font-size: 12pt;"><font size="2">=============================================</font></div></div></body></html>