1 Pages (5 items)
Electrical Engineering Complex Number Calculation with custom units - Messages
#1 Posted: 6/17/2013 12:36:18 PM
I have uploaded an example of a simple AC circuit analysis using complex numbers to the wiki: Wiki Examples
It 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".

It 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".

4 users liked this post
Radovan Omorjan 6/17/2013 1:00:00 PM, Davide Carpi 6/17/2013 1:47:00 PM, Martin Kraska 6/17/2013 3:11:00 PM, Andrey Ivashov 7/7/2013 6:17:00 PM
#2 Posted: 6/17/2013 3:07:53 PM
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.
Math Complex.sm (32 KiB) downloaded 496 time(s).
This sheet emphasises the need for unit-proof complex functions. As mentioned here or here. Also, the topic here illustrates the problem.
Math Complex.sm (32 KiB) downloaded 496 time(s).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 6/17/2013 4:42:35 PM
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!
Your handbook looks really good by the way. Sadly my German is not up to most of it but I can follow the maths!
#4 Posted: 6/17/2013 6:25:17 PM
Wrote
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.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 Pages (5 items)
-
New Posts
-
No New Posts