Skip to main content
added 18 characters in body
Source Link
Goofy
  • 3.7k
  • 11
  • 17

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: := 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: := 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: := Sqrt[sinsquare[x,y]];    

At some point, i.e. x-> 1.1, y-> -0.000000001 x-> 1.1, y-> -0.000000001 , CosEta[x,y]CosEta[x,y] becomes -4.44089 * 10^-16 -4.44089 * 10^-16, and as a consequence, SinEta SinEta returns complex number as 0. + 2.10734 * 10^-8 I 0. + 2.10734 * 10^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEtaSinEta and CosEtaCosEta for which I can not use Re[]Re[] in defining the SinEtaSinEta since Re'Re' and Re''Re'' shows up in the final outcome.

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: = 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: = 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: = Sqrt[sinsquare[x,y]];    

At some point, i.e. x-> 1.1, y-> -0.000000001 , CosEta[x,y] becomes -4.44089 * 10^-16 , and as a consequence, SinEta returns complex number as 0. + 2.10734 * 10^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_] := 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_] := 1 - (CosEta[x,y])^2;    

SinEta[x_,y_] := Sqrt[sinsquare[x,y]];    

At some point, i.e. x-> 1.1, y-> -0.000000001 , CosEta[x,y] becomes -4.44089 * 10^-16, and as a consequence, SinEta returns complex number as 0. + 2.10734 * 10^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.

Became Hot Network Question
added 6 characters in body
Source Link
PKD
  • 31
  • 5

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: = 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: = 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: = Sqrt[sinsquare[x,y]];    

At some point, i.e. x->1> 1.1, y->  -0.000000001 , CosEta[x,y] becomes -4.4408910^-16 , and as a consequence, SinEta returns complex number as 0. + 2.1073410^ * 10^-16 , and as a consequence, SinEta returns complex number as 0. + 2.10734 * 10^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: = 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: = 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: = Sqrt[sinsquare[x,y]];    

At some point, i.e. x->1.1, y->-0.000000001 , CosEta[x,y] becomes -4.4408910^-16 , and as a consequence, SinEta returns complex number as 0. + 2.1073410^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: = 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: = 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: = Sqrt[sinsquare[x,y]];    

At some point, i.e. x-> 1.1, y->  -0.000000001 , CosEta[x,y] becomes -4.44089 * 10^-16 , and as a consequence, SinEta returns complex number as 0. + 2.10734 * 10^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.

Source Link
PKD
  • 31
  • 5

Sqrt returns complex values

I am trying to find sine from a cosine relation using the following commands:

CosEta[x_,y_]: = 1/2 Cosh[Log[3]/2] (-Sqrt[y^2 + (x - Sech[Log[3]/2])^2] + Sqrt[y^2 + (x + Sech[Log[3]/2])^2]);    

sinsquare[x_,y_]: = 1 - (CosEta[x,y])^2;    

SinEta[x_,y_]: = Sqrt[sinsquare[x,y]];    

At some point, i.e. x->1.1, y->-0.000000001 , CosEta[x,y] becomes -4.4408910^-16 , and as a consequence, SinEta returns complex number as 0. + 2.1073410^-8 I . What can be done to get rid of this complex number return?

I have to implement this commands in my full code which includes multiple 1st and 2nd derivatives of SinEta and CosEta for which I can not use Re[] in defining the SinEta since Re' and Re'' shows up in the final outcome.