SCIRun User Mailing List

Text archives Help


Re: [SCIRUN-USERS] Complex numbers


Chronological Thread 
  • From: Dana Brooks <brooks@ece.neu.edu>
  • To: jess <jess@sci.utah.edu>, Milad Rahimi <miladrahimipo@gmail.com>
  • Cc: scirun-users@sci.utah.edu
  • Subject: Re: [SCIRUN-USERS] Complex numbers
  • Date: Tue, 17 Dec 2019 20:51:46 -0500

Hi all

one comment. I think Jess' solution might work here, depending on what you want to do, but it requires that only one variable -- first matrix, or second matrix (or vector) is complex.

If both are complex I think you would have to do two computations (here Re{ } and Im{ } refer to real and imaginary parts of complex numbers):

Re{answer} = Re{first multiplicand} * Re{2nd multiplicand} - Imf{irst multiplicand} * Re{2nd multiplicand}

Im{answer} = Re{first multiplicand} * Im{2nd multiplicand} " Imf{irst multiplicand} * Re{2nd multiplicand}

I believe this works for matrices.

An alternative is to represent both matrices in a block matrix format that is double the original size, of the form

[ Re{matrix}   Im{matrix}

  -Im{matrix} Re{matrix} ]

and if you then use normal real matrix multiplication you will get the same format for the answer, with the correct real and imaginary parts 2x, one in the top block row, and then again in the bottom block row but with the imaginary part first and with a negative sign for the imaginary part.

This may be simpler to deal with from a programming point of view but requires 2x the storage and computation without some special care.

And don't forget to put the sqrt(-1) back in when you combine results ! :-)

Hope this helps ...

best,

Dana


On 12/17/19 7:36 PM, jess wrote:
Hi Milad,

The complex number support is relatively new functionality, so thank you for testing it out.  Since it is new, it is currently only supported in a limited number of modules, and it appears you’ve found a gap in the workflow that we need to fill.  I’ve created a github issue for some more modules to support complex numbers (https://github.com/SCIInstitute/SCIRun/issues/2041), which you can track to see when it may be implemented.  

There is a work around that you could do.  You could split the FE matrix and apply the real and complex parts of the voltage sources to it separately and combine them again to a single complex matrix for the solver.  If you try this, let me know how it goes. 

cheers,
Jess





On Dec 16, 2019, at 8:48 AM, Milad Rahimi <miladrahimipo@gmail.com> wrote:

Hi SCIRUN
I'm interested in modeling the capacitance feature of tissues when I'm applying a voltage source, for doing this I think I should use SolveComplexLinearSystem module. but there is no complex output in the ApplyFEMVoltageSource module. Is this possible in SCIRUN to solve a problem in which conductivity matrix is a complex matrix?

________________________________________________
SCIRun users mailing list:  scirun-users@sci.utah.edu
http://www.sci.utah.edu/software/scirun.html
To unsubscribe, email sympa@lists.sci.utah.edu with the "unsubscribe scirun-users" in the message body.

      
________________________________________________
SCIRun users mailing list:  scirun-users@sci.utah.edu
http://www.sci.utah.edu/software/scirun.html
To unsubscribe, email sympa@lists.sci.utah.edu with the "unsubscribe scirun-users" in the message body.



Archive powered by MHonArc 2.6.18.

Top of page