Questions tagged [dsolve]

69 questions
1
vote
1 answer

Error in dsolve when variable is multiplied by a constant (R2011a)

I am trying to use the following code: ode1='D2y1=-1256.4*y1-5*Dy1+255.1*y2+182.781'; ode2='D2y2=-151.5*y2-5*Dy2+255.1*y1-14.0459'; CI='y1(0)=2,y2(0)=-2,Dy1(0)=0,Dy2(0)=0'; sol=dsolve(ode1,ode2,CI,'t'); sol.y1 sol.y2 and matlab returns an…
1
vote
1 answer

Cannot transfer variable values into dsolve?

I got one question in matlab: I get a value of c from other function, then I want to put c value 1 into dsolve to solve this differential equation. but the value cannot put into dsolve, what should I do to transfer value? eg: c = 1; u = dsolve('Du…
1
vote
1 answer

linear two-equation system, two variables to second derivative in both

Forgive me if this is considered reposting, but I've been advised I might have given a bad format. I'm trying to solve the two linear, second order differential equations. I want to break them into single order equations, but I can't see how as both…
0
votes
1 answer

How to solve this Differential Equation without ProductLog in Mathematica?

I'm trying to solve a Differential Equation using Mathematica to check whether the result I get is equal to the result I got by solving the equation by hand. However, Mathematica gives me an answer including ProductLog which doesn't make sense to…
Cworm
  • 1
  • 1
0
votes
0 answers

Problem solving differential equation system with dsolve in Matlab

I'm new to Matlab (R2017b). I'm triying to solve a differential equation system with this script: clear; syms k x1(t) x2(t) M b f t; dx2_1 =diff(x2,t); dx2_2 =diff(x2,t,t); dx1_1 =diff(x1,t); dx1_2 =diff(x1,t,t); eq1 = k*(x1 - x2) - b*dx2_1 ==…
0
votes
0 answers

Evaluate symfun at a symbolic variable instead of a number in MATLAB

I created a symbolic function in MATLAB R2021b using this script with the goal of solving an ODE. syms phi(x) lambda L eqn_x = diff(phi,x,2) == -lambda*phi; dphi = diff(phi,x); cond = [phi(0)==0, dphi(1)==0]; % this is the line where the problem…
WnGatRC456
  • 337
  • 1
  • 2
  • 12
0
votes
1 answer

Issue with sympy dsolve and zero

In the following code, I want to have the friction constant 'c' be zero, however, if I put it equal to zero, the dsolve() function hangs up. It works fine if I put it equal to 1e-20 (effectively zero) I guess using 1e-20 is working but I would like…
KitingPaul
  • 49
  • 5
0
votes
1 answer

fplot error using second order derivatives / second-order differentiator circuit

d2/dt2i(t) + 25d/dti(t) + 100i(t) = 300 I want to plot x:time, y:i(t) graph using that second-derivative equation Also I using matlab syms i(t) eq = diff(i(t),t,2) + 25*diff(i(t),t) + 100*i(t) == 300; condition = i(0) == 0 ; sol(t) = dsolve(eq,…
이승연
  • 21
  • 1
  • 3
0
votes
0 answers

Is there a feature that tells you what hint best to give to the SymPy dsolve function?

I have this ordinary differential equation that I need to solve using SymPy. The equation: (m, g, C, rho, A are arbitrary constants) I already managed to get a solution out of it using the code below, but the computation takes more than 2 minutes…
0
votes
0 answers

Solving Systems of Linear Homogeneous Ordinary Differential Equations in Sympy

I am trying to solve an ODE of the form: (d/dt) x = A * x given the square matrix A and the vector x at t=0 in sympy. The system I am studying has more than 50 equations. As I defined it above, I believe these equations are linear, homogeneous, and…
Daylight
  • 1
  • 1
0
votes
0 answers

Sympy dsolve is out of memory trying to solve ODE with

I have a second-order linear ODE y'' + (w/c)^2*(cos(cos(2pix/d) + q0)*y=0. I need to get exact and numerical solution. Firstly, i tried to solve it with sympy.dsolve with this code: c = 1 w = 1.5 d = 1 q0 = 2 wc = (w / c)**2 x = symbols('x') y =…
Marat
  • 1
  • 1
0
votes
0 answers

How to simplify a symbolic expression in matlab

I solve a system of differential equations in matlab: syms x1(t) x2(t) x3(t); f = 0.5; u = @(t)(sin(2.5*t + f)); X1 = - 3*x1 + 0.2*x2 + 2*x3 + u; X2 = -1*x1 - 1.2*x2 + 1.4*x3; X3 = -0.4*x1 - 0.3*x3; start_cond = [x1(0) == 0; x2(0) == 0; x3(0) ==…
Vlad
  • 1
  • 3
0
votes
0 answers

Error when using sympy to solve the Geodesic Equations

I was playing around with General Theory of Relativity, and I was nearly done. But when I use sympy.dsolve to solve the geodesic equations, I always reports "NotImplementedError". My code look like this: from gravipy.tensorial import * from sympy…
Apple Sun
  • 33
  • 1
  • 4
0
votes
2 answers

Sympy dsolve with plots

I am solving an ODE with Sympy. The equation is ODE To solve it, I used this little code, which returns this result. from sympy import * from numpy import * import matplotlib.pyplot as plt x = symbols('x') y = Function('y') f =…
J Pablo A
  • 3
  • 1
0
votes
1 answer

How write the symbolic variable in the sympy EDO dsolve

Good afternoon, I'm coming here as I noticed something unusual in the results of dsolve() in sympy. from sympy import * from sympy.abc import x,y import sympy as s import numpy as np n = symbols('n',…