-
Abhishek Kumar | {new Date().getFullYear()}
+
+
+
+
+
Abhishek Kumar | {new Date().getFullYear()}
+
-
-
)
}
diff --git a/src/main.jsx b/src/main.jsx
index b469504..e3e0f19 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -18,7 +18,7 @@ import Week7 from "./pages/Week7.jsx";
import Week9 from "./pages/Week9.jsx";
import Week10 from "./pages/Week10.jsx";
import Week11 from "./pages/Week11.jsx";
-import Week12 from "./pages/Week12.jsx";
+
const router = createBrowserRouter([
{
@@ -74,13 +74,9 @@ const router = createBrowserRouter([
element:
,
},
{
- path: "/gsoc24-blog/week11",
+ path: "/gsoc24-blog/week11-12",
element:
,
- },
- {
- path: "/gsoc24-blog/week12",
- element:
,
- },
+ }
]);
ReactDOM.createRoot(document.getElementById("root")).render(
diff --git a/src/pages/Week11.jsx b/src/pages/Week11.jsx
index f72cbe7..0be285f 100644
--- a/src/pages/Week11.jsx
+++ b/src/pages/Week11.jsx
@@ -1,10 +1,94 @@
-import React from 'react'
-import Navbar from '../Navbar'
-import Anchors from '../assets/Anchors'
-import { Divider, Typography } from 'antd';
-const { Title, Paragraph, Text, Link } = Typography;
+import { Divider, Image, Typography } from "antd";
+import { FaCodePullRequest } from "react-icons/fa6";
+import Navbar from "../Navbar";
+import Anchors from "../assets/Anchors";
+import Footer from "../assets/Footer";
+const { Title, Paragraph } = Typography;
const Week11 = () => {
+ const code1 =
+ `
+ >>> from sympy import symbols, Matrix
+ >>> from sympy.physics.control import *
+ >>> m, k, b = symbols('m k b')
+ >>> A = Matrix([[0, 1], [-k/m, -b/m]])
+ >>> B = Matrix([[0], [1/m]])
+ >>> C = Matrix([[1, 0]])
+ >>> D = Matrix([[0]])
+ >>> ss = StateSpace(A, B, C, D)
+ >>> ss
+ StateSpace(Matrix([
+ [ 0, 1],
+ [-k/m, -b/m]]), Matrix([
+ [ 0],
+ [1/m]]), Matrix([[1, 0]]), Matrix([[0]]))
+ >>> tf = ss.rewrite(TransferFunction)[0][0]
+ >>> tf
+ TransferFunction(1, b*s + k + m*s**2, s)
+`
+ const code2 =
+ `
+ >>> from sympy import symbols, Matrix
+ >>> from sympy.physics.control import StateSpace
+ >>> K_r, J1, J2, B_r1, B_r2, x2 = symbols('K_r J1 J2 B_r1 B_r2 x2')
+ >>> A = Matrix([[0, 1, 0], [-K_r/J1, -B_r1/J1, B_r1/J1], [0, B_r1/J2 * x2, - (B_r2 + B_r1)/J2]])
+ >>> B = Matrix([[0], [-1/J1], [0]])
+ >>> C = Matrix([[1, 0, 0]])
+ >>> ss = StateSpace(A, B, C)
+ >>> ss
+ StateSpace(Matrix([
+ [ 0, 1, 0],
+ [-K_r/J1, -B_r1/J1, B_r1/J1],
+ [ 0, B_r1*x2/J2, (-B_r1 - B_r2)/J2]]), Matrix([
+ [ 0],
+ [-1/J1],
+ [ 0]]), Matrix([[1, 0, 0]]), Matrix([[0]]))
+`
+ const code3 =
+`
+ >>> from sympy import Matrix, symbols, pprint
+ >>> from sympy.physics.control import *
+ >>> R, L, C = symbols('R L C')
+ >>> A = Matrix([[-R/L, -1/L], [1/C, 0]])
+ >>> B = Matrix([[1/L], [0]])
+ >>> C = Matrix([[0, 1]])
+ >>> D = Matrix([[0]])
+ >>> ss = StateSpace(A, B, C, D)
+ >>> ss
+ StateSpace(Matrix([
+ [-R/L, -1/L],
+ [ 1/C, 0]]), Matrix([
+ [1/L],
+ [ 0]]), Matrix([[0, 1]]), Matrix([[0]]))
+
+ We can convert the StateSpace to TransferFunction by rewrite method.
+
+ >>> tf = ss.rewrite(TransferFunction)[0][0]
+ >>> tf
+ TransferFunction(1, C*L*s**2 + C*R*s + 1, s)
+`
+ const code4 =
+`
+ >>> from sympy import symbols, Matrix
+ >>> from sympy.physics.control import *
+ >>> R, C = symbols('R C')
+ >>> A = Matrix([[-2/(R*C), 1/(R*C)], [1/(R*C), -1/(R*C)]])
+ >>> B = Matrix([[1/(R*C)], [0]])
+ >>> C = Matrix([[0, 1]])
+ >>> ss = StateSpace(A, B, C)
+ >>> ss
+ StateSpace(Matrix([
+ [-2/(C*R), 1/(C*R)],
+ [ 1/(C*R), -1/(C*R)]]), Matrix([
+ [1/(C*R)],
+ [ 0]]), Matrix([[0, 1]]), Matrix([[0]]))
+`
+
+ const imgLink1 = 'https://private-user-images.githubusercontent.com/140839576/362171513-b3eaa366-2a9f-435e-a3ae-a446eb093723.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjY4MzM2MjAsIm5iZiI6MTcyNjgzMzMyMCwicGF0aCI6Ii8xNDA4Mzk1NzYvMzYyMTcxNTEzLWIzZWFhMzY2LTJhOWYtNDM1ZS1hM2FlLWE0NDZlYjA5MzcyMy5zdmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkyMFQxMTU1MjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMzdkZmQ5NzU3MTZjMzhjNTE3MWE4NjVhNDIxOTgwZGQxMWQwMTQ1YzFhNTQ5OTFjMzVlMTc2NjJhZmFjZDAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AWr9cwU51ZmaPHEB3MX_s9nu7AuhA23ox1e6Q_hJCEs'
+ const imgLink2 = 'https://private-user-images.githubusercontent.com/140839576/363419846-a7acfd1d-df4c-4a52-8ab0-c179a86d3415.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjY4MzQwMTAsIm5iZiI6MTcyNjgzMzcxMCwicGF0aCI6Ii8xNDA4Mzk1NzYvMzYzNDE5ODQ2LWE3YWNmZDFkLWRmNGMtNGE1Mi04YWIwLWMxNzlhODZkMzQxNS5zdmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkyMFQxMjAxNTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMjdiNTA0NDA4OThkYzE4NjRlZGZjNTdiZDgzNGE1Yjc0MDY0NTUzOGU4ZDdiY2MwZTY1YmJkYmEyN2JlODA3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cjdTAw3x7siZ9oaphd9AHt1ZCFkXQZiPrxF_P5PIhLg'
+ const imgLink3 = 'https://raw.githubusercontent.com/abhiphile/sympy/refs/heads/problems-1/doc/src/tutorials/physics/control/Electrical_Problems_Q1.svg'
+ const imgLink4 = 'https://raw.githubusercontent.com/abhiphile/sympy/refs/heads/problems-1/doc/src/tutorials/physics/control/Electrical_Problems_Q2.svg'
+
return (
<>
@@ -13,21 +97,83 @@ const Week11 = () => {
-
>
- )
-}
+ );
+};
-export default Week11
\ No newline at end of file
+export default Week11;
diff --git a/src/pages/Week12.jsx b/src/pages/Week12.jsx
deleted file mode 100644
index c874483..0000000
--- a/src/pages/Week12.jsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react'
-import Navbar from '../Navbar'
-import Anchors from '../assets/Anchors'
-import { Divider, Typography } from 'antd';
-const { Title, Paragraph, Text, Link } = Typography;
-
-const Week12 = () => {
- return (
- <>
-
-
- >
- )
-}
-
-export default Week12
\ No newline at end of file
diff --git a/src/pages/Week15.jsx b/src/pages/Week15.jsx
new file mode 100644
index 0000000..1c46bc6
--- /dev/null
+++ b/src/pages/Week15.jsx
@@ -0,0 +1,68 @@
+import { Divider, Image, Typography } from "antd";
+import { FaCodePullRequest } from "react-icons/fa6";
+import Navbar from "../Navbar";
+import Anchors from "../assets/Anchors";
+import Footer from "../assets/Footer";
+const { Title, Paragraph } = Typography;
+
+const Week15 = () => {
+const code1 = `
+
+`
+const code2 = `
+
+`
+ return (
+ <>
+
+ >
+ );
+};
+
+export default Week15;
diff --git a/src/pages/Week8.jsx b/src/pages/Week8.jsx
deleted file mode 100644
index 86e1d04..0000000
--- a/src/pages/Week8.jsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react'
-import Navbar from '../Navbar'
-import Anchors from '../assets/Anchors'
-import { Divider, Typography } from 'antd';
-const { Title, Paragraph, Text, Link } = Typography;
-
-const Week8 = () => {
- return (
- <>
-