Plot functions about calculus of variations
1 view (last 30 days)
Show older comments
Hello everyone,
I am new to Matlab.
My codes are:
syms a X(t) c T
assume(T>0)
F(t) = int(a*X(t)-(c/2)*(diff(X(t))^2),t,0,T)
D = functionalDerivative(F,X)
assume(a,'positive')
assume(c,'positive')
S = dsolve(D, X(0)==X0, X(T)==0)
I want to plot the solution S at time t, but did not know how to do it.
Thank you for helping!
4 Comments
Julieth Santamaria
on 20 Sep 2019
Strickly speaking, for matlab S(t) is not a function. So fplot won't work.
Walter Roberson
on 20 Sep 2019
I had no problem using fplot once I had substituted in enough values to make it a function of a single variable, such as
SS(t) = subs(S, {X0, a, c,T}, {152, -9.81, 13, 11});
fplot(SS)
Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!