<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div id="yiv1134223406"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; "><div id="yiv1134223406"><div><div style="background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; " class="yiv1134223406yui_3_2_0_15_133435206322650"><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-size: 12pt; font-family: times, serif; " class="yiv1134223406yui_3_2_0_15_133435206322652"><span>Olá a todos,</span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-size: 12pt; font-family: times, serif; " class="yiv1134223406yui_3_2_0_15_133435206322654">Estou com o seguinte problema, quero calcular a integral de 0 até HT( valor da altura total dde cada arvore presente na base de
dados em anexo).</div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520060"><br></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520060">Rotininha:</div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520060"><br></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520060"><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif;
font-size: 12px; ">rm(list=ls(all=T))</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">setwd("C:/Documents and Settings/Daniela/Desktop/Ajustes no R")</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">mdados<-read.table("INTEGRAL.txt", h=T, dec=",");mdados</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span
style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "># funçao de afilamento</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">fx<-function(hi) 0.91-(1.28*(hi/HT)^1)+(2.98*(hi/HT)^2)-(4.50*(hi/HT)^3)+(2.58*(hi/HT)^4)-(0.69*(hi/HT)^5)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">for (i in 1:nrow(mdados))##numero total de arvores do arquivo</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica,
sans-serif; font-size: 12px; ">{</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> integral<-integrate(fx,lower=0,upper=mdados$HT)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> volume<-with(mdados, ((pi*(mdados$DAP^2))/40000)*integral)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> mdados<-data.frame(mdados, volume)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69,
69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> }</span> <br></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520060"><br></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-size: 12pt; font-family: times, serif; " class="yiv1134223406yui_3_2_0_15_133435206322654">Mas não está dando certo.</div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: times, serif; font-size: 12pt; " class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520062"><br></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654" style="font-family: times, serif; "><span style="font-family: 'times new roman', 'new york', times, serif; "><span
style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; ">A equação (polinomio do 5 grau) gerada é: 0.91-(1.28*(hi/HT)^1)+(2.98*(hi/HT)^2)-(4.50*(hi/HT)^3)+(2.58*(hi/HT)^4)-(0.69*(hi/HT)^5)</span><br style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; "><br style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; "><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; ">Objetivo, calcular somente a integral para cada árvore (ex: 33 observações), para nao precisar faze-lo manualmente ao introduzir árvore a árvore (HT). </span><br style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; "><br style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; "><span style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; ">O arquivo está no excel, a integral é de 0 até HT. O DAP servirá somente para o calculo do Volume.</span></span><br
id="yiv1134223406yui_3_2_0_15_133435206322669"></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086"><br></span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086">Alguém pode me ajudar?</span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086">Meu computador é
Windows.</span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086"><br></span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086">Agradeço a todos, desde já!</span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086"><br></span></span></div><div
id="yiv1134223406yui_3_2_0_18_133435187682840" class="yiv1134223406yui_3_2_0_15_133435206322654 yui_3_2_0_18_133435216520064"><span style="font-family: 'times new roman', 'new york', times, serif; "><span style="font-size: 12px; " class="yui_3_2_0_18_133435216520086">Daniela</span></span></div><div id="yiv1134223406yui_3_2_0_18_133435187682840" style="color: rgb(0, 0, 0); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><font face="'times new roman', 'new york', times, serif"><br id="yiv1134223406yui_3_2_0_18_133435187682858"></font></div></div></div></div></div></div></div></div></body></html>