TransWikia.com

Part specification is longer than depth of object

Mathematica Asked on September 28, 2021

everyone! I’m a bit new to Mathematica. Could you help me plot this:

TheoreticalT[n2_, k2_, 
   w_] := (2*cn2[n2, k2]*(n1 + n3)*E^(
     I (2 [Pi] w  d2 (cn2[n2, k2] - 1))/
      c))/((n1 + cn2[n2, k2])*(n3 + cn2[n2, k2]) - (cn2[n2, k2] - 
        n1)*(cn2[n2, k2] - n3)*E^(I (2 cn2[n2, k2] 2 [Pi] w d2 )/c));
TheoreticalT2[n4_, k4_, 
   w_] := (2*cn4[n4, k4]*(n1 + n3)*E^(
     I (2 [Pi] w  d2 (cn4[n4, k4] - 1))/
      c))/((n1 + cn4[n4, k4])*(n3 + cn4[n4, k4]) - (cn4[n4, k4] - 
        n1)*(cn4[n4, k4] - n3)*E^(I ( 2 cn4[n4, k4] 2 [Pi] w d2)/c));
TheoreticalT3[n6_, k6_, 
   w_] := (2*cn6[n6, k6]*(n1 + n3)*
     E^(-I (2 [Pi] w  d2 (cn6[n6, k6] - 1))/
      c))/((n1 + cn6[n6, k6])*(n3 + cn6[n6, k6]) - (cn6[n6, k6] - 
        n1)*(cn6[n6, k6] - n3)*E^(I ( 2 cn6[n6, k6] 2 [Pi] w d2)/c));

I followed the same method in saving and plotting equations from my other equations but it doesn’t work for this one. Here’s what I’ve been doing:

(*saving the Theoretical Transmittance data*)
TheoreticalTdata = 
  Table[{freq[[i]], Re[TheoreticalT[[i]]], Im[TheoreticalT[[i]]]}, {i,
     1, np}];
TheoreticalT2data = 
  Table[{freq[[i]], Re[TheoreticalT2[[i]]], 
    Im[TheoreticalT2[[i]]]}, {i, 1, np}];
TheoreticalT3data = 
  Table[{freq[[i]], Re[TheoreticalT3[[i]]], 
    Im[TheoreticalT3[[i]]]}, {i, 1, np}];

(*Plotting the Theoretical Transmittance*)
ListPlot[{Table[{freq[[i]], Abs[TheoreticalT[[i]]]}, {i, 1, np}], 
  Table[{freq[[i]], Abs[TheoreticalT2[[i]]]}, {i, 1, np}], 
  Table[{freq[[i]], Abs[TheoreticalT3[[i]]]}, {i, 1, np}]},
 PlotRange -> {{fmin, fmax}, All}, Joined -> True, Frame -> True, 
 FrameLabel -> {"Frequency (THz)", "Transmittance"}, 
 PlotLabel -> "Transmittance", PlotStyle -> {Red, Green, Blue}]
(*Legend:
Red: Sample 1, Green: Sample 2, Blue: Sample 3*)

And here are some of the errors that I’ve been encountering:

Part::partd: Part specification TheoreticalT[[1]] is longer than depth
of object.

Hope you could help. Thanks!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP