next up previous contents
Nächste Seite: Weitergehende Beispielprogramme Aufwärts: Lösungshinweise Vorherige Seite: Lösungshinweise zum Kapitel 7   Inhalt


Lösungshinweise zum Kapitel 8

Termumformungen

 

80-1 syms a b c;b2= (a+b+c)^2;b3=(a+b+c)^3;b4=(a+b+c)^4
factor(a^2+b^2+c^2+2*a*b+2*a*c+2*b*c)

80-2 syms u v;
sin(u+v) - (sin(u)*cos(v)+cos(u)*sin(v))

80-3 syms w real; scp = (cos(w)+j*sin(w))^3
scpe = expand(scp); scr = real(scpe); sci = imag(scpe); expand(sci)

Lösen von Gleichungen

 

80-4 syms x A B C p q; s1=solve(x^2+C)
s2 = solve(x^2+B*x); s3 = solve(x^2+p*x+q) ; s4 = solve(A*x^2+B*x+C)

80-5 syms x A B C; s4 = solve(A*x^2+B*x+C);
x1 = s4(1); x2 = s4(2); gl = (x-x1)*(x-x2)

80-6 syms x; syms p q r real;
cardano = solve(x^3 + p*x^2+q*x+r) ; pretty(cardano)

Fourier- und Laplace-Theorie

 

80-7

% dftcomp -  analytische Fourierkoeffizienten, gerade Funktion
%   Vergleich mit DFT verschiedener Aufloesung
syms t
for k=0:40
  a(k+1) = 1/pi* double(int(cos(k*t),-pi/3,pi/3));
  b(k+1) = 1/pi* double(int(sin(k*t),-pi/3,pi/3));
end
pw = a.^2; col= ['r','g','b','m']; a
plot(pw(2:11),'k'); hold on
for lev = 1:4
  ad = zeros(1,200);   lh = 5*2^(lev-1)
  f = [1, ones(1,lh), zeros(1,4*lh+1) ones(1,lh) ];
  abd = fft(f); ad(1:length(f)) = real(abd)*2/length(f);
  bd(1:length(f)) = -imag(abd)*2/length(f);
  ad(1:41)
  pwd = ad.^2;  plot(pwd(2:11),col(lev))
end   ; hold off

Lösungen zum Selbsttest

 

T811x=sym('x')  - simple(), simplify(), expand()
  -  Die Gleichungen werden durch Komma getrennt und in Apostroph gesetzt, falls sie nicht schon in der Form $ F(x,y,z)=0$ sind.
  - vpa( symexpression , 200 )

T812 vpa( exp( sym('1') ), 200 )

T813 syms d w y t
osol = dsolve('D2y+Dy*d+y*w^2','y(0)=1','Dy(0)=0');
pretty(simple(ans))
liefert die Diskriminante (Inhalt der Wurzel) $ d^2-4w^2$, also ergibt sich die kritisch gedämpfte Zeitfunktion als
dmps = dsolve('D2y+Dy*2*w+y*w^2','y(0)=1','Dy(0)=0');
( subs(osol,d,2*w) führt auf eine Fehlermeldung, weil die Diskriminate in der analytischen Lösung auch im Nenner vorkommt.)

T814 syms b h x y; Tx=int(h*x^2,-b/2,b/2) ;
Ty=int(b*y^2,-h/2,h/2) ;

T815 syms x y; f = [ x^2+y^2-3 ; x^2-y^2-1]; jacobian(f)



Unterabschnitte

Stefan Adam 2006-03-07