Declining Balance Method (DECLINE)

Compute the accumulated depreciation for an asset using the declining balance method. 
 syse.decline(cost: ndarray, salvage_value: ndarray, useful_life: int, rate: float) ndarray
Compute the accumulated depreciation for an asset using the declining balance method.
 Parameters:
cost (np.ndarray) – The cost of the asset.
salvage_value (np.ndarray) – The salvage value of the asset.
useful_life (int) – The useful life of the asset.
rate (float) – The depreciation rate, expressed as a fraction of 1.
 Returns:
The depreciation for the asset.
 Return type:
np.ndarray
Note
The function takes as input the cost of the asset, the salvage_value of the asset at the end of its useful life, the useful_life of the asset in years, and the rate of depreciation as a fraction of 1. It computes the depreciation for the asset using the declining balance method, which assumes that the asset depreciates by a fixed percentage of its remaining book value each year.
Examples:
Suppose a company purchases a delivery truck for $50,000, with an expected salvage value of $5,000 after 5 years. The company expects to use the truck for 5 years. The depreciation rate for the truck is 30% per year using the declining balance method. We can compute the depreciation for the truck using the decline function
depreciation = syse.decline(cost=50000, salvage_value=5000, useful_life=5, rate=0.3) print(f"The accumulated depreciation for the truck is ${depreciation:.2f}.") Output = The accumulated depreciation for the truck is $41,596.50