SMath Studio Forum
»
SMath Studio
»
Samples
»
Electrical Engineering Complex Number Calculation with custom units
Rank: Newbie
Groups: Registered
Joined: 17/06/2013(UTC) Posts: 9 Was thanked: 5 time(s) in 2 post(s)
|
I have uploaded an example of a simple AC circuit analysis using complex numbers to the wiki: Wiki ExamplesIt is a very simple circuit but there are a couple of points worth noting: 1. The ac power units "VA" and "var" are not normally included in Smath So I defined them as custom units which are dimensionally equivalent to the "Watt". P, Q and S will all default to Watts but you can select the correct unit (Watt for P, VA for S and var for Q) by clicking the box after the default unit and selecting your choice of unit. 2. I defined a custom complex conjugate function (reverse sign of the imaginary component) in order to facilitate the calculation of complex power. 3. The current build of Smath will not allow the functions Re(), Im() or arg() to be used on a complex number with units so I removed the units before applying these functions and added them back after. 4. I left "i" as the complex operator. You can define "j=sqrt(-1)" if you wish but the answers will still come out using "i". Edited by user 29 October 2013 15:21:23(UTC)
| Reason: Correct typo in spelling of Electrical in post title.
|
4 users thanked kevnol for this useful post.
|
on 17/06/2013(UTC), on 17/06/2013(UTC), on 17/06/2013(UTC), on 08/07/2013(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
Your post inspired me to an update of the handbook page (attached). This sheet emphasises the need for unit-proof complex functions. As mentioned here or here. Also, the topic here illustrates the problem. |
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 17/06/2013(UTC) Posts: 9 Was thanked: 5 time(s) in 2 post(s)
|
Oh yes if the complex functions worked with units it would make life easier. Re() and Im() should give the same units as the original complex number while arg() should return an angle regardless of the original units. To be honest I was very impressed at how well Smath handles units in complex number arithmetic at all but more would of course be nice.
Your handbook looks really good by the way. Sadly my German is not up to most of it but I can follow the maths!
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
Originally Posted by: kevnol Your handbook looks really good by the way. Sadly my German is not up to most of it but I can follow the maths!
Thanks for the feedback. The handbook was made for the teaching german students who's english skills are not that good in average. In order to serve both the students and the community, I've started a different type of handbook, a bilingual prototype can be found here. It has been the last smath build, which by providing reasonable editing comfort mad that possible to do. |
|
|
|
|
Rank: Member Groups: Registered
Joined: 18/04/2013(UTC) Posts: 25
Was thanked: 1 time(s) in 1 post(s)
|
Thank you, would like to see how Smath can be used for Trans simulation
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Samples
»
Electrical Engineering Complex Number Calculation with custom units
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.