Hi ,
I am solving Manning Equation in C# ,but facing problem in implementing Differentiation to the below
f(y)=[ (nq/(c2*s0^(1/2)))3/5)*(c2/c1)]5/8 to f'(y).
i am doing this in console application.can anyone help me with this please.
EDIT: AL
Added code from comments:
sir sorry ,i am not troubling i think ,
this the whole code of my project
and this is the class file
Equation1.cs
public double Find_C1(int Z1,int Z2)
{
return (Z1 + Z2) / 2;
}
public double Find_C2(int Z1,int Z2)
{
return c1=Math.Pow(((1 + Math.Pow(Z1, 2))), 0.5) + Math.Pow(((1 + Math.Pow(Z2, 2))), 0.5);
}
public double Aofy(int y,int b,double c1)
{
return a=((b + c1) * y) * y;
}
public double PofY(int y, int b, double c2)
{
return p = b +(c2 * y);
}
public double RofY(int y, int b, int c2)
{
return a / p;
}
public double find_V(double s0, double n, double R)
{
double v= (Math.Pow(s0,0.5) / n) * Math.Pow(R,0.66);
return v;
}
public double find_q(double a,double v)
{
return a * v;
}
public double find_F(double n, double q, double c2, double s0, double c1)
{
double f;
return f= Math.Pow((Math.Pow(((n * q) / (c2 * (Math.Pow(s0, 0.5)))), 0.6)) * (c2 / c1), 0.625);
}
and in main i am calling it as
class Program
{
static void Main(string[] args)
{
Equation1 obj = new Equation1();
Console.WriteLine(string.Format("Enter S0"));
s0 = double.Parse(Console.ReadLine());
Console.WriteLine(string.Format("Enter Z2"));
Z2 = int.Parse(Console.ReadLine());
Console.WriteLine(string.Format("Enter Z1"));
Z1 = int.Parse(Console.ReadLine());
Console.WriteLine(string.Format("Enter Y"));
y = int.Parse(Console.ReadLine());
Console.WriteLine(string.Format("Enter b"));
b = int.Parse(Console.ReadLine());
Console.WriteLine(string.Format("C1:{0}",obj.Find_C1(Z1, Z2)));
Console.WriteLine(string.Format("C2:{0}", obj.Find_C2(Z1,Z2)));
Console.WriteLine(string.Format("A(y):{0}",(b+(obj.Find_C1(Z1, Z2)*y))*y));
Console.WriteLine(string.Format("P(y):{0}",(b+ (obj.Find_C2(Z1, Z2)*y))));
Console.WriteLine(string.Format("R(y):{0}", ((b + (obj.Find_C1(Z1, Z2) * y)) * y) / (b + (obj.Find_C2(Z1, Z2) * y))));
Console.WriteLine(string.Format("V:{0}", obj.find_V(s0,0.1,Math.Pow((((b+(obj.Find_C1(Z1, Z2)*y))*y)/(b+ (obj.Find_C2(Z1, Z2)*y))),2/3))));
Console.WriteLine(string.Format("Q:{0}",obj.find_q(obj.Aofy(y, b, obj.Find_C1(Z1, Z2)), obj.find_V(s0, 0.1, Math.Pow((((b + (obj.Find_C1(Z1, Z2) * y)) * y) / (b + (obj.Find_C2(Z1, Z2) * y))), 2 / 3)))));
Console.WriteLine(string.Format("F:{0}", obj.find_F(0.1, obj.find_q(obj.Aofy(y, b, obj.Find_C1(Z1, Z2)), obj.find_V(s0, 0.1, Math.Pow((((b + (obj.Find_C1(Z1, Z2) * y)) * y) / (b + (obj.Find_C2(Z1, Z2) * y))), 2 / 3))), obj.Find_C2(Z1, Z2), s0, obj.Find_C1(Z1, Z2))));
Console.ReadLine();
}
public static double s0 { get; set; }
public static int Z2 { get; set; }
public static int Z1 { get; set; }
public static int y { get; set; }
public static int b { get; set; }
}