solving an equation not by sym
1 回表示 (過去 30 日間)
古いコメントを表示
Hello
My equation is developed in a step-by-step manner as follows with some assumptions. x is the unknown in here. This is just a simplified form of my equation.
E(1,1)=0
E(2,1)=(2/x)+(4*E(1,1))
E(3,1)=(2/x)+(4*E(2,1))
.....
E(n+1,1)=(2/x)+(4*E(n,1))
I set E(n+1,1) equal to zero and find the x via sym. However, it takes a long time via sym. Is there any alternative solution?
0 件のコメント
回答 (4 件)
Walter Roberson
2022 年 10 月 28 日
https://www.mathworks.com/help/symbolic/compute-z-transforms-and-inverse-z-transforms.html
You appear to have a recurrence relationship. Those are potentially solvable with ztrans.
0 件のコメント
John D'Errico
2022 年 10 月 28 日
編集済み: John D'Errico
2022 年 10 月 28 日
You have this basic first order linear recurrence relation:
E(n+1,x) = 2/x + 4*E(n,x)
Where E(1,x) = 0 is a given, but also for some chosen value of N, you will then also want E(N,x) = 0.
Of course, the recurrence relation as shown has a trivial solution. 2/x is a effectively a constant with respect to n. Can we solve this problem using z-transforms? That seems the simplest way. The general solution would be to solve for E(n,x), by taking the z-transform of your recurrence, solving using the inverse z-transform, then set the nth term to zero, and solve for x.
2 件のコメント
Walter Roberson
2022 年 10 月 28 日
This particular case can be resolved without ztrans by constructing a numerator (to be divided by x) in base 4. The sequence goes 0, 2, 22, 222, 2222 and so on. At the end, the base 4 numerator divided by x, has to equal 0 because the E(n+1,1) is said to be 0. The only solutions are x being ±infinity
John D'Errico
2022 年 10 月 28 日
編集済み: John D'Errico
2022 年 10 月 28 日
And why I did not actually write out a solution to this specific problem, because it was clearly not the problem of interest. I'm not even positive the question is about a simple linear one term recurrence. But a z-transform is probably the solution method to use, as we both suggrested.
Torsten
2022 年 10 月 28 日
編集済み: Torsten
2022 年 10 月 28 日
Linear system of equations in E(1,1),...,E(n+1) and 2/x.
Setup for n = 4 (solution variables are E(1,1),E(2,1),E(3,1), E(4,1), E(5,1) and 2/x in this order):
A = [1 0 0 0 0 0;-4 1 0 0 0 -1;0 -4 1 0 0 -1; 0 0 -4 1 0 -1; 0 0 0 -4 1 -1; 0 0 0 0 1 0];
b = [0 0 0 0 0 0].';
rank(A)
sol = A\b
x = 2/sol(6)
0 件のコメント
Pooneh Shah Malekpoor
2022 年 10 月 28 日
編集済み: Pooneh Shah Malekpoor
2022 年 10 月 28 日
9 件のコメント
Torsten
2022 年 10 月 31 日
Given x, the function "fun" calculates the resulting value for E(5).
"fzero" tries to adjust x so that E(5) becomes 0.
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!