Severity: Warning
Message: fopen(/home/polpe/.phpsession/ci_session6a06a4814cc0fd4a5c0561aa24375532ab261589): failed to open stream: No space left on device
Filename: drivers/Session_files_driver.php
Line Number: 159
Backtrace:
File: /home/polpe/public_html/application/controllers/Main.php
Line: 17
Function: library
File: /home/polpe/public_html/index.php
Line: 315
Function: require_once
TELJES MATLAB SCRIPT KIEGÉSZÍTŐ FÜGGVÉNYEKKEL
file: d2017_09_14_gyak1.m author: Peter Polcz <ppolcz@gmail.com>
Created on 2017. September 16.
┌d2017_09_14_gyak1 │ - Persistence for `d2017_09_14_gyak1` reused (inherited) [run ID: 4948, 2017.09.16. Saturday, 15:21:54] │ - Script `d2017_09_14_gyak1` backuped
Szimbolikus valtozok letrehozasa
syms t s real
Szimbolikus kifejezesek szorzatainak felbontasa
expand((t+1)^2)
ans = t^2 + 2*t + 1
Szimbolikus fuggveny letrehozasa
f(t) = sin(3*t) + 2 + 3*s;
Szimbolikus kifejezes letrehozasa
g = 4*cos(3*t) + 2 + s^2;
Szimbolikus fuggveny kiertekelese adott pontban
f(1) % t <-- 1
ans = 3*s + sin(3) + 2
Szimbolikus kifejezes kiertekelese adott pontban
subs(g,t,1)
ans = s^2 + 4*cos(3) + 2
Szimbolikus fuggveny/kifejezes derivalasa
diff(f)
ans(t) = 3*cos(3*t)
Szimulikus kifejezes hatarozatlan integralja egy valtozo szerint
int(f,t)
ans(t) = 2*t - cos(3*t)/3 + 3*s*t
Szimulikus kifejezes hatarozott integralja egy valtozo szerint. Pl. $\int_0^1 f(t,s) \mathrm{d}t$
int(f,t,0,1)
ans = 3*s - cos(3)/3 + 7/3
Szimbolikus fuggveny/kifejezes derivalasa s szerint
diff(f,s)
diff(g,s)
ans(t) = 3 ans = 2*s
Paraméter
syms a real
f = sin(3*t) + 2 + exp(-4*t) + exp(-a*t)*sin(t);
F = laplace(f,t,s);
pretty(F)
1 1 3 2 ----- + ------------ + ------ + - s + 4 2 2 s (a + s) + 1 s + 9
Inverz transzformáció
syms R C real
H(s) = s/(s*R + 1/C)
h(t) = ilaplace(H,s,t)
pretty(h)
H(s) = s/(R*s + 1/C) h(t) = dirac(t)/R - exp(-t/(C*R))/(C*R^2) / t \ exp| - --- | dirac(t) \ C R / -------- - ------------ R 2 C R
Egy nagyon elvetemült függvény
H = (s^2 + 5*s + 7) / (s^7 + s^2 + 2*s + 1);
pretty(H)
help sym/partfrac
H_partfrac = partfrac(H,s,'factormode','complex')
H_vpa = vpa(H_partfrac,2)
disp('H(s) = ')
pretty(H_vpa)
2 s + 5 s + 7 ----------------- 7 2 s + s + 2 s + 1 PARTFRAC Partial fraction decomposition. PARTFRAC(F, X), where F is a rational function in X, returns the partial fraction decomposition of F. The denominator is factored over the rationals. If x is not given then it is determined using SYMVAR. PARTFRAC(F, X, 'FACTORMODE', MODE) uses the factorization mode MODE to factor the denominator. Possible factorization modes are 'rational'(default), 'real', 'complex', and 'full'. See FACTOR for details. In full mode, the result can also be a symbolic sum ranging over the roots of the denominator. Examples: partfrac(1/(x^2 + x), x) returns 1/x - 1/(x+1) partfrac(1/(x^2 + x + 1), x, 'FactorMode', 'full') returns - (3^(1/2)*1i)/(3*(x - (3^(1/2)*1i)/2 + 1/2)) + (3^(1/2)*1i)/(3*(x + (3^(1/2)*1i)/2 + 1/2)) See also SYM/FACTOR, SYM/SIMPLIFYFRACTION. H_partfrac = (- 0.32270280751035776003772966614116 + 1.413924711271345340490620232093i)/(s + 0.6999571751005907727532107980535 + 0.48593229028651428604616692679117i) + (- 0.32270280751035776003772966614116 - 1.413924711271345340490620232093i)/(s + 0.6999571751005907727532107980535 - 0.48593229028651428604616692679117i) + (- 0.59384831282075522573117593742214 + 0.19579475391242410405854456578991i)/(s - 1.0741448302011052863629514808799 + 0.6346129136683528778466053725399i) + (- 0.45160745977862704320065693696877 - 0.49644356498450036858787474108365i)/(s + 0.021527797673323922542404047107598 - 1.119850355377281321873827505792i) + (2.7363171602194800579391250810641 + 6.3129380067080851518680765608996e-40i)/(s + 0.70531971485438118213467327143752) + (- 0.59384831282075522573117593742214 - 0.19579475391242410405854456578991i)/(s - 1.0741448302011052863629514808799 - 0.6346129136683528778466053725399i) + (- 0.45160745977862704320065693696877 + 0.49644356498450036858787474108365i)/(s + 0.021527797673323922542404047107598 + 1.119850355377281321873827505792i) H_vpa = (- 0.32 + 1.4i)/(s + 0.7 + 0.49i) + (- 0.32 - 1.4i)/(s + 0.7 - 0.49i) + (- 0.59 + 0.2i)/(s - 1.1 + 0.63i) + (- 0.45 - 0.5i)/(s + 0.022 - 1.1i) + (2.7 + 6.3e-40i)/(s + 0.71) + (- 0.59 - 0.2i)/(s - 1.1 - 0.63i) + (- 0.45 + 0.5i)/(s + 0.022 + 1.1i) H(s) = - 0.32 + 1.4i - 0.32 - 1.4i - 0.59 + 0.2i - 0.45 - 0.5i --------------- + --------------- + --------------- + ---------------- s + 0.7 + 0.49i s + 0.7 - 0.49i s - 1.1 + 0.63i s + 0.022 - 1.1i -40 2.7 + 6.3 10 - 0.59 - 0.2i - 0.45 + 0.5i + --------------- + --------------- + ---------------- s + 0.71 s - 1.1 - 0.63i s + 0.022 + 1.1i
Egy szép függvény parciális törtekre bontása
H1 = 1 / (s^2 + 3*s + 2);
H2 = partfrac(H1,s);
pretty(H1 == H2)
1 1 1 ------------ == ----- - ----- 2 s + 1 s + 2 s + 3 s + 2
Komplex parciális törtekre bontás
H1 = 1 / (s^2 + 2*s + 2);
H2 = partfrac(H1,s,'factormode','complex');
pretty(H1 == H2)
1 0.5i 0.5i ------------ == - -------------- + -------------- 2 s + 1.0 - 1.0i s + 1.0 + 1.0i s + 2 s + 2
Factormode: rational [default]
H1 = (s^2 + 1) / expand((s^2 + 3*s + 2) * (s+4) * (s^2 + 2*s + 2));
H2 = partfrac(H1,s,'factormode','rational');
pretty(H1 == H2)
2 s + 1 2 5 17 ------------------------------------- == --------- - --------- + ---------- 5 4 3 2 3 (s + 1) 4 (s + 2) 60 (s + 4) s + 9 s + 30 s + 50 s + 44 s + 16 3 s 1 --- - -- 10 10 + ------------ 2 s + 2 s + 2
Factormode: complex
H2 = sym(partfrac(H1,s,'factormode','complex'));
pretty(H1 == H2)
2 s + 1 0.15 + 0.2i ------------------------------------- == -------------- 5 4 3 2 s + 1.0 - 1.0i s + 9 s + 30 s + 50 s + 44 s + 16 0.66666666666666666666666666666667 1.25 + ---------------------------------- - ------- s + 1.0 s + 2.0 0.28333333333333333333333333333333 0.15 - 0.2i + ---------------------------------- + -------------- s + 4.0 s + 1.0 + 1.0i
Factormode: full
H2 = sym(partfrac(H1,s,'factormode','full'));
pretty(H1 == H2)
2 s + 1 2 5 17 ------------------------------------- == --------- - --------- + ---------- 5 4 3 2 3 (s + 1) 4 (s + 2) 60 (s + 4) s + 9 s + 30 s + 50 s + 44 s + 16 3 1 3 1 -- + -i -- - -i 20 5 20 5 + --------- + ---------- s + 1 - i s + 1 + 1i
Alakítsuk át a szimbolikus kifejezést numerikussá. Számláló nevező szétválasztása:
[num,den] = numden(H1)
num = s^2 + 1 den = s^5 + 9*s^4 + 30*s^3 + 50*s^2 + 44*s + 16
Polinomok nimerikus reprezentációja.
$$\frac{B(s)}{A(s)} = \frac{r_1}{s - p_1} + \frac{r_2}{s - p_2} + ... + \frac{r_n}{s - p_n} + K(s) $$
B = sym2poly(num)
A = sym2poly(den)
B = 1 0 1 A = 1 9 30 50 44 16
Numerikus parciális törtekre bontás:
[r,p,k] = residue(B,A)
r = 0.2833 + 0.0000i -1.2500 + 0.0000i 0.1500 + 0.2000i 0.1500 - 0.2000i 0.6667 + 0.0000i p = -4.0000 + 0.0000i -2.0000 + 0.0000i -1.0000 + 1.0000i -1.0000 - 1.0000i -1.0000 + 0.0000i k = []
End of the script.
└ 2.636 [sec]