(I've created a new post, because the previous post is solved)
I'm sorry for disturb you again, but I have a doubt that I think could be easy to solve.
In the same line I've working, I want to represent the phase of a complex number (a+j*b), where "a" is the real part and "b" is the imaginary part of the number.
The phase is given by the following equation:
Ph=arctan(b/a)
I don't know how to obtain the arctan of two variables. In this case, this two variables are:
But I don't find the way to do that. I've installed the packages pst-math and pst-ploth, and I've used the function ATAN, but it still give me some errors... And, of course, I want to do something like that:
As I've mentioned a few times in the other thread: these calculations use the expl3 module »fp«. All of its features are explained in interface3. To be more specific: available operations are explained in section 9.3. You'll find that atan and its siblings asin and acos are missing. As a matter of fact they are mentioned in section 10 (Disclaimer and Roadmap) as part of the todo list. So I'm afraid you'd need either to find another way to calculate the arctangent or use another method to generate the table.
Thinking about it: probably the best way would be to generate a csv file with some other program and use datatool or pgfplotstable to access the numbers and display them.
But it give me so many errors, always the same error: the function ... already exists. It refers to math functions, because I'm using the pgfplotspackage, that is necessary for my work.
Other way that I think that could be fine, it's to get the phase of a complex number by some LaTeX function, but I don't find it yet... I mean, if I had two numbers (\FAR and \FAI), which are the real and the imaginary part of a complex number, I suppose that should exists some function in LaTeX that could enable me to get the phase of the complex number (which could be get by the equation Ph=arctan(b/a), where "b" is the imaginary part and "a" is the real part of the complex number).
I think that, if I don't find any other solution, I could try that you say: define the equations in a CSV, and use some function that reads this values... But it looks a bit difficult..
No, pgf's math functions do not work together with expl3's. As I tried to emphasize a few times now: the code for the table I gave you uses expl3 for the calculations, specifically in the argument of the \fp_set:Nn macro:
You whole task at hand is something TeX is not designed for. TeX was designed for typesetting books but not for doing complicated calculations. Amazingly enough that there are packages like »l3fp«, »pgfmath«, or »fp«. All of them go to some trouble doing these calculations and all of them have limitations.
Your task probably is easy in LuaLaTeX using Lua for the calculations. I have no experience with Lua at all, though, so I can't give you jump start there...
The first doubt that I have is how to define an array like a variable. I think that it's easy, but this doubt is related with the following doubt.
Now, I want to use an instruction in order to call some variables previously defined in my code, and in this way obtain some results. I know how to do that in MatLab, but in LaTeX it is different... I've installed the xargs package in order to make this instruction.
So, imagine that I want to create this instruction with five arguments (\El, \WL, \RA, \IA and \SE), and \RA and \IA are the two variables that I want to define like two arrays (I mean, I want that this variables could take multiple values). So, I think the instruction could be something like that (I don't know if it's right):
With [5] I say the number of arguments that the instruction have; with [1=, 2=, ... 5=] I say the values that I want the arguments take; and with {\El \WL \RA \IA \SE} I specify the arguments to take into account.
But, like I said before, I want to define \RA and \IA like two arrays, in the way \RA could be, for example, [0,1,1,1], and \IA could be, for example, [5,10,15,20], and I want to specify it in the instruction (I suppose that I've to define previously empty arguments). Do you know what I'm saying?
And finally, I want to make a call to this instruction, in the way: