Mercurial > repos > public > sbplib
annotate diags.m @ 774:66eb4a2bbb72 feature/grids
Remove default scaling of the system.
The scaling doens't seem to help actual solutions. One example that fails in the flexural code.
With large timesteps the solutions seems to blow up. One particular example is profilePresentation
on the tdb_presentation_figures branch with k = 0.0005
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 18 Jul 2018 15:42:52 -0700 |
parents | 0b87863cb29c |
children |
rev | line source |
---|---|
412
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 function A = diags(B,d,m,n) |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 assert(size(B,1) == m); |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 A = repmat(B(:,1)*0, [1, n]); |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 for i = 1:size(B,2) |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 A(:,d(i)+ (1:m)) = A(:,d(i)+ (1:m)) + diag(B(:,i)); |
5eb312dfe2ab
Add full matrix equivalent of spdiags
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 end |
413 | 9 end |