Skip to content

Commit

Permalink
Phi no R
Browse files Browse the repository at this point in the history
A primeira parte do calculo do phi no R está pronta, agora falta expandir a expressão para todos os betas.
  • Loading branch information
grisotto committed May 3, 2015
1 parent 6e0147d commit 7c78066
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 166 deletions.
51 changes: 51 additions & 0 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
source('~/dados/Comp/Projeto_optics/novafiber/janeiro2015/fiber_r/figura_teste.R')
install.packages("akima")
install.packages("ggplot2")
source('~/dados/Comp/Projeto_optics/novafiber/janeiro2015/fiber_r/figura_teste.R')
install.packages("pracma")
install.packages("Bolstad2")
source('~/dados/Comp/Projeto_optics/novafiber/janeiro2015/fiber_r/figura_teste.R')
setwd("~/dados/Comp/Projeto_optics/novafiber/janeiro2015/fiber_r")
setwd("/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura")
a[0,5,10,15,20,24]
a <- c(0,5,10,15,20,24)
a
length(a)
betas <- read.csv("temp_dados.csv", header = F, numerals = c("allow.loss", "warn.loss", "no.loss"))
betas(1,1)
betas[1,1]
betas <- read.csv("temp_dados.csv", header = T, numerals = c("allow.loss", "warn.loss", "no.loss"))
betas <- read.csv("temp_dados.csv", header = F, numerals = c("allow.loss", "warn.loss", "no.loss"))
betas
betas (1,3)
betas[1,3]
betas[1,13]
betas[6,13]
temp <- 1
betas [temp,5]
r0 <- 4e-2;
r0
a <- betas[,9]
a
a[1]
a[2]
phi_total <- matrix(0,3);
phi_total
phi_total <- vector(0,N3);
phi_total <- vector(0,3);
vector
vector(3)
a <- vector(3)
a
aa <- rep(0,3)
aa
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
betas <- read.csv("temp_dados.csv", header = F, numerals = c("allow.loss", "warn.loss", "no.loss"))
betas
beta1 <- betas[,14];
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
source('/mnt/dados/Comp/Projeto_optics/novafiber/abril2015/temperatura/phi_total.R')
phi_total
4 changes: 0 additions & 4 deletions expressao.m

This file was deleted.

45 changes: 45 additions & 0 deletions phi_total.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#retirei a primeira linha, pois a leitura estava incorreta com o cabecario.
# estrutura dos temp_dados:
#header t (C) n(nucleo) n(casca) neff2 neff3 neff4 neff5 neff6 BETA2 BETA3 BETA4 BETA5 BETA6
#1 0
#2 5
#3 10
#4 15
#5 20
#6 24
betas <- read.csv("temp_dados.csv", header = F, numerals = c("allow.loss", "warn.loss", "no.loss"))

#no nosso modelo o fundamental da GRIN é o beta6. Para não criar confusao irei trocar, beta2 agora é o fundamental.


beta2 <- betas[,13];
beta3 <- betas[,10];
beta4 <- betas[,11];
beta5 <- betas[,12];
beta6 <- betas[,9];


#constantes
r0 <- 4e-2;
L <- 0.82
alpha <- 5e-5;
t0 <- 24;


temp <- c(0,5,10,15,20,24);
N3 <- length(temp);

#criando um vetor de 0's
phi_total <- rep(0,N3);
r <- rep(0,N3);

for (i in 1:N3){
#Mostro qual temperatura esta sendo calculada.
print(temp[i])

r[i] = r0 + alpha * r0 * (temp[i] - t0);

phi_total[i] = (beta2[6] - beta3[6]) * (L - r0) + (beta2[i] - beta3[i] ) * r[i];

}

22 changes: 0 additions & 22 deletions simp2D.m

This file was deleted.

120 changes: 0 additions & 120 deletions simps.m

This file was deleted.

19 changes: 0 additions & 19 deletions simpson.m

This file was deleted.

7 changes: 7 additions & 0 deletions temp_dados (copy).csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
t (C) n(nucleo) n(casca) neff2 neff3 neff4 neff5 neff6 BETA2 BETA3 BETA4 BETA5 BETA6
0 , 1.4736 , 1.4499 , 1.4725 , 1.4727 , 1.4728 , 1.473 , 1.4731 , 6380787.8505 , 6381476.7305 , 6382178.8922 , 6383022.3261 , 6383359.6711
5 , 1.4737 , 1.4499 , 1.4727 , 1.4729 , 1.4731 , 1.4732 , 1.4734 , 6381758.5021 , 6382460.0468 , 6383303.1659 , 6383640.361 , 6384603.0764
10 , 1.4737 , 1.45 , 1.4728 , 1.473 , 1.473 , 1.4732 , 1.4732 , 6382040.0117 , 6382741.2834 , 6382741.3219 , 6383583.9427 , 6383920.9496
15 , 1.4738 , 1.45 , 1.4729 , 1.473 , 1.4732 , 1.4733 , 1.4735 , 6382321.7917 , 6383022.5237 , 6383864.7899 , 6384201.6022 , 6385163.349
20 , 1.4739 , 1.4501 , 1.4729 , 1.4731 , 1.4733 , 1.4734 , 1.4736 , 6382603.1095 , 6383303.6622 , 6384145.5497 , 6384482.2268 , 6385443.3855
24 , 1.4739 , 1.4501 , 1.473 , 1.4732 , 1.4734 , 1.4734 , 1.4737 , 6382828.3259 , 6383528.645 , 6384370.14 , 6384706.6823 , 6385667.4628
1 change: 0 additions & 1 deletion temp_dados.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
t (C) n(nucleo) n(casca) neff2 neff3 neff4 neff5 neff6 BETA2 BETA3 BETA4 BETA5 BETA6
0 , 1.4736 , 1.4499 , 1.4725 , 1.4727 , 1.4728 , 1.473 , 1.4731 , 6380787.8505 , 6381476.7305 , 6382178.8922 , 6383022.3261 , 6383359.6711
5 , 1.4737 , 1.4499 , 1.4727 , 1.4729 , 1.4731 , 1.4732 , 1.4734 , 6381758.5021 , 6382460.0468 , 6383303.1659 , 6383640.361 , 6384603.0764
10 , 1.4737 , 1.45 , 1.4728 , 1.473 , 1.473 , 1.4732 , 1.4732 , 6382040.0117 , 6382741.2834 , 6382741.3219 , 6383583.9427 , 6383920.9496
Expand Down

0 comments on commit 7c78066

Please sign in to comment.