Menu

How do I handle complex numbers?

Help
Yotama9
2016-05-08
2016-06-27
  • Yotama9

    Yotama9 - 2016-05-08

    Hi guys.

    I have a system of equations I'm trying to do simple linear analysis to. There is a region
    wher the solution includes complex numbers, and I also have a singular point. When I use a "regular" method (change the example in the pyCont documantation to my needs) PyDSTool doesn't plot the complex number region. I printed the solutions, and I see that the output vectors doesn't include any of the complex solution, eventhough the starting point is well inside the region where the solution should be complex. How can I access these solutions?

     
  • Maurizio De Pitta'

    I am not sure exactly what example you are referring to.

    If you are talking in terms of a trajectory say sample_traj as a solution of an integration, then:

    traj = DS.compute('sample_traj')   # Compute the trajectory
    pts = traj.sample()                # Get your points
    

    If you are talking about "trajectories" as continuation curves from PyCont then say your continuation curve is sample_cont, then:

    PC['sample_cont].forward()    # Continues towards increasing par vals
    pts = PC['sample_traj].sol    # Continuation solution
    

    Use python introspection to see how sol is structured.

    Cheers,

    M

     
  • Yotama9

    Yotama9 - 2016-05-09

    There was probably a misunderstanding there. Consider the function

    x^2 -a = 0
    

    This function have 2 real solutions when a>0 and two complex solutions when a<0. I'm interested in the norm of the solutions. How can I get it when a<0?

     
  • Rob Clewley

    Rob Clewley - 2016-06-27

    Your example does not involve a dynamical system. What example are you trying to adapt? PyDSTool doesn't handle the analysis of dynamical systems whose variables are complex numbers. The only place it tracks complex numbers, to my knowledge, is when they arise as measures for eigenvalues for real-valued systems. It might nevertheless be possible to use some mathematical mappings to contrive a real-valued system out of the real and imaginary parts of complex dynamics. I'm sure an internet search will help find what options might be available to you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.