Problem 44478. Exponential decay
Many dynamic processes can be approximated as an exponential decay. This applies to radioactive decay, some chemical reactions, ageing of LEDs etc. See https://en.wikipedia.org/wiki/Exponential_decay for more background.
Assume that the process starts with a normalised value of x(0) = 1, and it follows the following decay law:
x'(t) = - x(t) / tau
where x'(t) is the first derivative of x(t), and time constant tau is 2.
Write a function that returns the value x for a given input t. It should be able to deal with a vector input.
Solution Stats
Problem Comments
-
5 Comments
"d/dt x(t)" —> "d{x(t)}/dt". Or write perhaps just "x′(t)".
By the way, as written your tau represents a "decay constant", rather than a "time constant" — it will have dimensions of reciprocal time (assuming that t represents time).
Your Problem Statement and Test Suite appear to be inconsistent. Please check Solution 1404081.
Thanks for the comments - you are indeed correct, and I have rewritten the equation accordingly. I hope it is correct and consistent now.
Thanks for attending to that, Thomas. It looks consistent now.
Solution Comments
Show commentsProblem Recent Solvers23
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
49378 Solvers
-
516 Solvers
-
425 Solvers
-
459 Solvers
-
Calculate roots of polynomial given as vector array.
83 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!