Composition of Functions and Sequence

3 Ansichten (letzte 30 Tage)
Kondiik
Kondiik am 1 Sep. 2013
1.2 I tried to sort it but obviously something is wrong...
syms x y
f = 1/(x+1); h = exp(x); g = 1;
h = compose(f,g)
1.3 I have no idea whats it is about.

Akzeptierte Antwort

rifat
rifat am 1 Sep. 2013
Bearbeitet: rifat am 1 Sep. 2013
1.2 - Try to use finverse
1.3 - Use loops to solve
N=3; % number of terms
v=sqrt(2);
for i=1:N-1
v=sqrt(2+v);
end
v
To find convergence use a very large value of N
  2 Kommentare
Kondiik
Kondiik am 1 Sep. 2013
Bearbeitet: Kondiik am 1 Sep. 2013
Thank you. I used this one for 1.2 with small modification.
N=3; % number of terms
v=sqrt(2);
v
for i=1:N-1
v=sqrt(2+v);
v
end
Roger Stafford
Roger Stafford am 1 Sep. 2013
It is more elegant to use the equation given to you by Matt J:
L=sqrt(2+L)
and solve for L. It is the value for which there is no change in the iteration and it is also the value your sequence converges to. You don't need to carry out the iteration for large N to find it, though if you do, you will see that these answers agree.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Matt J
Matt J am 1 Sep. 2013
Bearbeitet: Matt J am 1 Sep. 2013
1.3 To what value does this sequence converge
Hint - the formula for the recursion is
a(n)=sqrt(2+a(n-1))
If a(n) converges to a limit L, then taking limits on both sides leads to the equation
L=sqrt(2+L)

Roger Stafford
Roger Stafford am 1 Sep. 2013
Bearbeitet: Roger Stafford am 1 Sep. 2013
For problem 1.2 I strongly recommend reading up on the definition of function composition. For example:
http://en.wikipedia.org/wiki/Function_composition
You are looking to define a function y = g(x) which has the property that
f(g(x)) = f(y) = h(x) = exp(x)
where f(y) = 1/(y+1). It's easy to solve for y = g(x) in this equation. Then set x equal to 1.
  1 Kommentar
Kondiik
Kondiik am 2 Sep. 2013
Bearbeitet: Kondiik am 2 Sep. 2013
How to set x = 1?
syms x y; % creat symbolic variables
f = (1/(x+1));
h = exp(x);
g = y;
x = 1;
y = solve(h == compose(f,g,x,y), y)
|y =
exp(-x) - x|

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by