Message Boards Message Boards

0
|
1748 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Extract data from table & use it to perform arithmetic operation?

I am not sure about how I can explain this problem clearly. Nevertheless, let me try it. And it's bit lengthy:

I need to solve a sixth order equation given by the expression: $$1 + {\frac{2\kappa-1}{2\kappa-3}\frac{Nezero}{k^2}} + {\frac{2\kappa-1}{2\kappa-3}}{\frac{Nbzero}{k^2 Tbe}} - \frac{(2\kappa-1)(2\kappa+1)}{(2\kappa-3)^2}\Bigg[{\frac{w^2 Nezero}{k^4 mpe}}+{\frac{(w-kU_b)^2Nbzero}{k^4Tbe^2mpe}}\Bigg]\\-{\frac{Npzero}{w^2}\bigg(1+\frac{3k^2Tpe}{w^2}\bigg)} - {\frac{z^2Nizero\times mpi}{w^2}\bigg(1+\frac{3k^2Tpe}{w^2}\bigg)}$$

Here there are some constant values, I vary ‘k’ and find the values of ‘w’. For single value of k, I will get 6 w’s. Some of it are complex. I separate it out into real and imaginary and write it on ‘solnofequation’. For simplicity, one can think solnofequation as a matrix or table, which in the present case has a dimension of 10 X 13 (10 rows and 13 columns; rows will change as one change ‘kinterval’). First column gives values of k, second column gives real values of first root for each k, third column gives imaginary part of first root etc.

Now I have to take the each real part in a row, subtract ‘k’ times ub divide by k times mpe. And then whole of this should get multiplied by kappa2 given in the programme.

E.g. solnofequation[[2]] gives {0.2, 0.161643, 0, 1.06185, 0, -0.144433, -0.109161, -0.144433, 0.109161, 0.0116811, -0.117174, 0.0116811, 0.117174}.

Here, first element if k, second element is real par of first root, third element is imaginary part of first root, fourth element is real par of second root and so on. Here, what I have to do is $\frac{(0.161643-0.2*ub)}{mpe}*kappa2$, then $\frac{(1.06185-0.2*ub)}{mpe}*kappa2$ so on.

Further, solnofequation[[8]] gives {0.8, 0.609319, 0, 4.42253, 0, -0.636614, -0.409612, -0.636614,0.409612, 0.0366778, -0.453399, 0.0366778, 0.453399}

Here, effectively what I have to do is $\frac{(0.609319-0.8*ub)}{mpe}*kappa2$, then $\frac{(4.42253-0.8*ub)}{mpe}*kappa2$ and so on.

This has to be done on each row. Then I need to export into a dat file, where first column gives values of k, second column gives real values of first root for each k, third column gives imaginary part of first root for each k, fourth column gives the value of the real part of first root after above calculation for each k, fifth column gives real values of second root for each k, sixth column gives imaginary part of second root for each k, seventh column gives the value of the real part of second root after above calculation for each k and so on.

All I could muster was:

  1. solve the equation
  2. write it on to a table with real and imaginary part separated
  3. to export the file without what the calculation that I require.

Ideally, what I am expecting is something like this:

expected

The code that I have written is attached with this question.

Any help will be deeply appreciated. I know that this question is very lengthy, I could not help it. Thanks at least for those who took time to read this lengthy question.

Attachments:
POSTED BY: Sreeraj T
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract