Group Abstract Group Abstract

Message Boards Message Boards

0
|
332 Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

How does Wolfram deals with undefined list in equations?

Posted 23 days ago

I'm trying to solve the following recurrence equatoins, vP = tail(v)∧ wP= w ⊗ head(v), and get its invariant relation, where the variables are of ListType v,w and the condition to run is Length(v) > 0 How to get the invariant of this using RSolve?

RSolve[{v[n + 1] == Rest[v[n]] && w[n + 1] == Append[w[n], {First[v[n]]}], {v[0] == v0 , 
   w[0] == w0}}, {v[n], w[n]}, n]

Following is what I got: RSolve::ivar {h,t,4,7} is not a valid variable. It was unable to give a solution. How to get the invariant in the case of a list in Mathematica?

Attachments:
POSTED BY: Ibtisam Ali
3 Replies

Sorry, I have no idea what an invariant relation is.

POSTED BY: Gianluca Gorni

The function RSolve is meant for numerical recurrences, not for set operations. Also, First and Rest do not work on undefined lists. I would try something like this:

Clear[v, w];
v[0] = Range[10];
w[0] = {};
v[n_] := v[n] = Rest[v[n - 1]];
w[n_] := w[n] = Append[w[n - 1], First[v[n - 1]]];
POSTED BY: Gianluca Gorni
Posted 22 days ago

Thank you for the respose. Does Mathematica have another function to use to calculate the invariant relation for such case?

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