Problem with initial conditions in Maple

541 Views Asked by At

I am new to Maple, trying to see how do I add initial conditions to a system of differential equations. Here is an example problem, which has some error in it. What is wrong? This appears on the worksheet:

[$\frac{d}{dt}f1(t)=f2(t),\frac{d}{dt}f2(t)=-f2(t)$] (1)

pdsolve((1)) $$f1(t)=-C_1e^{-t}+C_2,f2(t)=C_1e^{-t}(2)$$

initialcondition($f1(1)=0,f2(0)=1$)(3)

pdsolve((1),(3))

Gives Error 'Too many arguments...'

What is wrong? I tried also including the ICs in the list together with the equations, but nothing seems to work...

1

There are 1 best solutions below

0
On BEST ANSWER

Wrong syntax. The system of equations is to be written as

sys:= $\frac{d}{dt}f1(t)=f2(t),\frac{d}{dt}f2(t)=-f2(t)$

Then the proper syntax for adding initial conditions is

ics:=$f1(1)=0,f2(0)=1$

Finally, as Acer mentioned above, the proper command for an ODE system is

dsolve({sys,ics})

Which gives the correct solution $$f1(t)=-e^{-t}+e^{-1},f2(t)=e^{-t}$$