Opened 10 years ago

# Error with supposedly normal DE problem

Reported by: Owned by: Karl-Dieter Crisman Burcin Erocal major sage-6.4 calculus Stan Schymanski N/A

### Description

```var('a b n k t')
c = function('c',t)
de = diff(c,t) - a + (b*c)*((c**n)/((k**n)+(c**n))) == 0
des = desolve(de,[c,t],[0,0])
```

yields an error about c(t) not being a proper Python identifier. Various other combinations yield similar ECL errors, and at least sometimes one can get segmentation faults after inserting print statements.

### comment:1 Changed 10 years ago by Karl-Dieter Crisman

Simpler example that seems to behave analogously.

```de = diff(c,t) - a + c^n == 0
```

Note that making `n` a specific integer gives questions about the sign of `a` and `assume(a>0)` fixes things.

Are there maybe just too many variables?

### comment:2 Changed 10 years ago by Stan Schymanski

I don't think it is about the number of variables, but about maxima not being able to provide an explicit solution. Here is the example computed directly in maxima:

```maxima("de: 'diff(c(t),t) - a + c(t)^n")
maxima("atvalue (c(t), t = 0, 0);")
maxima("ode2(de,c(t),t);")
```

gives:

```-'integrate(1/(c(t)^  n-a),c(t))=t+%c
```

Note that the integral containing c(t)n could not be solved. Replacing n by an integer and defining c as positive:

```maxima("de: 'diff(c(t),t) - a + c(t)^2")
maxima("atvalue (c(t), t = 0, 0);")
maxima("assume(a>0);")
maxima("ode2(de,c(t),t);")

```

gives:

```-log(-(sqrt(a)-c(t))/(c(t)+sqrt(a)))/(2*sqrt(a))=t+%c
```

Is it possible that the 'integrate in the solution creates a problem?

### comment:4 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11 → sage-5.12

### comment:5 Changed 9 years ago by For batch modifications

Milestone: sage-6.1 → sage-6.2

### comment:6 Changed 9 years ago by For batch modifications

Milestone: sage-6.2 → sage-6.3

### comment:7 Changed 8 years ago by For batch modifications

Milestone: sage-6.3 → sage-6.4

### comment:8 Changed 5 years ago by Ralf Stephan

With #22024 we get:

```sage: solve(de,t,algorithm='sympy')
ConditionSet(t, Eq(-a*(k**n + c(t)**n) + b*c(t)*c(t)**n + (k**n + c(t)**n)*Derivative(c(t), t), 0), Complexes(S.Reals x S.Reals, False)) \ ConditionSet(t, Eq(k**n + c(t)**n, 0), Complexes(S.Reals x S.Reals, False))
```
Note: See TracTickets for help on using tickets.