• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Tag Archives: recursion

How the most efficient way to plot recursion

December 28, 2018   BI News and Info

I’m using recursion method to do decimation (what I define as s in my program) to a square lattice. I want to show Zeta in function of w.
The problem is, my variable is E* (energy), more specifically w. If I make w vary at the beginning of the program I don’t know how to plot the Zeta. The code is as follow’s:

wmin = -4;
wmax = 4;
s = 5;
n = 2;
\[Eta] = 0.1; t = 1; \[Epsilon] = 0;


U = Table[If[i == j, t, 0], {i, 1, n}, {j, 1, n}];
H = Table[If[i == j - 1, t, 0], {i, 1, n}, {j, 1, n}] + 
   Table[If[i == j + 1, t, 0], {i, 1, n}, {j, 1, n}] +
   Table[If[i == j, \[Epsilon], 0], {i, 1, n}, {j, 1, n}];

This first part, I define some matrices…The loop part to make w vary is:

While[
 wmin <= wmax,

 SubStar[E] = IdentityMatrix[n]*(wmin + \[Eta]*I);
 Subscript[\[Alpha], 1] = U .Inverse[SubStar[E] - H] .U;

 For[j = 2, j < s + 1, j++,
  Subscript[\[Alpha], j] = 
    Subscript[\[Alpha], j - 1].Inverse[SubStar[E] - H - 2 \!\(
\*SubsuperscriptBox[\(\[Sum]\), \(i = 1\), \(j - 1\)]
\*SubscriptBox[\(\[Alpha]\), \(i\)]\)].Subscript[\[Alpha], j - 1];

  ];


 G11 = Inverse[SubStar[E] - H - \!\(
\*SubsuperscriptBox[\(\[Sum]\), \(i = 1\), \(s\)]
\*SubscriptBox[\(\[Alpha]\), \(i\)]\)];

 \[Zeta] = -1/\[Pi] Im[G11];

 wmin = wmin + 1;

 ]

I actually know what I expect from the plot. In other version of the program, I let w vary only at the end of the code (Inside the Plot), and as you might imagine, it’s a veeeery slow way to get a result.

Plot[Diagonal[\[Zeta]], {w, -4, 4}, Frame -> True, 
 Exclusions -> None]

The result from this plot is:
YKc3T How the most efficient way to plot recursion

OBS: I have to use a large s to make the graph’s look better. But it’s get way too slowly.

So, if you have any suggestion to plot in a efficient way, I would be thankful!

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange

Read More
  • Recent Posts

    • Accelerate Your Data Strategies and Investments to Stay Competitive in the Banking Sector
    • SQL Server Security – Fixed server and database roles
    • Teradata Named a Leader in Cloud Data Warehouse Evaluation by Independent Research Firm
    • Derivative of a norm
    • TODAY’S OPEN THREAD
  • Categories

  • Archives

    • April 2021
    • March 2021
    • February 2021
    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited