Skip to content

Commit

Permalink
deploy: af058ec
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierr committed Dec 18, 2024
1 parent a591122 commit d6432e7
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 25 deletions.
Binary file modified _images/runProtonicMembrane_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/runProtonicMembrane_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions _sources/publishedExamples/runProtonicMembrane.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,22 @@ Plot of the conductivity

Evolution of the Faradic efficiency
===================================

We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency.
We sample the current value from 0 to 1 A/cm^2
We sample the current value from 0 to 1 A/cm^2.

.. code-block:: matlab
Is = linspace(0, 1*ampere/((centi*meter)^2), 20);
We run the simulation for each current value and collect the results in the :code:`endstates`
We run the simulation for each current value and collect the results in the :code:`endstates`.

.. code-block:: matlab
endstates = {};
for iI = 1 : numel(Is)
model.Control.I = Is(iI);
[~, states, report] = simulateScheduleAD(state0, model, schedule, 'NonLinearSolver', nls);
[~, states, report] = simulateScheduleAD(state0, model, schedule);
state = states{end};
state = model.addVariables(state, schedule.control);
Expand Down
14 changes: 6 additions & 8 deletions _sources/publishedExamples/runProtonicMembrane_source.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Source code for runProtonicMembrane
% We setup the initial state using a default setup included in the model
state0 = model.setupInitialState();
%% Schedule schedule
%% Schedule
% We setup the schedule, which means the timesteps and also the control we want to use. In this case we use current
% control and the current equal to zero (see here :battmofile:`here<ProtonicMembrane/protonicMembrane.json#86>`).
%
Expand Down Expand Up @@ -119,24 +119,22 @@ Source code for runProtonicMembrane
xlabel('x / m')
xlabel('log(\sigma/Siemens)')
%% Evolution of Faradic efficiency
% We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency
%% Evolution of the Faradic efficiency
% We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency.
%
%%
% We sample the current value from 0 to 1 A/cm^2
% We sample the current value from 0 to 1 A/cm^2.
%
Is = linspace(0, 1*ampere/((centi*meter)^2), 20);
%%
% We run the simulation for each current value and collect the results in the :code:`endstates`
% We run the simulation for each current value and collect the results in the :code:`endstates`.
%
endstates = {};
for iI = 1 : numel(Is)
model.Control.I = Is(iI);
[~, states, report] = simulateScheduleAD(state0, model, schedule, 'NonLinearSolver', nls);
[~, states, report] = simulateScheduleAD(state0, model, schedule);
state = states{end};
state = model.addVariables(state, schedule.control);
Expand Down
2 changes: 1 addition & 1 deletion intermediate.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h2>File links and insertions with <code class="code docutils literal notranslat
<p>the <code class="code docutils literal notranslate"><span class="pre">jsonstruct</span></code> that is obtained is equivalent to the one where we would have copied and paste the content of
<a class="reference external" href="https://github.com/BattMoTeam/BattMo/blob/dev/ParameterData/MaterialProperties/Graphite/graphite.json">graphite.json</a>.</p>
<div class="sphinx_collapse docutils">
<input class="sphinx_collapse__input" id="5e1f5ef7-7fb0-4d51-ae4f-a3d9127e0739" name="5e1f5ef7-7fb0-4d51-ae4f-a3d9127e0739" type="checkbox"><label class="sphinx_collapse__label" for="5e1f5ef7-7fb0-4d51-ae4f-a3d9127e0739"><i class="sphinx_collapse__icon"></i>jsonstruct detail</label><div class="sphinx_collapse__content docutils">
<input class="sphinx_collapse__input" id="d04ac226-103c-4e0c-a65b-dad02fe5a5dc" name="d04ac226-103c-4e0c-a65b-dad02fe5a5dc" type="checkbox"><label class="sphinx_collapse__label" for="d04ac226-103c-4e0c-a65b-dad02fe5a5dc"><i class="sphinx_collapse__icon"></i>jsonstruct detail</label><div class="sphinx_collapse__content docutils">
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="nt">&quot;NegativeElectrode&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Coating&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;ActiveMaterial&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
Expand Down
6 changes: 3 additions & 3 deletions publishedExamples/runProtonicMembrane.html
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,16 @@ <h2>Plotting<a class="headerlink" href="#plotting" title="Permalink to this head
<section id="evolution-of-the-faradic-efficiency">
<h2>Evolution of the Faradic efficiency<a class="headerlink" href="#evolution-of-the-faradic-efficiency" title="Permalink to this heading"></a></h2>
<p>We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency.
We sample the current value from 0 to 1 A/cm^2</p>
We sample the current value from 0 to 1 A/cm^2.</p>
<div class="highlight-matlab notranslate"><div class="highlight"><pre><span></span><span class="n">Is</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="n">ampere</span><span class="o">/</span><span class="p">((</span><span class="n">centi</span><span class="o">*</span><span class="n">meter</span><span class="p">)</span>^<span class="mi">2</span><span class="p">),</span><span class="w"> </span><span class="mi">20</span><span class="p">);</span>
</pre></div>
</div>
<p>We run the simulation for each current value and collect the results in the <code class="code docutils literal notranslate"><span class="pre">endstates</span></code></p>
<p>We run the simulation for each current value and collect the results in the <code class="code docutils literal notranslate"><span class="pre">endstates</span></code>.</p>
<div class="highlight-matlab notranslate"><div class="highlight"><pre><span></span><span class="n">endstates</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">{};</span>
<span class="k">for</span><span class="w"> </span><span class="n">iI</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nb">numel</span><span class="p">(</span><span class="n">Is</span><span class="p">)</span>

