First time here? Check out the FAQ!

Ask Your Question
1

Set a REAL function in SAGE

asked 5 years ago

Karim gravatar image

updated 5 years ago

vdelecroix gravatar image

Hello everyone,

I have a problem when I was trying to set my function H(t) as real.

image description

H = function('H')(t)
H.is_real()

=> False

conjugate(H)

=> \bar{H}

I wanna set my function in real space and the code stop printing \bar{H] as you seen in the screen shot.

Thanks for the help. Cheers.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 5 years ago

rburing gravatar image

A simple alternative to 'setting it to be real' is to make a substitution such as this one:

whatever.subs({conjugate(H) : H, real_part(H) : H, imag_part(H) : 0})

It depends on what kind of expressions you want to get rid of.

Preview: (hide)
link
0

answered 5 years ago

Emmanuel Charpentier gravatar image

This appears to be unsupported in either Sage or Maxima. Implementing this seems to be no small beer.

You may try to discuss this on sage-devel...

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 5 years ago

Seen: 750 times

Last updated: Mar 18 '19