Hello and thanks for checking out my post!
I am fairly new to Mathematica and I need to write a code that solves a differential equation and outputs the time at certain values of y.
Here is what I have done so far:
kp = 100;
km = 500;
at = .4;
dLB = lb’ + km lb == kp (lt - lb)*(at - lb);
Flatten[
Map[
({lb[100]} /. #) &,
soln = Table[
NDSolve[{dLB, lb[0] == 0}, {lb}, {bt, 0, 100}], {lt, .1, 1, .1}]
], 1] // TableForm
Which gives me:
{
{0.00728237},
{0.0143223},
{0.021131},
{0.0277187},
{0.0340953},
{0.0402703},
{0.0462523},
{0.0520499},
{0.0576708},
{0.0631226}
}
This is great, but I need to find the time, “bt”, when these values are at 95% of my calculated equilibrium values of lb (my differential equation). Since the graphs of these solutions rise and then stay at an equilibrium state, I have solved for those values using different values of “lt.” These are supposed to be from .1 to 1 in steps of .1.
I have tried the event locator feature, but it worked for only one calculated value of the equilibrium state**.**
I don’t know how I would write a code that extracts the value of bt when the lb of the solution is at 95% of the calculated equilibrium value.
This is my code for calculated the equilibrium of lb:
lbe = Solve[x^2 - x (at + lt + kd) + lt at == 0, x]
There are two solutions to x but I need the lower one, and this needs to be solved with values of lt going from .1 to 1 in steps of .1
Any help would be much appreciated as I have been working on this for way too long.
Thank you!