f



how to compute C1 and C2 in differential equations using known values at zero time?

hello there,

I have simple differential equation already in matlab format:

syms y(t)
y(t) = dsolve(diff(y,2) == -9.81)

solution is correct, but I got C1 and C2 in the answer of course.

My question is: how to define following known values?
y(0)=0
v(0)=10?

With y(0)=0 I got lucky using
syms y(t)
y(t) = dsolve(diff(y,2) == -9.81, y(0)==0)

but I don't know how to define v(0)=10    ///// v(0) = speed in time zero, so it is first Y derivation in time in time zero..

I hope my question is clear and thank you for your help!
0
omathlab
12/21/2016 1:27:03 PM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
702 Views

Similar Articles

[PageSpeed] 5

"omathlab" wrote in message <o3dvv7$ecn$1@newscl01ah.mathworks.com>...
> hello there,
> 
> I have simple differential equation already in matlab format:
> 
> syms y(t)
> y(t) = dsolve(diff(y,2) == -9.81)
> 
> solution is correct, but I got C1 and C2 in the answer of course.
> 
> My question is: how to define following known values?
> y(0)=0
> v(0)=10?
> 
> With y(0)=0 I got lucky using
> syms y(t)
> y(t) = dsolve(diff(y,2) == -9.81, y(0)==0)
> 
> but I don't know how to define v(0)=10    ///// v(0) = speed in time zero, so it is first Y derivation in time in time zero..
> 
> I hope my question is clear and thank you for your help!
>
just check the first example of the help documentation for dsolve...

....and adapt:
  syms y(t)
  Dy = diff(y);
  dsolve(diff(Dy) == -9.82, y(0)==0,Dy(0) == 1)

HTH
0
Bjorn
12/21/2016 2:06:03 PM
Thank you! It has solved my issue!
0
omathlab
12/21/2016 3:21:03 PM
"omathlab" wrote in message <o3e6kv$seg$1@newscl01ah.mathworks.com>...
> Thank you! It has solved my issue!

Was the doc for "dsolve" unhelpful the first time you checked it? Glad to hear the doc was helpful overall though.

Karan
(Symbolic documentation)
0
Karan
12/22/2016 8:40:04 PM
Reply: