Furtther Maths Assing 1
Furtther Maths Assing 1
Problem Formulation
1. Define Variables:
Let (¿ x 1 ¿) be the number of panels delivered from WH1 to S1.
2. Constraints:
Total panels required at S1 and S2:
x 1
+ ¿ y 1
¿
625
x 2
+ ¿ y 2
¿
900
y 2
¿
550
Non-negativity constraints:
x 1
¿
0
x 2
¿
0
y 1
¿
0
y 2
¿
0
3. Objective Function:
The problem does not specify a particular objective function, so the goal is typically to find a
feasible solution that meets all constraints. In some cases, you might want to minimize the
total transportation or other cost-related metrics if additional information is provided.
Solving the Model
Mathlab code
% Define the coefficients for the constraints in the standard form
% We need to minimize an objective function. Here, we use zero as placeholders.
Conclusion
The solution provides a feasible distribution of solar panels between the two sites considering
the constraints. The key here is ensuring that all constraints are met, including transportation
limits from WH2 and total availability from WH1. By using the linear programming approach,
we can efficiently solve this problem and determine the optimal panel delivery plan.
Task 2
To determine the steady-state temperature distribution on a thin plate where the
temperatures around the boundary are known, we can use the finite difference method to
model the problem mathematically. We will then solve the resulting system of linear equations
manually using matrix methods, and finally, you can verify the solution using commercial
software.
Problem Formulation
(¿
(¿
T
T
,
,
¿ )
1
¿ )
2
3 ¿)
and (¿T 4 ¿ ) be the temperatures at the four interior nodes of the mesh.
,
2. Boundary Conditions:
Suppose the boundary temperatures are known, and these temperatures are used to
compute the values at the interior nodes.
Mathematical Model
(¿ T above ¿ ¿ ¿ 20 ¿ )
(¿T right ¿ ¿ ¿ 30 ¿ )
(¿ T below ¿ ¿ ¿ 40 ¿ )
4
T 1
−¿ T 2
−¿ T 4
¿
30
2. For (¿ T 2¿)
:
4
T 2
−¿ T 1
−¿ T 3
¿
50
3. For (¿ T 3 ¿)
:
4
T 3
−¿ T 2
−¿ T 4
¿
70
4. For (¿ T 4 ¿)
:
4
T 4
−¿ T 1
−¿ T 3
¿
90
Matrix Representation
T
(¿ x ¿¿¿ [ T 1 , T 2 , T 3 , T 4 ] ¿)
T
(¿ b ¿ ¿ ¿ [ 30 ,50 , 70 , 90 ] ¿ )
[ ]
4 −1 0 −1
−1 4 −1 0
0 −1 4 −1
−1 0 −1 4
Solving the System Using Matrix Inversion
To find
( ¿ x ¿ )
,
c
o
m
p
u
t
e
− 1
( ¿ x ¿ ¿ ¿ A ¿ b ¿ )
.
−1
A
¿=¿[ 0.25 0.25 0 −0.25
0.25−¿¿0.5 −1 ¿ ¿
−0.25¿ 0.5¿0.25¿0.25¿ 0¿0.25¿0.25¿ ]
This matrix inversion process involves calculating the determinant and adjugate matrix and
then dividing by the determinant. This can be tedious by hand, so verifying with software is
advisable.
2. Compute (¿ x ¿)
:
x
¿
A− 1
b
To verify the solution using software, you can use MATLAB, Python, or another tool to solve the
linear system. In MATLAB, for instance, you would use the following code:
matlab
% Define the coefficient matrix A and the right-hand side vector b
A = [4, -1, 0, -1; -1, 4, -1, 0; 0, -1, 4, -1; -1, 0, -1, 4];
b = [30; 50; 70; 90];
(¿
(¿
T
T
,
,
¿ )
1
¿ )
2
3 ¿)
and (¿ T 4 ¿)
,
confirming the manually
,
computed values.
nodes can be found by solving the system of equations derived from the finite difference
approximation.
Task 3
To determine the position \(x\) where the deflection \(y(x)\) of the bookshelf is maximum, we'll
use two iterative methods: the bisection method and the Newton-Raphson method. Here is a
step-by-step solution for each method:
1. Bisection Method
The equation to solve is:
−8 −5 −3
[¿−¿ 0.67665 ¿ ¿ ¿ 10 ¿ x ¿ −¿ 0.26689 ¿ ¿ ¿ 10 ¿ x ¿ +¿ 0.12748 ¿ ¿ ¿ 10 ¿ x ¿−¿ 0.018507 ¿ ¿ ¿ 0 ¿ ]
4 3 2
Iteration Steps:
Choose an interval \([a, b]\) where the function changes sign. Let's choose \(a = 0\) and \(b =
29\). We need to check the function values at \(a\) and \(b\):
Calculate
¿ ):
f
( 2 9 )
¿
−¿ 0 . 6 7 6 65
¿
− 8
1 0
¿
2 94
−¿ 0 . 2 6 6 89
¿
− 5
1 0
¿
2 93
+¿ 0 .1 2 74 8
¿
− 3
1 0
¿
2
2 9
−¿ 0. 0 1 8 50 7
Evaluating:
f
( 2 9 )
≈
−¿ 0 . 6 7 66 5
¿
− 8
1 0
¿
70 7 5 8 4 1
−¿ 0 . 2 6 68 9
¿
− 5
1 0
¿
2 4 3 8 9
+¿ 0 .1 2 7 48
¿
− 3
1 0
¿
8 4 1
−¿ 0 . 0 1 8 5 07
f
( 29 )
≈
− ¿ 0.0482
− ¿ 0.6503
+ ¿ 0.1074
− ¿ 0.0185
f
(¿ 29 ¿ )
≈
−¿ 0.6096
)}
newline lbrace newline newline ( newline N newline e newline g newline a newline t newline i newline v newline
Both (¿ f ¿ ( 0 ) ¿ )
a
n
d
are negative, so we need a different interval. We might need to try
(¿ f ¿ ( 29 ) ¿ )
Step 2: Iterate
Let's assume a suitable interval (¿ [ 0 , 15 ] ¿) after checking sign changes (this is an example; you
need to find an actual interval).
1. First Iteration:
Evaluate (¿ f ¿ ( c ) ¿)
:
f
( 7 .5 )
≈
−¿ 0 . 6 7 6 6 5
¿
1 0− 8
¿
7 .54
0 .2 6 6 8 9
¿
1 0− 5
¿
7 .53
+ ¿ 0 .1 27 48
¿
1 0− 3
¿
7 .52
0.0 1 8 5 07
f
( 7.5 )
≈
− ¿ 0.00110 .0007
+ ¿ 0.00710 .018507
f
( 7.5 )
≈
−¿ 0.0122
(Negative)
2. Second Iteration:
Evaluate (¿ f ¿ ( c ) ¿)
:
f
( 11 . 2 5 )
≈
− ¿ 0 . 6 7 6 6 5
¿
− 8
1 0
¿
4
11 . 2 5
0 . 2 6 6 8 9
¿
− 5
1 0
¿
3
11 . 2 5
+ ¿ 0 . 1 2 7 4 8
¿
− 3
1 0
¿
2
11 . 2 5
0. 0 1 8 5 0 7
f
( 11. 25 )
≈
−¿ 0.01340 .0006
+ ¿ 0.01630 .018507
f
( 11.2 5 )
≈
−¿ 0.015 3
(Negati v e)
3. Third Iteration:
Midpoint (¿ c ¿ ¿ ¿ 11.25+ 15 ¿ ¿ ¿ 13.125 ¿ )
2
Evaluate (¿ f ¿ ( c ) ¿)
:
f
( 1 3 . 1 2 5 )
≈
− ¿ 0 . 6 7 6 6 5
¿
− 8
1 0
¿
4
1 3 . 1 2 5
0 . 2 6 6 8 9
¿
− 5
1 0
¿
3
1 3 . 1 2 5
+ ¿ 0 . 1 2 7 4 8
¿
− 3
1 0
¿
2
1 3 . 1 2 5
0 . 0 1 8 5 0 7
f
( 13.125 )
≈
−¿ 0.01630 .0003
+ ¿ 0.02550 .018507
f
( 13.125 )
≈
− ¿ 0.0096
(Negative)
Error
¿
|x new x old
x new |
¿
100
¿ %
2. Newton-Raphson Method
Function:
f
( x )
¿
− ¿ 0 . 6 7 6 6 5
¿
− 8
1 0
4
x
0 . 2 6 6 8 9
¿
− 5
1 0
3
x
+ ¿ 0 . 1 2 7 4 8
¿
− 3
1 0
2
x
0 . 0 1 8 5 0 7
Derivative:
'
f
( x )
¿
−¿ 0 . 6 7 66 5
¿
1 0− 8
¿
4
3
x
0 .2 6 6 8 9
¿
1 0− 5
¿
3
2
x
+ ¿ 0 . 1 2 7 4 8
¿
1 0− 3
¿
2
x
Iteration Formula:
x n+ 1
¿
x n
f ( xn )
'
f ( xn )
1. First Iteration:
Evaluate ( ¿ f ¿ ( x 0 ) ¿ )
'
a
n
d
( ¿ f ¿ ( x0 ) ¿ )
f
( 1 0 )
≈
− ¿ 0 . 6 7 6 6 5
¿
− 8
1 0
¿
4
1 0
− ¿ 0 . 2 6 6 8 9
¿
− 5
1 0
¿
3
1 0
+ ¿ 0 . 1 2 7 4 8
¿
− 3
1 0
¿
2
1 0
− ¿ 0 . 0 1 8 5 0 7
f
( 10 )
≈
− ¿ 0.0068
− ¿ 0.0267
+ ¿ 0.1275
− ¿ 0.018507
f
( 10 )
≈
0.0765
'
f
( 1 0 )
≈
−¿ 0 . 6 7 66 5
¿
1 0− 8
¿
4
¿
1 03
−¿ 0 . 2 6 68 9
¿
1 0− 5
¿
3
¿
1 02
+ ¿ 0 .1 2 7 48
¿
1 0− 3
¿
2
'
f
( 10 )
≈
− ¿ 0. 0 0 2 7
− ¿ 0. 0 0 8 0
+ ¿ 0.000254
f '
( 10 )
≈
−¿ 0.01045
x 1
¿
10
0.0765
−¿
− 0.01045
≈
10
+ ¿ 7.33
≈
17.33
2. Second Iteration:
Update (¿ x 2 ¿)
.
3. Third Iteration:
Error
¿
| x new − x
x new
old
|
¿
100
¿ %
Comparison of Methods
Applicability:
Bisection Method: Suitable when the function is continuous and there is an interval with a sign
change. It is guaranteed to converge if such an interval exists.
Newton-Raphson Method: Requires a good initial guess and the function to be differentiable. It
may converge faster but can diverge if the initial guess is poor or the function's derivative is
zero.
Convergence Rate:
Accuracy:
Bisection Method: Provides guaranteed convergence and is robust but might need many
iterations.
Newton-Raphson Method: More accurate and faster if the initial guess is close to the root but
can be unstable.
Task 4
To estimate the energy stored in a Li-Ion battery cell during the charging process using the
given voltage and current data, follow these steps:
1. Estimate Voltage ( (V ) ) : From the charge curve for the given time.
2. Estimate Current ( ( I ) ): From the charge curve for the given time.
3. Calculate Power ( ( P) ) : Using (¿ P¿¿=¿¿V ¿¿×¿ I¿). Make sure to convert the current to amperes (A) if
it's in milliamperes (mA) by dividing by 1000.
Time, ( ¿ t ¿)
[ m i n]
Voltage, (¿ V ¿ )
[V ]
Current, (¿ I ¿ )
[m A ]
Power ,
( ¿¿ P ¿¿)
[ ¿ m¿ W ¿]
The rectangular (or Riemann sum) method estimates the integral of power over time. Given
time intervals minutes, the energy in mWh can be calculated as:
o
f
( ¿ ¿ Δ ¿ t ¿ ¿= ¿ ¿ 2 ¿ ¿ )
Energy (mWh)
¿
n
∑i = 1 P i
¿
Δ
t
For each interval, multiply the power by the time interval (2 minutes).
Example Calculation:
2
( ¿ ¿ )
6 0
t
Example Calculation:
Energy (Wh)
¿
Energy (mWh)
1000
Step 5: Comparison of Methods
1. Rectangular Method:
Pros: Simple to apply and understand.
Cons: Can be less accurate, especially if the power data changes rapidly between intervals.
2. Trapezoidal Method:
Pros: More accurate as it considers the average of the function values at each interval.
Cons: Slightly more complex but provides better accuracy for varying data.
Comparison:
Accuracy: The trapezoidal method generally provides better accuracy than the rectangular
method, especially with data that changes significantly between intervals.
Complexity: The trapezoidal method is more complex to apply manually, but this complexity
results in a more accurate estimate of the total energy.
Applicability: Both methods are useful, but the trapezoidal method is preferred when higher
accuracy is needed.
Summary
The rectangular method gives a quick estimate but may not capture the true energy
accurately if the power fluctuates significantly.
The trapezoidal method is more accurate as it averages the power values over intervals,
providing a better estimate of the total energy stored in the battery.
Finally, you can compare your calculated energy values with the given battery specifications
(e.g., 4.2 V and 2000 mAh) to validate your results. The theoretical maximum energy stored in
the battery can be compared with your calculated values to assess the accuracy of your
numerical integration methods.