Message Boards Message Boards

0
|
2889 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Cannot get the absolute value of a complex number

Posted 2 years ago

I am trying to evaluate an expression using "Abs" but for some reason it does not simplify beyond a point. Am I doing something wrong in here? My command is:

Refine[Abs[k1*I + 1], Element[k1, PositiveReals]]

The output I am getting:

Abs[1 + I k1]

I expected:

Sqrt[1+k1^2]
POSTED BY: Aakash Gupta
2 Replies

You can also just use ComplexExpand because it assumes all variables are real unless specified as complex:

ComplexExpand[Abs[k1*I + 1]]

Mariusz's post is better if there are further simplifications from the fact that k is Positive (which in your particular example does not matter).

Regards.

POSTED BY: Neil Singer

Try:

 Simplify[Abs[k*I + 1] // ComplexExpand, Assumptions -> Element[k, PositiveReals]]
 (* Sqrt[1 + k^2] *)
POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract