Be the first to rate this file! 30 downloads (last 30 days) File Size: 2.79 KB File ID: #24636

Partial fraction decomposition v1

by xianfa zeng

 

04 Jul 2009

Code covered by BSD License  

Function used for partial fraction decomposition.

Download Now | Watch this File

File Information
Description

Some improvements have been made to the early version.
% (1) For the fraction bellow:
% s+2
% F(s) = ----------------
% s(s+1)^2(s+3)
% Input:
% >> num_input = [1 2];
% >> den_input = [1 0;1 1;1 1;1 3];
% >> frac_decomp(num_input,den_input)
%
% Result is:
% roots and counts:
% [ 0, 1]
% [ -3, 1]
% [ -1, 2]
%
% symbolic Expression:
%
% 1. s + 2.
% --------------------
% 2
% s (s + 3.) (s + 1.)
% Final Expression:
%
% 0.667 0.0833 0.500 0.750
% ----- + ------ - --------- - ------
% s s + 3. 2 s + 1.
% (s + 1.)
%
% (2) For the following fraction:
% 1
% F(s) = ------------------
% (s+1)^2(s+2s+2)
%
% Input:
% >> num_input = [1];
% >> den_input = [0 1 1;0 1 1;1 2 2];
% >> frac_decomp(num_input,den_input)
%
% Results is:
% roots and counts:
% [ -1+i, 1]
% [ -1-i, 1]
% [ -1, 2]
%
% symbolic Expression:
%
% 1.
% -----------------------------------------
% 2
% (s + 1. - 1. I) (s + 1. + 1. I) (s + 1.)
% Final Expression:
%
% 0. - 0.500 I 0. + 0.500 I 1.00 - 0. I
% - ------------- - ------------- + -----------
% s + 1. - 1. I s + 1. + 1. I 2
% (s + 1.)
%
% (3) For the following fraction:
% -4 s + 8
% ---------------
% 2 s^2 + 6 s + 8
%
% Input:
% >> b = [-4 8];
% >> a = [2 6 8];
% >> frac_decomp(b,a)
%
% Result:
% roots and count:
% [ -3/2+1/2*i*7^(1/2), 1]
% [ -3/2-1/2*i*7^(1/2), 1]
%
% symbolic Expression:
%
% -2. s + 4.
% ---------------------------------------
% (s + 1.50 - 1.32 I) (s + 1.50 + 1.32 I)
% Final Expression:
%
% 1.00 + 2.65 I 1.00 - 2.65 I
% - ----------------- - -----------------
% s + 1.50 - 1.32 I s + 1.50 + 1.32 I

MATLAB release MATLAB 7.1.0 (R14SP3)
Zip File Content  
Other Files frac_decomp.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
07 Jul 2009 xianfa zeng

Well, I didn't take into account the case that the fraction is nonproper. But you can do it by yourself.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
partial fraction decomposition xianfa zeng 06 Jul 2009 11:33:45
control xianfa zeng 06 Jul 2009 11:33:45
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com