Escolar Documentos
Profissional Documentos
Cultura Documentos
Me Todos
Me Todos
APP DE EXPONENCIAL
namespace AppEx
{
class CExponencial
{
#region ********** FACTORIAL DEL NUMERO ***************
static double Facto(double N)
{
int factorial = 1;
if (N == 0)
{
return 1;
}
else
{
for (int i = 1; i <= N; i++)
{
factorial = factorial * i;
}
return factorial;
}
}
#endregion FACTORIAL DEL NUMERO
#region ********* POTENCIA ************
static double POTENCIA(double N, int Exp)
{
return Math.Pow(N, Exp);
}
#endregion
#region ******** ATRIBUTOS **********
//*************** ATRIBUTOS *******************
private double aX;
private double aYr;
private double aN;
//************* constructures
public CExponencial()
{
aX = 0;
aYr = 0;
aN = 0;
}
public CExponencial(double pX, double pYr, double pN)
{
aX = pX;
aYr = pYr;
aN = pN;
}
public double X
{
get { return aX; }
set { aX = value; }
}
public double Yr
{
get { return aYr; }
set { aYr = value; }
}
public double N
{
get { return aN; }
set { aN = value; }
}
#endregion
List<double> ListaEai = new List<double>();
List<double> ListaValorAprox = new List<double>();
double Tolerancia,Ea;
//calculo de la tolerancia
Tolerancia = 0.5 * (Math.Pow(10, 2 - N));
Console.WriteLine(Tolerancia);
double Exponencial = 0;
for (int j = 0; j <= 40;j++ )
{
Exponencial = POTENCIA(X, j) / Facto(j) + Exponencial;
ListaValorAprox.Add(Exponencial);
}
ListaEai.Add(100);
for (int i= 0; ListaEai[i] >= Tolerancia;i++ )
{
namespace AppEx
{
class Program
{
static void Main(string[] args)
{
CExponencial J = new CExponencial();
J.LeeDatos();
J.Calcular();
J.Mostrar();
Console.ReadLine();
}
}
}
Nombre : Jaime Amilcar Catari Sinsaya Codigo: 10262
App calcular sin(x) mediante la serie de MCclaurin
namespace SERIE_MCLAURIN
{
class cMclaurin
{
#region ********** FACTORIAL DEL NUMERO ***************
static double Facto(double N)
{
int factorial = 1;
if (N == 0)
{
return 1;
}
else
{
for (int i = 1; i <= N; i++)
{
factorial = factorial * i;
}
return factorial;
}
}
#endregion FACTORIAL DEL NUMERO
#region ********* POTENCIA ************
static double POTENCIA(double N, int Exp)
{
return Math.Pow(N,Exp);
}
#endregion
#region *********** ATRIBUTOS ****************
private double aX;
private double ayr;
private double an;
//************* constructures
public cMclaurin()
{
aX = 0;
ayr = 0;
an = 0;
}
public cMclaurin(double pX, double pyr, double pn)
{
aX = pX;
ayr = pyr;
an = pn;
}
public double X
{
get { return aX; }
set { aX = value; }
}
public double yr
{
get { return ayr; }
set { ayr = value; }
}
public double n
{
get { return an; }
set { an = value; }
}
#endregion
List<double> ValorEstimado = new List<double>();
List<double> ErrorRelativoPorcentual_Ry = new List<double>();
List<double> ErrorAnalitico = new List<double>();
List<double> ValorEstimadoYai = new List<double>();
}
}
Console.WriteLine();
namespace SERIE_MCLAURIN
{
class Program
{
#region ********** FACTORIAL DEL NUMERO ***************
static int Facto(int N)
{
int factorial=1;
if (N == 0)
{
return 1;
}
else
{
for (int i = 1; i <= N; i++)
{
factorial = factorial * i;
}
return factorial;
}
}
static void Main(string[] args)
{
//****************************
cMclaurin C = new cMclaurin();
C.LeerDatos();
C.Calculo();
C.ErrorAnaliticoEai();
C.Mostrar();
//****************** crear las listas ****************************
List<float> Iteracion = new List<float>();
List <float> ErrorRelativoPorcenttual = new List<float>();
List<float> Tolerancia = new List<float>();
// Console.WriteLine(Facto(5));
Console.ReadLine();
}
}
}