Solve for, and then substitute.
3 views (last 30 days)
Show older comments
Kyle Langford
on 18 Feb 2022
Commented: Kyle Langford
on 19 Feb 2022
I posted before, but I am not getting the answers I am looking for. This is a simplified version of what I want to do.
say, f(t)=y*t, and we are given an initial condition f(1)=10. We can use this information to solve for y..
Now that we know, y=10, solve for f(2)=?, obviously f(2) will equal 20.
How can I write this code in MATLAB?
2 Comments
Accepted Answer
Walter Roberson
on 19 Feb 2022
K=1
A=100
y0=0
syms y(t) T
y(t) = K*A + (y0-K*A)*exp(-t/T)
y_known = 80 %y(1.2)=80
t_known = 1.2
eq1 = y(t_known) == y_known
sol_T = solve(eq1, T)
y(t) = subs(y(t), T, sol_T)
y(1.5)
vpa(ans)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!