Flow Diagram for a numerical algorithm
Författare
Mubarak Imam
Last Updated
för 9 år sedan
Licens
Creative Commons CC BY 4.0
Sammanfattning
Introducing Canonical Polynomial approximation methods for solving singularly perturbed bvps.
Introducing Canonical Polynomial approximation methods for solving singularly perturbed bvps.
\documentclass{article}
\usepackage{tikz,amsmath}
\usetikzlibrary{shapes.geometric, arrows}
\usepackage[paperheight=6.5in,paperwidth=4.8in,margin=0.1in]{geometry}
\tikzstyle{process} = [rectangle, minimum width=3em, minimum height=2em, text centered, draw=blue, fill=gray!10]
\tikzstyle{startend} = [ellipse, minimum width=2em, minimum height=1em, text centered, draw=red, fill=gray!10]
\tikzstyle{arrow} = [thick,->,>=stealth]
\pagestyle{plain}
\begin{document}
\begin{figure}
\centering
\hfill\\
{\scriptsize \begin{tikzpicture}[node distance=2em]
\node (S) [startend] {START};
\node (S1) [process, below of=S, yshift= -2em]{\parbox[t][][t]{10cm}{Put problem in standard form\newline \begin{math}\begin{aligned}
\varepsilon y^{(m)}(x)&+\alpha_1(x)y^{(m-1)}(x)+\alpha_2(x)y^{(m-2)}(x)+\cdots\\
&+\alpha_{m-1}(x)y'(x)+\alpha_m(x)y(x)=f(x), \qquad x\in[a,b]
\end{aligned}\end{math}}};
\node (S2) [process, below of=S1, yshift=-3em]{\parbox[t][][t]{10cm}{Assume an approximate solution $y_n(x)=\sum_{i=0}^nc_nQ_(x)$, where $n$ is the degree of approximation.}};
\node (S3) [process, below of=S2, yshift=-2em]{\parbox[t][][t]{10cm}{Obtain the canonical polynomials using the differential operator from the equation in STEP 1.}};
\node (S4) [process, below of=S3, yshift=-2em]{\parbox[t][][t]{10cm}{Apply the given boundary conditions on the assumed solution in STEP 2 to obtain $(m)$ linear algebraic equations.}};
\node (S5) [process, below of=S4, yshift=-2em]{\parbox[t][][t]{10cm}{Substitute the approximate solution from STEP 2 into the problem in STEP 1.}};
\node (S6) [process, below of=S5, yshift=-4em, xshift = -12em]{\parbox[t][][t]{5cm}{collocate the results from STEP 5 at $x_k=a+\frac{(b-a)k}{N+2-m}$, $k=0(1)N+1-m$ to obtain $(N-m+1)$ algebraic equations.}};
\node (S7) [process, below of=S5, yshift=-3em, xshift = 10em]{\parbox[t][][t]{5cm}{add a small perturbation term $H_n(x)$ into the results from STEP 5.}};
\node (S8) [process, below of=S6, yshift=-5em]{\parbox[t][][t]{5cm}{add the results from STEP 4 and STEP 6 to obtain two sets of $(n+1)$ system of equations.}};
\node (S9) [process, below of=S8, yshift=-4em]{\parbox[t][][t]{5cm}{solve the resulting equations from STEP 7 using the built-in Maple \texttt{solve} command.}};
\node (S10) [process, below of=S9, yshift=-4em]{\parbox[t][][t]{5cm}{Substitute the values of the constant coefficients into the approximate solution in STEP 2 for SCM}};
\node (S11) [process, below of=S7, yshift=-4em]{\parbox[t][][t]{5cm}{collocate the results from STEP 6 at $x_l=a+\frac{(b-a)l}{N+2}$, $l=0(1)N+1$ to obtain $(n+1)$ algebraic equations.}};
\node (S12) [process, below of=S11, yshift=-4em]{\parbox[t][][t]{5cm}{add the results from STEP 4 and STEP 7 to obtain two sets $(n+m+1)$ system of equations.}};
\node (S13) [process, below of=S12, yshift=-4em]{\parbox[t][][t]{5cm}{solve the resulting equations from STEP 8 using the built-in Maple \texttt{solve} command.}};
\node (S14) [process, below of=S13, yshift=-4em]{\parbox[t][][t]{5cm}{Substitute the values of the constant coefficients into the approximate solution in STEP 2 PCM.}};
\node (S15) [startend, below of=S, yshift=-52em]{STOP};
\draw [arrow] (S) -- (S1);
\draw [arrow] (S1) -- (S2);
\draw [arrow] (S2) -- (S3);
\draw [arrow] (S3) -- (S4);
\draw [arrow] (S4) -- (S5);
\draw [arrow] (S5) -- node[anchor=east]{SCM}(S6);
\draw [arrow] (S5) -- node[anchor=west]{PCM}(S7);
\draw [arrow] (S6) -- (S8);
\draw [arrow] (S8) -- (S9);
\draw [arrow] (S9) -- (S10);
\draw [arrow] (S7) -- (S11);
\draw [arrow] (S11) -- (S12);
\draw [arrow] (S12) -- (S13);
\draw [arrow] (S13) -- (S14);
\draw [arrow] (S10) |- (S15);
\draw [arrow] (S14) |- (S15);
\end{tikzpicture}}
\end{figure}
\end{document}