Message Boards Message Boards

Substitute two variable ranges in Table format?

Posted 3 years ago

Hi, I am having some problem. I want to get the result of the equation that have two unknown variables, and I have different ranges of two variables (t and k). t is from 0 to 1 with spacing 0.01 {t,0,1,0.01} and k is from 0.001 to 1 with 0.01 spacing {k,0.001,1,0.01}. I could not get any idea to solve this. I have attached a file for further details. Any help would be appreciated.

t =.; \[Epsilon] = 0.9; k =.; Bi = 0.1; Br = 0; Da = 10^-2;

Re = 32/Um;
fRec = 96;
Nu = (2 \[Epsilon])/(k (D1 + D2 + D3 + D4 + D5 - 
       1/Um (-(D1/8) + (A1 D1)/3 + (A2 D1)/2 - D2/10 + (A1 D2)/4 + (
          A2 D2)/3 - D3/12 + (A1 D3)/5 + (A2 D3)/4 - D4/14 + (A1 D4)/
          6 + (A2 D4)/5 - D5/6 + (A1 D5)/2 + A2 D5 - A2 D5 t - 
          1/2 A2 D1 t^2 - 1/2 A1 D5 t^2 - 1/3 A1 D1 t^3 - 
          1/3 A2 D2 t^3 + (D5 t^3)/6 + (D1 t^4)/8 - 1/4 A1 D2 t^4 - 
          1/4 A2 D3 t^4 + (D2 t^5)/10 - 1/5 A1 D3 t^5 - 
          1/5 A2 D4 t^5 + (D3 t^6)/12 - 1/6 A1 D4 t^6 + (D4 t^7)/
          14 + (A0 A3 E3 Cosh[Sqrt[A6] t] Sinh[A0 t])/(A0^2 - A6) + 
          1/(12 A0^3) (-24 A0 A3 E1 t Cosh[A0 t] + 
             6 (2 A0^2 Da E2 + A0^2 A3 (E4 + 2 E5) + 
                2 A3 E1 (2 + A0^2 t^2)) Sinh[A0 t] + 
             A0^2 (2 A0 t (3 A3 E2 + 6 Da E5 + 2 Da E1 t^2) + 
                3 (A3 E2 + 2 Da E4) Sinh[2 A0 t] + 
                2 A3 E4 Sinh[3 A0 t])) + (
          E3 ((-A0^2 + A6) Da + A3 A6 Cosh[A0 t]) Sinh[Sqrt[A6] t])/(
          Sqrt[A6] (-A0^2 + A6)))));
Nuc = 4.12;
Table[{(Nu/Nuc)/(fRe/fRec)}, {t, 0, 1, 0.01}]
Attachments:
5 Replies

Thanks for your help. Actually, this was the requirement of the assignment to make it on excel.

Posted 3 years ago

This works fine for me. I have attached the output.

result = Table[<|"t" -> t, "k" -> k, "result" -> First@{(Nu/Nuc)/(fRe/fRec)}|>, 
          {t, 0, 1, 0.01}, {k, 0.001, 1, 0.01}] // Flatten // Dataset

Export["results.xlsx", results]

Why do you need to use Excel for plotting? Why not plot in Mathematica?

Attachments:
POSTED BY: Rohit Namjoshi

Is this what you are looking for?

OP = Table[(Nu/Nuc)/(fRe/fRec), {t, 0, 1, 0.01}, {k, 0.001, 1, 0.01}];
Export["filename.xls", OP]
POSTED BY: Gianluca Gorni

Yes, I am looking for this but I need to export the data in excel sheet and then plot. When I export it does not have any data. Do you have any idea how to get this?

Posted 3 years ago

Hi Mirza,

Is this what you are looking for?

Table[<|"t" -> t, "k" -> k, "result" -> First@{(Nu/Nuc)/(fRe/fRec)}|>, {t, 0, 1, 0.01},
 {k, 0.001, 1, 0.01}] // Flatten // Dataset
POSTED BY: Rohit Namjoshi
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