<span class="w"> </span><span class="n">model</span><span class="p">.</span><span class="n">Control</span><span class="p">.</span><span class="n">I</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">Is</span><span class="p">(</span><span class="n">iI</span><span class="p">);</span>
<span class="w"> </span><span class="p">[</span><span class="o">~</span><span class="p">,</span><span class="w"> </span><span class="n">states</span><span class="p">,</span><span class="w"> </span><span class="n">report</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">simulateScheduleAD</span><span class="p">(</span><span class="n">state0</span><span class="p">,</span><span class="w"> </span><span class="n">model</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">,</span><span class="w"> </span><span class="s">&#39;NonLinearSolver&#39;</span><span class="p">,</span><span class="w"> </span><span class="n">nls</span><span class="p">);</span>
<span class="w"> </span><span class="p">[</span><span class="o">~</span><span class="p">,</span><span class="w"> </span><span class="n">states</span><span class="p">,</span><span class="w"> </span><span class="n">report</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">simulateScheduleAD</span><span class="p">(</span><span class="n">state0</span><span class="p">,</span><span class="w"> </span><span class="n">model</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">);</span>

<span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">states</span><span class="p">{</span><span class="k">end</span><span class="p">};</span>
<span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">model</span><span class="p">.</span><span class="n">addVariables</span><span class="p">(</span><span class="n">state</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">.</span><span class="n">control</span><span class="p">);</span>
Expand Down
14 changes: 6 additions & 8 deletions publishedExamples/runProtonicMembrane_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
<span class="c">% We setup the initial state using a default setup included in the model</span>
<span class="n">state0</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">model</span><span class="p">.</span><span class="n">setupInitialState</span><span class="p">();</span>

<span class="c">%% Schedule schedule</span>
<span class="c">%% Schedule</span>
<span class="c">% We setup the schedule, which means the timesteps and also the control we want to use. In this case we use current</span>
<span class="c">% control and the current equal to zero (see here :battmofile:`here&lt;ProtonicMembrane/protonicMembrane.json#86&gt;`).</span>
<span class="c">%</span>
Expand Down Expand Up @@ -347,24 +347,22 @@
<span class="nb">xlabel</span><span class="p">(</span><span class="s">&#39;x / m&#39;</span><span class="p">)</span>
<span class="nb">xlabel</span><span class="p">(</span><span class="s">&#39;log(\sigma/Siemens)&#39;</span><span class="p">)</span>

<span class="c">%% Evolution of Faradic efficiency</span>
<span class="c">% We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency</span>
<span class="c">%% Evolution of the Faradic efficiency</span>
<span class="c">% We increase the current density from 0 to 1 A/cm^2 and plot the faraday efficiency.</span>
<span class="c">%</span>

<span class="c">%%</span>
<span class="c">% We sample the current value from 0 to 1 A/cm^2</span>
<span class="c">% We sample the current value from 0 to 1 A/cm^2.</span>
<span class="c">%</span>

<span class="n">Is</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="n">ampere</span><span class="o">/</span><span class="p">((</span><span class="n">centi</span><span class="o">*</span><span class="n">meter</span><span class="p">)</span>^<span class="mi">2</span><span class="p">),</span><span class="w"> </span><span class="mi">20</span><span class="p">);</span>

<span class="c">%%</span>
<span class="c">% We run the simulation for each current value and collect the results in the :code:`endstates`</span>
<span class="c">% We run the simulation for each current value and collect the results in the :code:`endstates`.</span>
<span class="c">%</span>
<span class="n">endstates</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="p">{};</span>
<span class="k">for</span><span class="w"> </span><span class="n">iI</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nb">numel</span><span class="p">(</span><span class="n">Is</span><span class="p">)</span>

<span class="w"> </span><span class="n">model</span><span class="p">.</span><span class="n">Control</span><span class="p">.</span><span class="n">I</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">Is</span><span class="p">(</span><span class="n">iI</span><span class="p">);</span>
<span class="w"> </span><span class="p">[</span><span class="o">~</span><span class="p">,</span><span class="w"> </span><span class="n">states</span><span class="p">,</span><span class="w"> </span><span class="n">report</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">simulateScheduleAD</span><span class="p">(</span><span class="n">state0</span><span class="p">,</span><span class="w"> </span><span class="n">model</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">,</span><span class="w"> </span><span class="s">&#39;NonLinearSolver&#39;</span><span class="p">,</span><span class="w"> </span><span class="n">nls</span><span class="p">);</span>
<span class="w"> </span><span class="p">[</span><span class="o">~</span><span class="p">,</span><span class="w"> </span><span class="n">states</span><span class="p">,</span><span class="w"> </span><span class="n">report</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">simulateScheduleAD</span><span class="p">(</span><span class="n">state0</span><span class="p">,</span><span class="w"> </span><span class="n">model</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">);</span>

<span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">states</span><span class="p">{</span><span class="k">end</span><span class="p">};</span>
<span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">model</span><span class="p">.</span><span class="n">addVariables</span><span class="p">(</span><span class="n">state</span><span class="p">,</span><span class="w"> </span><span class="n">schedule</span><span class="p">.</span><span class="n">control</span><span class="p">);</span>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit d6432e7

Please sign in to comment.