Qalculate / libqalculate

Qalculate! library and CLI
https://qalculate.github.io/
GNU General Public License v2.0
1.88k stars 151 forks source link

dsolve can not solve dy/dx=y #617

Closed howaboutuser closed 8 months ago

howaboutuser commented 9 months ago

dsolve(diff(y,x)=y)

error: Was unable to completely isolate y. error: Unable to solve differential equation. dsolve(diff(y, x) = y) = dsolve(diff(y, x) = y)

hanna-kn commented 9 months ago

dsolve() is unable to get any further than ln(y) = x + C because C is not assumed real.

This has now been fixed. C is now assumed real if y is, and if y cannot be isolated completely, the resulting equation will be returned in solve() function (e.g. dsolve(diff(y, x) = y) = solve(ln(y) = x + C, y) if y is not assumed real.

hanna-kn commented 9 months ago
> help dsolve

Function: Solve differential equation

dsolve(Equation[, Initial condition: function value (y)][, Initial condition: argument value (x)])

Solves a differential equation and returns the value of y(x). The derivative in the equation should be in the
format diff(y, x). Only first-order differential equations are currently supported.

Example: dsolve(2 * diff(y, x) - y = 4x, 5, 2) = 21e^(x/2) / e - 4x - 8

Arguments
Equation: a free value
Initial condition: function value (y): a free value (optional, default: undefined)
Initial condition: argument value (x): a free value (optional, default: 0)
howaboutuser commented 9 months ago

When will it support second-order differential equations? (Or will it?)