Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7052137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:20:51+00:00 2026-05-28T03:20:51+00:00

I hope this hasn’t been asked before, if so I apologize. EDIT: For clarity,

  • 0

I hope this hasn’t been asked before, if so I apologize.

EDIT: For clarity, the following notation will be used: boldface uppercase for matrices, boldface lowercase for vectors, and italics for scalars.

Suppose x0 is a vector, A and B are matrix functions, and f is a vector function.

I’m looking for the best way to do the following iteration scheme in Mathematica:

A0 = A(x0), B0=B(x0), f0 = f(x0)
x1 = Inverse(A0)(B0.x0 + f0)

A1 = A(x1), B1=B(x1), f1 = f(x1)
x2 = Inverse(A1)(B1.x1 + f1)

...

I know that a for-loop can do the trick, but I’m not quite familiar with Mathematica, and I’m concerned that this is the most efficient way to do it. This is a justified concern as I would like to define a function u(N):=xNand use it in further calculations.

I guess my questions are:

What’s the most efficient way to program the scheme?

Is RecurrenceTable a way to go?

EDIT

It was a bit more complicated than I tought. I’m providing more details in order to obtain a more thorough response.

Before doing the recurrence, I’m having problems understanding how to program the functions A, B and f.

Matrices A and B are functions of the time step dt = 1/T and the space step dx = 1/M, where T and M are the number of points in the {0 < x < 1, 0 < t} region. This is also true for vector the function f.

The dependance of A, B and f on x is rather tricky:

A and B are upper and lower triangular matrices (like a tridiagonal matrix; I suppose we can call them multidiagonal), with defined constant values on their diagonals.

Given a point 0 < xs < 1, I need to determine it’s representative xn in the mesh (the closest), and then substitute the nth row of A and B with the function v( x) (transposed, of course), and the nth row of f with the function w( x).

Summarizing, A = A(dt, dx, xs, x). The same is true for B and f.

Then I need do the loop mentioned above, to define u( x) = step[T].

Hope I’ve explained myself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:20:52+00:00Added an answer on May 28, 2026 at 3:20 am

    I’m not sure if it’s the best method, but I’d just use plain old memoization. You can represent an individual step as

    xstep[x_] := Inverse[A[x]](B[x].x + f[x])
    

    and then

    u[0] = x0
    u[n_] := u[n] = xstep[u[n-1]]
    

    If you know how many values you need in advance, and it’s advantageous to precompute them all for some reason (e.g. you want to open a file, use its contents to calculate xN, and then free the memory), you could use NestList. Instead of the previous two lines, you’d do

    xlist = NestList[xstep, x0, 10];
    u[n_] := xlist[[n]]
    

    This will break if n > 10, of course (obviously, change 10 to suit your actual requirements).

    Of course, it may be worth looking at your specific functions to see if you can make some algebraic simplifications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope this question hasn't been asked before. I've got the following working <!-- 640x920
I hope this hasn't been asked before. I have a nullable boolean called boolIsAllowed
I hope this question (or one similar) hasn't been asked before. Sincere apologies if
I hope this hasn't been asked before but it's hard for me to put
I hope this hasn't been asked yet, since I couldn't find it. I am
I hope that this question hasn't been asked already, but I was looking for
I hope this hasn't been asked and I just missed it, but I searched
I hope this hasn't already been answered, but I feel like I have read
i hope this hasn't already been answered, I've looked through for awhile and haven't
Hope this question wasn't asked before. Does anyone know the character limit for domain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.