0% found this document useful (0 votes)
24 views15 pages

Furtther Maths Assing 1

Uploaded by

zaidshaz11223344
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views15 pages

Furtther Maths Assing 1

Uploaded by

zaidshaz11223344
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Task 1

Problem Formulation

1. Define Variables:
Let (¿ x 1 ¿) be the number of panels delivered from WH1 to S1.

Let (¿ x 2 ¿) be the number of panels delivered from WH1 to S2.

Let (¿ y 1 ¿ )be the number of panels delivered from WH2 to S1.

Let (¿ y 2 ¿ )be the number of panels delivered from WH2 to S2.

2. Constraints:
Total panels required at S1 and S2:
x 1
+ ¿ y 1
¿
625

x 2
+ ¿ y 2
¿
900

Total panels available from WH1:


x1
+ ¿ x 2
¿
47 5

Maximum panels transported from WH2 to any site:


y 1
¿
550

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.

% Coefficients of the objective function (not used here, as we seek feasibility)


f = [0, 0, 0, 0];

% Coefficients matrix for the inequality constraints


A=[
1, 0, 1, 0; % x1 + y1 <= 625
0, 1, 0, 1; % x2 + y2 <= 900
1, 1, 0, 0; % x1 + x2 <= 475
0, 0, 1, 1; % y1 + y2 <= 900 (total panels requirement)
];

% Right-hand side of the constraints


b = [625; 900; 475; 900];

% Bounds for each variable


lb = [0, 0, 0, 0]; % Lower bounds (all variables should be >= 0)
ub = [Inf, Inf, 550, 550]; % Upper bounds (y1 and y2 should be <= 550)

% Linear programming problem to find a feasible solution


options = optimoptions('linprog', 'Display', 'off'); % Suppress output
[x, fval] = linprog(f, A, b, [], [], lb, ub, options);

% Extract and display results


x1 = x(1); % Panels from WH1 to S1
x2 = x(2); % Panels from WH1 to S2
y1 = x(3); % Panels from WH2 to S1
y2 = x(4); % Panels from WH2 to S2

fprintf('Panels delivered from WH1 to S1: %.0f\n', x1);


fprintf('Panels delivered from WH1 to S2: %.0f\n', x2);
fprintf('Panels delivered from WH2 to S1: %.0f\n', y1);
fprintf('Panels delivered from WH2 to S2: %.0f\n', y2);

Results and Explanation:

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

1. Define the Temperature Distribution:


Let (¿

(¿

(¿
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.

3. Heat Transfer Equation:


The temperature at each interior node is the average of its four nearest neighbors. For
instance:
T1
¿
T left + T above + T right +T below
4

Rearranging gives us:


4
T 1
¿
T left
+ ¿ T above
+ ¿ T right
+ ¿ T below

For simplicity, assume the boundary conditions are are known.


( ¿ T left ¿ )
,
( ¿ T above ¿ )
,
( ¿ T right ¿ )
,
a
n
d
( ¿ T below ¿ )

Mathematical Model

Assuming the temperatures at the boundaries are given as:


(¿ T left ¿ ¿ ¿ 10 ¿)

(¿ T above ¿ ¿ ¿ 20 ¿ )

(¿T right ¿ ¿ ¿ 30 ¿ )
(¿ T below ¿ ¿ ¿ 40 ¿ )

We can set up the following equations based on the above relationship:


1. For (¿ T 1¿)
:

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

The system of equations can be written in matrix form (¿ A ¿ x ¿¿¿ b¿)


,
where:

T
(¿ x ¿¿¿ [ T 1 , T 2 , T 3 , T 4 ] ¿)

T
(¿ b ¿ ¿ ¿ [ 30 ,50 , 70 , 90 ] ¿ )

(¿ A¿)is the coefficient matrix:


A
¿

[ ]
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. Find the Inverse of (¿ A¿):

Calculate the inverse of matrix (¿ A ¿)


.
Let’s manually compute this:

−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

Multiply the inverse matrix (¿A− 1 ¿ )


b
y
(¿ b ¿ )
:

Verification Using Software

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];

% Solve for x using matrix inversion


x
¿
i
n
v
( A )
¿
b
;

% Display the result


disp('Temperature distribution at the interior nodes:');
disp(x);

This code will compute the temperatures (¿

(¿

(¿
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:

Step 1: Initial Interval Selection

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\):

(¿ f ¿ ( a ) ¿¿ ¿f ¿ ( 0 ) ¿¿¿−¿ 0.018507¿) (Negative)

(¿ f ¿ ( b ) ¿¿¿ f ¿ ( 29 )¿)(Let's calculate this.)

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 ) ¿ )

different \(a\) and \(b\) values until we find a sign change.

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:

Midpoint (¿ c ¿ ¿ ¿ a+ b ¿ ¿ ¿ 0+15 ¿ ¿ ¿ 7.5 ¿ )


2 2

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)

New interval: (¿ [ 7.5 ,15 ] ¿)

2. Second Iteration:

Midpoint (¿ c ¿ ¿ ¿ 7.5+15 ¿ ¿ ¿ 11.25 ¿ )


2

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)

New interval: (¿ [ 11.25, 15 ] ¿)

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)

New interval(¿ [ 13.125


:
, 15 ] ¿ )

Absolute Relative Approximate Error:


For each iteration, calculate the error:

Error
¿

|x new x old
x new |
¿
100
¿ %

2. Newton-Raphson Method

For the Newton-Raphson method, use the derivative of the function:

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:

Choose an initial guess, (¿ x 0 ¿ ¿ ¿ 10 ¿ )

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:

Evaluate (¿ f ¿ ( x 1 ) ¿) and (¿ f ' ¿ ( x1 ) ¿) similarly.

Update (¿ x 2 ¿)
.

3. Third Iteration:

Continue similarly until the change i


n is small.
(¿ ¿ x ¿ ¿ )
Absolute Relative Approximate Error:

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:

Bisection Method: Linear convergence; generally slower.


Newton-Raphson Method: Quadratic convergence; faster if the initial guess is good.

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:

Step 1: Estimation of Voltage, Current, and Power


To begin, you'll need to fill in the table with voltage \(V\), current \(I\), and power \(P\) values
using the provided charge curves. Let’s assume you have the curves to read the values at
every 2-minute interval. For each interval:

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 ¿]

0 3.7 100 370


2 3.75 110 412.5
4 3.8 120 456
... ... ... ...
132 4.1 80 328
134 4.2 70 294

Step 2: Numerical Integration Using Rectangular Method

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

where (¿ Pi ¿ ) is the power at each time step.

For each interval, multiply the power by the time interval (2 minutes).

Example Calculation:

If you have power values (¿ P ¿ ¿ ¿ [ 370,412.5,456 , … , 294 ] ¿ )


:
Energy (mWh)
¿
( 370 + 412.5 + 456 +…+ 294 )
¿
2
60

2
( ¿ ¿ )
6 0
t

Sum the power values, then multiply by


o
c
o
n
v
e
r
t
f
r
o
m
m
W
− ¿ m
i
n
t
o
m
W
h
.

Step 3: Numerical Integration Using Trapezoidal Method

The trapezoidal method is more accurate and is given by:

where (¿ P0 ¿ , ¿ P1 ¿ , ¿ …¿ , ¿ P n ¿) are the power values at each time step.

Example Calculation:

Using the power values (¿ P ¿ ¿ ¿ [ 370,412.5,456 , … , 294 ] ¿ )


:

Sum the intermediate terms and apply the formula.

Step 4: Convert the Total Energy Flow to Wh

Convert the total energy from mWh to Wh by dividing by 1000:

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.

You might also like