using giac to solve differential equation with initial conditions

Messages in english

Modérateur : xcasadmin

Nasser
Messages : 13
Inscription : mer. juil. 11, 2018 11:14 pm

using giac to solve differential equation with initial conditions

Message par Nasser » ven. janv. 13, 2023 8:41 am

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

parisse
Messages : 5742
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: using giac to solve differential equation with initial conditions

Message par parisse » ven. janv. 13, 2023 9:19 am

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.

Répondre