Is there a way to get ride of complex numbers?

Is there a way to get ride of complex numbers? - Сообщения

#1 Опубликовано: 26.05.2021 01:18:59
Jim

Jim

0 сообщений из 7 понравились пользователям.

Группа: User

hi Folks, I am programming some equations and there is a requirement for a summation of terms, each term being a square root of a function of several variables. The method requires ignoring any negative results, i.e. where the square root of a negative number will lead to a complex number.

The terms are all have identical variables and it would be ideal if I can perform some operation on the general case term, so that the imaginary results just vanish.
#2 Опубликовано: 26.05.2021 02:31:38
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi. You can try to redefine i:=0 and see if get the desired behavior.

Best regards.
Alvaro.
#3 Опубликовано: 26.05.2021 02:57:00
gntech

gntech

5 сообщений из 19 понравились пользователям.

Группа: User

There is a function called Re that returns the real part of a complex number. See example below

SMathStudio_Desktop_bIHdwWefi7.png

For reference: The counterpart is the function Im, see below.

SMathStudio_Desktop_oWJ3TA62PH.png
#4 Опубликовано: 26.05.2021 10:11:26
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Your description is too general w/o the formula.



Circle Complexn-circles.sm (10 КиБ) скачан 37 раз(а).

#5 Опубликовано: 26.05.2021 19:01:12
Jim

Jim

0 сообщений из 7 понравились пользователям.

Группа: User

hi folks, thanks for your contributions
the way I've solved my dilemma was to multiply each term by (X>0) so that whenever X is less than zero the sqrt(X*(X>0)) becomes zero.
#6 Опубликовано: 26.05.2021 20:09:39
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

the way I've solved my dilemma


You have solved nothing yet from nothing to pass QA !
#7 Опубликовано: 26.05.2021 22:02:06
Jim

Jim

0 сообщений из 7 понравились пользователям.

Группа: User

Wrote

Your description is too general w/o the formula.



Capture3.JPG
#8 Опубликовано: 27.05.2021 00:25:47
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi Jim. Actually your dilemma isn't trivial and the solution that you found it's complete in the sense that you extend over the integers an operation only well defined for the natural numbers. For integers, rationals, reals, complexes, vectors, matrices, tensors ... are only conventions based on definitions by convenience, very very good ones ... but not theorems.

For example Maple have the function surd for deal with roots with integers when the usual convention doesn't work. Because power don't commute have two inverses, one by the left and other by the right, roots and logarithms, complicating the things. This is the help for the surd function from Maple website:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=surd

Clipboard01.jpg

As you can see, if you ask to Maple for convert surd, it returns just x^(1/n).

So, you can define your own function pow3(x) = x^3 * (x > 0). Or maybe more general some CheckPos(x) for make more readable your expression.

Best regards.
Alvaro.
#9 Опубликовано: 27.05.2021 07:47:21
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Your description is too general w/o the formula.


Attach the *.sm document.
#10 Опубликовано: 27.05.2021 09:25:19
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Attach the *.sm document.


... do some effort:
split that monster, zap subscript, make minimalist like visiting doctor.

Page10 Split Monster.sm (476 КиБ) скачан 35 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений