Solve for, and then substitute.
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2022-2-19
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)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!