Imaginary numbers what to do with them

Click For Summary
SUMMARY

The discussion focuses on solving for peak velocity (Vs) in a trapezoidal move using Mathematica, where three equations yield results involving imaginary numbers. The user seeks to rewrite these equations in a programming language that does not support imaginary numbers, specifically addressing issues with negative values under square roots leading to illegal operations. Suggestions include using matrices to represent complex numbers and verifying results through Mathematica before implementation.

PREREQUISITES
  • Understanding of peak velocity calculations in kinematics
  • Familiarity with Mathematica for solving equations
  • Basic knowledge of complex numbers and their representation
  • Proficiency in a programming language that lacks support for imaginary numbers
NEXT STEPS
  • Research how to represent complex numbers using matrices
  • Learn about numerical methods for solving equations in Mathematica
  • Explore alternative mathematical formulations that avoid imaginary numbers
  • Investigate error handling for square root operations in programming languages
USEFUL FOR

Mathematicians, physicists, and software developers working with kinematic equations and numerical methods who need to handle complex numbers in programming environments.

larsbentley
Messages
29
Reaction score
0
I have attached an image showing the three possible solutions (as determined by Mathematica) when solving for the peak velocity(Vs) in a trapezoidal move where the following are already known: distance(d),total time(t),units of acceleration(Ma),units of deceleration(Ma),initial velocity(Vi), final velocity(always zero for my purposes).

One of these equations is presumably correct, and you will notice that the second two equations contain an imaginary number 'i" in two places in the equation. I am trying to write the correct equation up in a programing language that has no provision for incorporating imaginary numbers.

Is there a way I can rewrite these equations without the 'i' imaginary number... substituting the 'i' with a placeholder of some kind and changing the negative values that need to be "square rooted" with positive ones?

I already tried writing up the first equation which uses no 'i' imaginary numbers in the programming language but the value under the square root turns out to be a negative number, causing an illegal square root error. If I simply change the value to positive the equation will process but it does not give a true answer based on the known values I input. I'm guessing that this is not the equation that will give me the actual solution, so I will need to use one of the two equations that involve imaginary numbers.

Can anyone help?

Thanks
 

Attachments

  • speed formulas with ac dc counts2.jpg
    speed formulas with ac dc counts2.jpg
    41.3 KB · Views: 595
Physics news on Phys.org
Before you spend too much effort, you should try plugging in numerical values using Mathematica, to make sure you actually have the answer you wanted!

What language are you using, by the way?
 
Hurkyl,

Good suggestion! None of the three formulas returned valid results when I plugged values back into them, but the source formula does produce valid results so I am not sure when I am doing wrong. As you can see in the attached jpg I get an error:

"Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result"

Perhaps there is another method to solve for this equation in Mathematica, or I am writing it up incorrectly?

I have attached a new jpg showing that when I make assumptions about the values Mathematica will return the correct result as the third answer in its set of possible solutions.
 

Attachments

  • speed formulas with assumptions.jpg
    speed formulas with assumptions.jpg
    4.9 KB · Views: 548
larsbentley said:
I have attached an image showing the three possible solutions (as determined by Mathematica) when solving for the peak velocity(Vs) in a trapezoidal move where the following are already known: distance(d),total time(t),units of acceleration(Ma),units of deceleration(Ma),initial velocity(Vi), final velocity(always zero for my purposes).

One of these equations is presumably correct, and you will notice that the second two equations contain an imaginary number 'i" in two places in the equation. I am trying to write the correct equation up in a programing language that has no provision for incorporating imaginary numbers.

Is there a way I can rewrite these equations without the 'i' imaginary number... substituting the 'i' with a placeholder of some kind and changing the negative values that need to be "square rooted" with positive ones?

I already tried writing up the first equation which uses no 'i' imaginary numbers in the programming language but the value under the square root turns out to be a negative number, causing an illegal square root error. If I simply change the value to positive the equation will process but it does not give a true answer based on the known values I input. I'm guessing that this is not the equation that will give me the actual solution, so I will need to use one of the two equations that involve imaginary numbers.

Can anyone help?

Thanks

I know that is possible to denote complex numbers with matrices instead of using i. That should be easy to find.
 
Thanks Patrick...

I'm going to create a new topic to try to solve the problem with my Mathematica output before continuing because I don't have a formula that works anyway.

Lars
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 36 ·
2
Replies
36
Views
6K
  • · Replies 28 ·
Replies
28
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 44 ·
2
Replies
44
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K