<!DOCTYPE html>
<html>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" type="text/css" href="{{ css_style_sheet }}" />
    <link rel="stylesheet" type="text/css" href="{{ table_style }}" />
    <link rel="stylesheet" type="text/css" href="{{ custom_style }}" />
    <head>
        <title>{{ run_name }}FitBenchmarking Fitting Report</title>
    </head>
    <body>
        <div class="wrapper">
            <div class="content">
                <div class="post-title">
                    <h1>{{ title }}</h1>
                    <hr>
                </div>
                <p>{{ description }}</p>
                <hr>
                <section class="accordion">
                    <input type="checkbox" name="collapse" id="start-accordion" checked="checked">
                    <h2 class="handle">
                        <label for="start-accordion">Problem Outline</label>
                    </h2>
                    <div class="content">
                        <p><em>Number of parameters</em>: {{ n_params }}</p>
                        <p><em>Number of data points</em>: {{ n_data_points }}</p>
                        <p><em>Functions</em>:</p>
                        <table>
                            <colgroup>
                                <col width="45%" />
                                <col width="55%" />
                            </colgroup>
                            <thead valign="bottom">
                                <tr>
                                    <th class="head">Form</th>
                                    <th class="head">Parameters</th>
                                </tr>
                            </thead>
                            <tbody valign="top">
                                <tr>
                                    <td>{{ equation }}</td>
                                    <td>{{ initial_guess }}</td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="row">
                            {% if initial_plot_available %}
                                <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ initial_plot }}"></iframe>
                            {% else %}
                                <h3>{{ initial_plot }}</h3>
                            {% endif %}
                        </div>
                    </div>
                </section>
            <section class="accordion">
                <input type="checkbox" name="collapse" id="fitting-results-accordion" checked="checked">
                <h2 class="handle">
                    <label for="fitting-results-accordion">Fitting Results</label>
                </h2>
                <div class="content">
                    {% if is_best_fit %}
                        <p><b>This is the best fit of the minimizers used.</b></p>
                    {% endif %}
                    <p><em>Minimizer</em>: {{ minimizer }}</p>
                    <p><em>Accuracy</em>: {{ accuracy }}</p>
                    <p><em>Runtime</em>: {{ runtime }} seconds</p>
                    <p><em>Emissions</em>: {{ emissions }} kg CO<sub>2</sub>eq</p>
                    <p><em>Functions</em>:</p>
                    <table>
                        <colgroup>
                            <col width="36%" />
                            <col width="64%" />
                        </colgroup>
                        <thead valign="bottom">
                            <tr><th class="head">Form</th>
                            <th class="head">Parameters</th>
                        </thead>
                        <tbody valign="top">
                            <tr>
                                <td>{{ equation }}</td>
                                <td>{{ min_params }}</td>
                            </tr>
                        </tbody>
                    </table>
                    <div align="center" class="figure align-center">
                        {% if fitted_plot_available %}
                            <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ fitted_plot }}"></iframe>
                        {% else %}
                            <h3>{{ fitted_plot }}</h3>
                        {% endif %}
                        {% if pdf_plot_available %}
                            <h3>Estimated posterior pdf of each parameter</h3>
                            <p>
                                The vertical red line on each pdf shows the Scipy curve fit parameter estimate, with the dashed vertical red lines indicating the 2 sigma error of the fit.
                                The area between the dashed lines is used to calculate the confidence in the MCMC fit.
                            </p>
                            <iframe width="100%" height="800" frameborder="0" seamless="seamless" scrolling="no" src="{{ pdf_plot }}"></iframe>
                        {% else %}
                            <h3>{{ pdf_plot }}</h3>
                        {% endif %}
                        <button class="btn default" onclick="history.go(-1)">
                        <i class="fa fa-arrow-left"></i>
                        </button>
                    </div>
                </div>
            </section>
        </div>
    </body>
</html>
