manually coding partial fractions

4 visualizzazioni (ultimi 30 giorni)
callum linnegan
callum linnegan il 24 Apr 2020
Risposto: Star Strider il 24 Apr 2020
Hi i was wondering if there is a way to maunually code partial fractions, i want to be able time the LHS denominator to the RHS and then group the values in terms of x^3,x^2 and x.
This is the question i am trying to solve.
I have done the first part by hand and used matlab to check my answer but i cant find a way to group the terms.
If anyone could help or direct me in the right direction it would be much Appreciated.
syms A1 A2 A3 A4
eqn1 = 2*A1 + A4 == 3;
eqn2 = A3 - 2*A4 == -2;
eqn3 = -A1 -2*A3 + A4 == -3;
eqn4 = -A1 + A3 ==2;
[M,B] = equationsToMatrix([eqn1,eqn2,eqn3,eqn4],[A1,A2,A3,A4])
X = linsolve(M,B)

Risposte (1)

Star Strider
Star Strider il 24 Apr 2020
The Symbolic Math Toolbox partfrac function (introduced in R2015a) will do exactly what you want:
syms x
Eq = (2*x^5 -2*x^4 + 2*x^3 + 3) / (2*x^4 - 2*x^3 - x^2 + 1);
Eqpf = partfrac(Eq, x)
Eqpf = vpa(Eqpf)
producing:

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by