Page 1 sur 1

using giac to solve differential equation with initial conditions

Publié : ven. janv. 13, 2023 8:41 am
par Nasser
Using giac 1.9-35. When I put the initial conditions in a variable first, then call desolve, it does not work.

If I put the initial conditions directly into the desolve command, it works. Why is that? Here is an example

Code : Tout sélectionner

>> ode:=diff(y(t),t)+y(t)=0
diff(y(t),t)+y(t)=0

>> desolve([ode,y(0)=1],y(t))
exp(-t)
Compare the above to the following

Code : Tout sélectionner

6>> ode:=diff(y(t),t)+y(t)=0
diff(y(t),t)+y(t)=0

7>> ic:=y(0)=1
y(0)=1

8>> desolve([ode,ic],y(t))
[]
// Time 0
Why it fails in the second case? can't one put initial conditions in a variable and then use that variable in the call?
Am I doing something wrong?

--Nasser

Re: using giac to solve differential equation with initial conditions

Publié : ven. janv. 13, 2023 9:19 am
par parisse
Arguments of desolve are quoted, in order to insure that the function is not evaled itself (if there is something in y). Then it's hard to eval it "properly"... I'll see if I can find a better evaluation path.