Solve for, and then substitute.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kyle Langford
el 18 de Feb. de 2022
Comentada: Kyle Langford
el 19 de Feb. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Feb. de 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)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!