Skip to content

Commit 634fae5

Browse files
committed
Added week 4 blog.
1 parent 7f660fa commit 634fae5

File tree

4 files changed

+110
-11
lines changed

4 files changed

+110
-11
lines changed

package-lock.json

Lines changed: 38 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"dependencies": {
1414
"@ant-design/icons": "^5.3.7",
1515
"antd": "^5.17.0",
16+
"katex": "^0.16.10",
1617
"react": "^18.2.0",
1718
"react-dom": "^18.2.0",
1819
"react-icons": "^5.2.1",
20+
"react-katex": "^3.0.1",
1921
"react-router-dom": "^6.23.0"
2022
},
2123
"devDependencies": {

src/assets/Anchors.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Anchors = () => {
2626
Phase 2
2727
</div>
2828
<div className="ms-3">
29-
<Link to="#link-props" className="nav-link text-dark my-1">
29+
<Link to="/gsoc24-blog/week4" className="nav-link text-primary my-1">
3030
Week 4
3131
</Link>
3232
</div>

src/pages/Week4.jsx

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import React from 'react'
22
import Navbar from '../Navbar'
33
import Anchors from '../assets/Anchors'
44
import { Divider, Typography } from 'antd';
5-
const { Title, Paragraph, Text, Link } = Typography;
5+
import Footer from '../assets/Footer';
6+
import { FaCodePullRequest } from 'react-icons/fa6';
7+
import 'katex/dist/katex.min.css';
8+
import { InlineMath, BlockMath } from 'react-katex';
9+
const { Title, Paragraph} = Typography;
610

711
const Week4 = () => {
12+
const stateEquation = `\\dot{x}(t) = A x(t) + B u(t)`;
13+
const outputEquation = `y(t) = C x(t) + D u(t)`;
814
return (
915
<>
1016
<Navbar />
@@ -13,20 +19,77 @@ const Week4 = () => {
1319
<Anchors />
1420
</div>
1521
<div className="col m-2">
16-
<div className="m-2 border rounded p-2">
22+
<div className="m-2 border rounded p-4">
1723
<Typography>
1824
<Title>
19-
This is the title !
25+
Week 3 : Adding support of symbolic matrices to <code>dsolve()</code> in StateSpace.
2026
</Title>
2127
<Paragraph className='par'>
22-
This is par
28+
During the fourth week of my Google Summer of Code (GSOC) journey, In this week I worked on finding symbolic solutions of StateSpace equations.
29+
<p>State Equation:</p>
30+
<BlockMath math={stateEquation} />
31+
<p>Output Equation:</p>
32+
<BlockMath math={outputEquation} />
33+
</Paragraph>
34+
<Title>
35+
Implementation
36+
</Title>
37+
<Paragraph className='par'>
38+
<h2>Solving State Space Equations in SymPy</h2>
39+
<p>The <code>dsolve</code> method in SymPy solves state space equations of the form:</p>
40+
41+
<BlockMath math={outputEquation} />
42+
<p>Here's a step-by-step breakdown of the <code>dsolve</code> method:</p>
43+
<ul>
44+
<li>
45+
<strong>Validate Input Parameters:</strong>
46+
<ul>
47+
<li>Check if <code>var</code> is a Symbol.</li>
48+
<li>Set default <code>initial_conditions</code> and <code>input_vector</code> if not provided.</li>
49+
<li>Validate the dimensions of <code>initial_conditions</code> and <code>input_vector</code>.</li>
50+
</ul>
51+
</li>
52+
<li>
53+
<strong>Solve the State Equation:</strong>
54+
<ul>
55+
<li>Use <code>linodesolve</code> to solve the state equation <InlineMath math={outputEquation} />.</li>
56+
<li>Convert the solution to a matrix form.</li>
57+
</ul>
58+
</li>
59+
<li>
60+
<strong>Apply Initial Conditions:</strong>
61+
<ul>
62+
<li>Evaluate the solution at <code>t = 0</code>.</li>
63+
<li>Identify and solve for the dummy symbols representing initial conditions.</li>
64+
<li>Replace dummy symbols in the solution with solved values.</li>
65+
</ul>
66+
</li>
67+
<li>
68+
<strong>Compute Output Vector:</strong>
69+
<ul>
70+
<li>Compute the output vector <code>y</code> using the state vector solution and the input vector.</li>
71+
</ul>
72+
</li>
73+
</ul>
74+
<p>This method ensures accurate solutions to state space problems, handling symbolic matrices efficiently.</p>
75+
</Paragraph>
76+
<Title>
77+
Pull Requests
78+
</Title>
79+
<Paragraph className='par'>
80+
<a href='https://github.com/sympy/sympy/pull/26736' className='text-success'><FaCodePullRequest /> (Open) Changed the output_vector to dsolve and added support of symbolic matrices..</a>
81+
<div className='gap-3'>
82+
<Divider />
83+
</div>
84+
Abhishek Kumar
85+
<br />
86+
GSoC Contributor
2387
</Paragraph>
2488
</Typography>
2589
</div>
2690
</div>
27-
<Footer/>
91+
<Footer />
2892
</div>
29-
3093
</>
3194
)
3295
}

0 commit comments

Comments
 (0)