Questions tagged [dsolve]

69 questions
5
votes
2 answers

SymPy - Problems when using to many parameters in dsolve

I'm using SymPy version 0.7.3, and encountered some problems when using dsolve function. It seems that dsolve having difficulties when the input equation has too many parameters. I've tried solving the following equation: from sympy import * p =…
user5497
  • 243
  • 1
  • 2
  • 10
3
votes
1 answer

Matlab: dsolve with conditions not working

I'm trying to solve the system of differential equations given by variables eqn1 and eqn2. lambda1 = 3; lambda2 = 2; gamma1 = 1; gamma2 = 1; delta1 = 1; delta2 = 1; syms n1(t) n2(t) eqn1 = diff(n1) == (lambda1 - gamma1)*n1 - delta1*(n1 +…
Rafael Korbas
  • 2,213
  • 3
  • 19
  • 30
3
votes
1 answer

Solving a differential equation in Mathematica

I have a syntax problem solving a differential equation in Mathematica (10th version). The input for the equation I need to solve is as follows: solv = DSolve[{ a*u''[y] - b*u[y] == d, u'[0] == 0, u[1] == 0}, u, {y, -1, 1}] Which after using…
2
votes
1 answer

Custom arbitrary constant names for sympy dsolve?

Is there a way to provide get dsolve() to use arbitrary constants named by a different sequence than C1, C2, etc? cse() allows a symbols parameter that accepts an infinite generator of names, but I don't see a similar parameter to dsolve(). I'm…
Omegaman
  • 2,189
  • 2
  • 18
  • 30
2
votes
0 answers

MATLAB: dsolve not giving solution

I am trying to solve a 4th order differential equation with boundary conditions but function dsolve is not giving solution. It is running for more than an hour. The code I have made is syms omega delta x f(x) df(x) = diff(f); dff(x) =…
Ankush
  • 235
  • 3
  • 14
1
vote
2 answers

How do I substitute and array into a sympy equation so I can plot the equation?

I have used dsolve to generate a result in the form of an equation in variable result. I want to plot this equation for the range of values in the x_val array so I can plot it. I do not seem to be able to find a way to use apply the function to the…
KitingPaul
  • 49
  • 5
1
vote
0 answers

How to print output equation as in latex format in python?

i want to print the output of the equation in latex format (Output of the latex code), when i try to compile the following code , it is giving me the latex coede . can i print the latex equation i python? import sympy from sympy import * t =…
Mahesh
  • 13
  • 5
1
vote
2 answers

Derivative() or diff() in SymPy ODE?

Is there a good reason to use Derivative instead of diff in the definition (and solution) of an ODE in Sympy? diff seems to do the job just fine:
1
vote
0 answers

dsolve. numeric. to know which method Maple used

How would I know that dsolve numeric used which method to solve my non-linear bvp. Is there a way to find out about the method used by Maple 2019.
1
vote
0 answers

I don't understand the error I get using Matlab's dsolve function

I'm fairly new to Matlab and programming in general, and this error message has defeated me . The simplified code is the following: Lpi = .05; Dpi = .01; LpD = [.1, 06]; LpI = [.9, 14]; DpR = [.4, 06]; DpI = [.6, 08]; IpH = [01, 30]; syms H(t) L(t)…
1
vote
1 answer

Solving 1st ODE using Matlab dsolve, having intial condition y(0)=0 and find solution at a t=1

f(t,y)=3y Intial Condition y(t)=0 when t=0 What is the solution when t=1 I dont want to solve it numercially, rather somthing like symbolic function. I am not able to include a way to find y(t) when t=1 syms y(t); ode= diff(y,t) == 3*y; cond=…
1
vote
1 answer

SymPy dsolve returns different results for mathematically equivalent differential equations

Here is the content of my script: from sympy import * x = symbols('x') init_printing(use_unicode=True) f = symbols('f', cls=Function) diffeq = Eq(x**2 * f(x).diff(x, x) + x * f(x).diff(x) - f(x) , 1/((1+x**2)**(3)) ) print dsolve(diffeq,…
EricVonB
  • 238
  • 3
  • 11
1
vote
2 answers

sympy dsolve returns incorrect answer

I'm using sympy.dsolve to solve a simple ODE for a decay chain. The answer I get for different decay rates (e.g. lambda_1 > lambda_2) is wrong. After substituting C1=0, I get a simple exponential -N_0*lambda_1*exp(-lambda_1*t)/(lambda_1 -…
Daria
  • 13
  • 4
1
vote
0 answers

The number of derivatives returned by func() must equal the length of the initial conditions vector

while related questions and replies exist, I could not translate them to my own problem, so here it goes: ratedegrad<-0.012 releaser<-0.0016666667 times2<-seq(from=1, to=240,…
1
vote
2 answers

Python sympy dsolve error

After reinstalling Python, the following simple code import sympy as sm x = sm.Symbol('x') f = sm.Function('f') y = sm.dsolve(sm.diff(f (x),x)-3*f(x)(1-0.5f(x)),f(x)) print(y) gives the following output: Eq(x + 0.333333333333333*log(1.0*f(x) -…
luis
  • 11
  • 2
1
2 3 4 5