Odebox: A Toolbox For Ordinary Differential Equations Boundary Value Problem: Example 1
Odebox: A Toolbox For Ordinary Differential Equations Boundary Value Problem: Example 1
Odebox: A Toolbox For Ordinary Differential Equations Boundary Value Problem: Example 1
Contents
1 Boundary Value Problem 1
1
ẏ(0) = 0 y··· (1) = 0
Figure 1: Schematic of the cantilever with additional support being considered in this example.
2
5 Define Constraints and Generate the Admissible Func-
tions
Define the constraints
16 c1 = zeros(noPts,1);
17 c1(1) = 1;
Find the node value closest to 0.8, this is only an approximation for demonstration purposes. In
an application requiring high accuracy a node would be placed exactly at 0.8.
18 Tinds = find( x <= 0.8 );
19 cAt = Tinds(end);
20 c2 = zeros(noPts,1);
21 c2(cAt) = 1;
Define the derivative constraints
22 c3 = D(1,:)’;
23 c4 = D2(end,:)’;
24 c5 = D3(end,:)’;
25 %
26 C = [c1,c2,c3,c4,c5];
Generate the constrained basis functions
27 Bc = dopConstrain( C, B );
Truncate the basis functions
28 Bc = Bc(:,1:noBfs );
3
7 Write Some Results to a LATEX file
Write the Rayleigh-Ritz coefficients to a Latex file for documentation purposes
36 M = Vecs(1:10,1:4);
37 Mlatex = matrix2latex( M );
38 writeStringCells2file( Mlatex, ’coeffs.tex’ );
0.1
0.05
y(x)a,i
−0.05
−0.1
0 0.2 0.4 0.6 0.8 1
x
4
60 fig2 = figure;
61 plot(x, S(:,1), ’k’);
62 hold on;
63 plot(x, S(:,2), ’k-.’);
64 plot(x, S(:,3), ’k--’);
65 % plot(x, S(:,4), ’k’);
66 grid on;
67 range = axis;
68 plot( [x(cAt), x(cAt)], range(3:4), ’k’);
69 xlabel(’x’);
70 ylabel(’y(x)_{a,i}’);
0.15
0.1
0.05
y(x)a,i
−0.05
−0.1
0 0.2 0.4 0.6 0.8 1
x