Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > restart;
- > eq := diff(u(x, t), x, x)-(diff(u(x, t), t, t))/v^2 = 0;
- print(`output redirected...`); # input placeholder
- d / d \
- --- |--- u(x, t)|
- / d / d \\ dt \ dt /
- |--- |--- u(x, t)|| - ----------------- = 0
- \ dx \ dx // 2
- v
- > phi1(x) := piecewise(0<=x and x<l-epsilon, 0, l-epsilon <=x and x<=l, P/rho/epsilon/S); ;
- print(`output redirected...`); # input placeholder
- /
- x -> piecewise|0 <= x and x < l - epsilon, 0,
- \
- P \
- l - epsilon <= x and x <= l, -------------|
- rho epsilon S/
- > phi2(x) := 2*P/rho/S*Dirac(l-x);
- print(`output redirected...`); # input placeholder
- 2 P Dirac(l - x)
- x -> ----------------
- rho S
- > subs(u(x, t) = X(x)*T(t), eq); expand(lhs(%)/(X(x)*T(t))) = 0;
- print(`output redirected...`); # input placeholder
- d / d \ d / d \
- --- |--- X(x)| --- |--- T(t)|
- dx \ dx / dt \ dt /
- -------------- - -------------- = 0
- X(x) 2
- T(t) v
- > s1 := op(1, lhs(%)) = -lambda^2; s2 := op(2, lhs(`%%`)) = lambda^2;
- print(`output redirected...`); # input placeholder
- d / d \
- --- |--- X(x)|
- dx \ dx / 2
- -------------- = -lambda
- X(x)
- d / d \
- --- |--- T(t)|
- dt \ dt / 2
- - -------------- = lambda
- 2
- T(t) v
- > dsolve(s1, X(x));
- print(`output redirected...`); # input placeholder
- X(x) = _C1 sin(lambda x) + _C2 cos(lambda x)
- > subs(coeff(rhs(%), sin(lambda*x)) = A, coeff(rhs(%), cos(lambda*x)) = B, %);
- print(`output redirected...`); # input placeholder
- X(x) = A sin(lambda x) + B cos(lambda x)
- > X := unapply(rhs(%), x);
- > {X(0) = 0, (D(X))(l) = 0};
- print(`output redirected...`); # input placeholder
- {B = 0, A cos(lambda l) lambda - B sin(lambda l) lambda = 0}
- > M := linalg[genmatrix](%, {A, B});
- print(`output redirected...`); # input placeholder
- > Delta := linalg[det](M);
- print(`output redirected...`); # input placeholder
- -cos(lambda l) lambda
- > _EnvAllSolutions := true; solve(Delta = 0, lambda);
- print(`output redirected...`); # input placeholder
- Pi (1 + 2 _Z1)
- 0, --------------
- 2 l
- > `minus`(indets(%[2]), {l});
- %;
- {_Z1}
- > subs(%[1] = 'k', `%%`[2]); lambda := unapply(%, k);
- print(`output redirected...`); # input placeholder
- Pi (1 + 2 k)
- k -> ------------
- 2 l
- > X[k](x) := subs({lambda=lambda(k), B=0}, X(x)); ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement