Bypassing Default Values of Constants - Messages
I'm sure this is a really simple thing, but I seem to not be searching the right question in my forum searches... I work in the Electrical Engineering field, and as many are aware, we use i to represent current, and j to represent the imaginary unit. I've been trying to figure out how to use i as a variable in smath, but it appears everything I've tried results in i being the imaginary unit rather than used as a variable.
How do you bypass the "constant" functionality built into i in the program and use it as a variable? Also, is there a way to permanently re-assign j to be the imaginary unit within the program?
Thanks in advance!
Or swap i with j via editing Constants.xml.
It is hard-embedded to smath code.
Clear(i) gives 1, which falsely results as it worked.
But it won't actually be removed by Clear().
However, you can assign sqrt(-1) or i to j.
Results placeholder can be edited with j.
And you can reassign you i result to j.
Regards
WroteYou can't totally remove i assign.
Or swap i with j via editing Constants.xml.
It is hard-embedded to smath code.
Clear(i) gives 1, which falsely results as it worked.
But it won't actually be removed by Clear().
However, you can assign sqrt(-1) or i to j.
Results placeholder can be edited with j.
And you can reassign you i result to j.
Regards
Thanks for the assistance! Am I understanding correctly then that there isn't a real way to assign lower case i as a normal variable and use it for a real number then? Just double checking.
I've attached a screenshot to this post of an example calculation, I don't think it will be a huge deal to substitute capital I for i in most formulas, I just need to be aware of the limitation as I and i have different connotations in my work at times. Haven't dove into the units too much with smath yet, but I have had a hard time with similar programs in the past with similar formulas as it's hard to get it to mix SI & imperial units to a desired result (i.e., inputs in amps, feet, lbs, etc to result in a lb/ft or similar)
WroteThanks for the assistance! Am I understanding correctly then that there isn't a real way to assign lower case i as a normal variable and use it for a real number then? Just double checking.
Actually you can, but j won't constantly swap with i.
Every worksheet should have j:sqrt(-1) at top.
i will have what you assigned. variable, real, etc.
But when you calculate something which results as sqrt(-1),
it will considered as i again.
While i still has another value,
calculation still gives it as sqrt(-1).
But when you directly call i,
it will have what you assigned.
Regards
WroteI'm sure this is a really simple thing, but I seem to not be searching the right question in my forum searches... I work in the Electrical Engineering field, and as many are aware, we use i to represent current, and j to represent the imaginary unit. I've been trying to figure out how to use i as a variable in smath, but it appears everything I've tried results in i being the imaginary unit rather than used as a variable.
How do you bypass the "constant" functionality built into i in the program and use it as a variable? Also, is there a way to permanently re-assign j to be the imaginary unit within the program?
Imaginary 'i' is pretty universal.
Very many Smath advanced functions are coded on that basis.
They will certainly not recognize 'j' ... hits the wall.
For the first part:
Wrote...we use i to represent current...Thanks in advance!
NOTE: if you accidently corrupt this file (i.e., SMath will not even load), you can just re-install SMath as every new install will rewrite/replace the Units.xml file.
...
Add those portions, Highlighted in Yellow:
...
As for the second part:
Wrote... j to represent the imaginary unit...
First: define 'j as the imaginary unit; copy and paste the following:
Quote'j:sqrt(-1)
Next: define a function, similiar to this:
Cn(_num):line(concat(var2str(Re(_num)),"\002B\",var2str(Im(_num)),"\002A\\0027\j"
,1,1)
May this be of Good Help!
- Kenny Lemens, P.E. ᵂᴵ
-
New Posts
-
No New Posts