1
vote
1answer
18 views

How to solve an ODE with boundary conditions using Matlab solver?

My question is very simple: I want to plot a graphic for the deflection of a beam, with consists of a solution of an ODE using a Matlab solver, such as: %Call Solver -> Linear [x y] = ...
0
votes
1answer
35 views

How can I solve an ODE when $F(x_0)=F'(x_0)=0$ is given at an unknown point $x=x_0$ using bvp5c?

I'm attempting to solve the following ODE using MATLAB bvp5c. I've used bvp5c for other typical multipoint boundary value problems but I have no idea how to deal with ODEs with conditions given at an ...
3
votes
3answers
56 views

How can I write an SDE in Matlab?

My professor would like me to solve a system similar to the following: $$ dx_i=[f_i(x_1,x_2,...x_n)]dt + g_ix_idW_i$$ Where $g_i$ are positive constants that measure the amplitude of the random ...
0
votes
0answers
21 views

Using event function in matlab ode45 for multi-dimensional state vector

I have a set of odes written in matrix form as $X' = AX$; I also have a desired value of the states X_des. $X$ is a five dimensional vector. I want to stop the integration after all the states reach ...
1
vote
1answer
67 views

Matlab ode45 numerical solution

I'm trying to solve a 2nd order differential equation, using the Runga Kutta's ode45 function in Matlab. It's for a bachelor project, where I'm trying to simulate the behavior of a spherical robot, ...
0
votes
1answer
30 views

Logistic Equation with MatLab

I want to write a MatLab file that can solve the following logistic equation: $$\frac{dN(t)}{dt} = [a-bN(t)]N(t) \;\;\;\; a>0, b>0$$ But I'm not sure how to go about it. Are there any examples ...
-1
votes
0answers
24 views

Matlab Creating function for ode45

i want to create odefun from reading data from the table ...
0
votes
1answer
38 views

Matlab: plotting y against f(y) [closed]

I am learning about Matlab and autonomous differential equations and have been trying to plot the graph of y against $f(y)$ for the logistic equation but it doesn't seem to come out right. this is ...
0
votes
0answers
40 views

SIR models - help!

I am doing a project on the spread of infectious diseases and I have chosen to model this spread by using the SIR model - (susceptibles, infectious, recovered). I have to insert data into this model ...
1
vote
1answer
35 views

Using Runge Kutta 2 on a System of Equations

So I created a MatLab code to solve an ODE equation, however I'm having a hard time vectorizing everything! Here is the code as I have it: ...
0
votes
2answers
128 views

Laplace equation in 1D with MATLAB - Neumann boundary condition

My previous problem is here and I 've done. Laplace equation in 1D with MATLAB I have the next problem: solve Laplace equation in $1$D with boundary condition $u'(0)=u'(1)=0$ Help me some hints. ...
0
votes
1answer
26 views

MATLAB Finding Difference of two equations

So I'm trying to figure out how to do a fairly simply mathematical task in MATLAB but I don't know what it is called so I don't know what to search. Basically what I want to do is if you have two ...
-1
votes
1answer
189 views

Laplace equation in 1D with MATLAB - Dirichlet boundary condition

Here is a Matlab code to solve Laplace 's equation in 1D with Dirichlet's boundary condition u(0)=u(1)=0 using finite difference method ...
0
votes
2answers
36 views

Ordinary differential equations with signed first derivative

Consider the following coupled set of ordinary diferential equations: \begin{align} (K_{pa}+K_r)y_1(t)-K_ry_2(t)+C_0\operatorname{sign}(\dot{y}_1(t))\lvert\dot{y}_1(t)\rvert^\alpha &= ...
0
votes
1answer
63 views

Solving a nonlinear system of differential equations in MATLAB or Mathematica

Is it possible to solve the system $$\dot{W}=A\left(k-\frac{M}{W}\right)$$ $$\dot{M}=B\left(k-\frac{M}{W}\right)$$ with initial conditions $$W(0)=w_0$$ $$M(0)=m_0$$ in MATLAB or Mathematica? If so, ...
-1
votes
1answer
316 views

How to plot a phase portrait for this system of differential equations?

I beg your help.. I'd like the phase portrait for this system. I don't know how to use Mathematica/Matlab ... :( If anyone can make this portrait and post a print screen here, I would thank you ...
0
votes
0answers
14 views

MatCont continuation data for use on other plotting softwares

I have been using MatCont for generating continuation figures for my model ODEs. Dissatisfied with the quality of figures on MATLAB, I want to use gnuplot for plotting of this continuation data. In ...
1
vote
0answers
55 views

Calculate a 5x5 Vandermonde system for a 5 point mesh

This is problem 1.2 in Randall J Leveque's textbook, "Finite Di fference Methods for Ordinary and Partial Di fferential Equations". I'm struggling with how to actually do the computation, I'm not so ...
0
votes
1answer
78 views

Converting the diffusion equation PDEs to ODEs for use in Matlab ODE solvers

I am trying to convert the diffusion equation to ODEs so that it can be programmed using Matlab's ODE solvers. The diffusion equation I'm using is: $$ {\partial u \over \partial t} = D\,{\partial^{2}u ...
0
votes
0answers
26 views

Numerical problem with set of ODEs

I have a set of ODEs: $$\dot{x}_{i} = f_i(x_1, \ldots, x_N), ~ i \in \{1, 2, \ldots, N\}$$ This set of ODE has the following properties: $\displaystyle\sum_{i=1}^N f_i = 0 ~ \forall x_1, \ldots, ...
3
votes
1answer
104 views

Solve the differential equation: $y''+(1-2x)y'+2x(e^{x^{2}}-1)y=xe^{x^{2}}$

I have an exercise of solving the equation above using MATLAB, with a hint to set $ v(x)=(y'+y)e^{-x^{2}} $. I tried to do with my hand and get the following: $ v'+2xy=x $, but I don't know what to do ...
0
votes
2answers
99 views

Concerning the general solutions to linear ODEs Y'=AY when A has multiple eigenvalues

Given linear ODES Y'=AY, where Y is a column vector, A is a 6*6 square matrix. Clearly A has 6 eigenvalues, namely r1, r2, r3, r4, r5, r6. Herein we assume r5=r2, r6=r3.That is, r2 and r3 are two ...
1
vote
2answers
359 views

Solving (Frenet-Serret) differential equation system in Matlab

I'm about (trying) to solve the Frenet-Serret equation given by the known formulas, finding $e(s)$, $n(s)$, $b(s)$, where $e'(s) = \kappa(s)v(s)n(s)$ $n'(s) = -\kappa(s)v(s)e(s) + \tau(s)v(s)b(s)$ ...
0
votes
0answers
29 views

Numerical Solvers to deal simultaneously with very different types of Oscillatory Behaviour

I am trying to solve these two related problems numerically: \begin{align} &f^{(\mbox{v})}(y) -(f^5 (y))'-\frac{1}{6}yf(y)=0\\ f'(0)=f'''(0)=0, &\quad f(y) \sim Cy^{(-1/7)}\exp(\gamma ...
0
votes
1answer
111 views

Matlab od45 question

I am learning to use Matlab's ode45 to solve this equation and plot its time history: $$I_gd\omega/dt + \omega \times (I_g\omega) = 0$$ It was suggested that I ...
1
vote
1answer
723 views

Solve a second order DEQ using Euler's method in MATLAB

I need to solve the equation below with Euler's method: $$y''+ \pi ye^{x/3}(2y' \sin(\pi x)+\pi y\cos (\pi x)) = \frac{y}{9}$$ for the initial conditions $y(0)=1$, $y'(0)=-1/3$ So I know I ...
1
vote
0answers
40 views

1D PDE decoupling

I need to solve the 1D nonlinear poisson equation and I thought of trying the fixed point decoupling technique. The equation is this: $\frac{\partial^2 \phi(y)}{\partial ...
1
vote
1answer
152 views

How to proceed solving this problem?

I'm working on the problem "soundwaves under the water" (page 16 in the document is in English) from a numerical analysis book. I've got the following problem that is taken from the numerical ...
2
votes
1answer
1k views

Numerically solving a system of nonlinear ODEs with boundary conditions

I have a system of 6 second-order nonlinear ODEs involving 5 different functions of a variable $t$. Every function has a boundary condition at $0$. I've never taken a differential equations class and ...
0
votes
2answers
127 views

Logistic Equation: Equilibrium

Given a differential equation, for example, a logistic curve, how do I determine the equilibrium points, graphically? Consider $$x'=ax\left(1-\frac{x}{b}\right)-\frac{x^2}{1+x^2}$$ It is clear that ...
0
votes
1answer
151 views

Alternative code for solving pendulum equation $\ddot{\theta} + \sin{\theta} = 0$

One MATLAB code for solving pendulum equation $\ddot{\theta} + \sin{\theta} = 0$ is: T=100; h=0.1; n=floor(T/h); y0 = [1 0]; y=y0; sol=y0; for nT = 1:2 theta = y(1); y(1) = y(1) + h*y(2); ...
0
votes
0answers
142 views

Why is there no Overshoot in this second order system?

A second-order system which has a damping factor of less than $1$ should have an overshoot right? The formula for this is: $$\exp{(-\pi*\zeta/\sqrt{1-\zeta^2})}$$ But I have noticed that if the ...
1
vote
0answers
370 views

Simultaneously solution of four nonlinear ODE differential equations in MATLAB???

I want to solve the four nonlinear ODE differential equations simultaneously in MATLAB. and I must tell that my unknown function is a matrix so how can I solve these equation in Matlab??? Thanks for ...
0
votes
0answers
175 views

Implementing the $\theta$-method for solving an IVP

I want to implement the $\theta$-method to solve an IVP in MATLAB. The $\theta$-method is: $y_{j+1} = y_j + h[\theta f(t_j, y_j) + (1 - \theta)f(t_{j+1}, y_{j+1})]$ for $\theta \in [0, 1]$. I want ...
1
vote
1answer
272 views

Discretization of differential equation via FFT routine

I just have a question related to the following problem: Find a discrete approximation to the differential equation $u^{\prime \prime} + 2u^{\prime} + 2u = 3\cos(6t)$ using Equation 3.12 for these ...
0
votes
1answer
72 views

matlab differential equation

I have followed the tutorial on http://www.mit.edu/people/abbe/matlab/ode.html and prepared a function as follows: ...
0
votes
1answer
796 views

Three step Adams-Moulton functional iteration

I'm given an IVP: $$y' = e^y, \;\;\;\; 0 \le t \le 0.20, \;\;\;\;\; y(0) = 1$$ The solution is: $$y(t) = 1 - \ln(1 - et)$$ Applying the three-step Adams-Moulton method to the problem is equivalent ...
0
votes
1answer
184 views

Solve a system of time-independent ODE's with vector constants

I have to solve numerically this set of Ordinary Differential Equations $$ \frac{dx_1}{ds} = \frac{1}{x_1} \left[x_2 \left(a + \frac{x_2}{s}\right)-\alpha x_1 z\right]$$ $$ \frac{dx_2}{ds} = ...
2
votes
2answers
1k views

Runge-Kutta algorithm for a given ODE system

consider the system given by: $$x'_{1}=9x_{1}+24x_{2}+5\cos t-\dfrac{1}{3}\sin t$$ $$x'_{2}=-24x_{1}-51x_{2}-9\cos t+\dfrac{1}{3}\sin t$$ with initial values $$x_{1}(0)=\dfrac{4}{3}$$ and ...
0
votes
1answer
466 views

Second Order ODE in MatLab

I am given an example file for solving a second order ODE using ODE 45 ...
0
votes
1answer
178 views

Soundwaves under the water

I've got the following problem that is taken from the numerical analysis book by Kahaner-Moler-Nash (P8-15): The speed of sound in ocean water depends on pressure, temperature and salinity, all ...
0
votes
2answers
152 views

FDM for boundary value problem?

Given the problem \begin{align} &u''− x^2u(u − 1) = 0,\\ &u(1) = 2,\\ &u(3) = 4, \end{align} solve it with a finite difference method with the interval divided into $N+1$ equal intervals ...
3
votes
1answer
423 views

A problem for Matlab solver

I can numercally solve a system of two ODEs for x and p: dy1 = -y1 + y2 dy2 = -1 + y2 with the following Matlab code: ...
2
votes
1answer
2k views

Solve Falkner Skan Numerically?

how would we go about solving the Falkner Skan equation numerically? The equation is $$f'''+ff''+\beta\left(1-f'^2\right)=0$$ $$f(0) = f'(0) = 0$$ $$f'(\infty) = 1$$ I tried using ODE45 to solve ...
1
vote
0answers
180 views

solving two systems of equation implicitly

I have been trying to solve the following two systems of equations simultanously and I'm very hesitant on how to go about it. Whether I need predictor-corrector methods, if I need to linearize the ...
0
votes
2answers
176 views

Solving $\frac{d^2y}{dx^2} + \sin(y) = 0$ with endpoint conditions of $y(0) = 0$ and $y(0.5) = 0.2618$ in MATLAB

I have this problem that i would like to solve preferably in MATLAB Solve: $$\frac{d^2y}{dx^2} + \sin(y) = 0$$ with endpoint conditions $y(0) = 0$ and $y(0.5) = 0.2618$. I think i have to plot ...
-1
votes
1answer
246 views

an odd question about solving ODE by MATLAB

Why MATLAB sometimes cannot solve the relatively particular case but can solve the relatively general case? For example: I tried to input (x^2-1)*D2y + 0*x*Dy + 1*x*y = 0 in MATLAB and MATLAB ...
1
vote
1answer
2k views

MATLAB - ode45 “ODEFUN” format

Is someone able to explain to me exactly what the "odefun" called by the "ode45" ODE solver in MATLAB is supposed to do? My understanding is that you represent an n-order ODE as a system of n ...
0
votes
1answer
321 views

Strange behaviour with ode45 in matlab, probably some numerical error.

I'm having a problem with a parameter estimation in a non-linear model. I think the culprit is that ode45 (an ode solver in matlab) is not properly solving my ode. It's the in red highlighted part, ...
0
votes
1answer
244 views

New to MATLAB, having some trouble solving systems differential equations

I need to numerically solve $$\frac{\mathrm dx}{\mathrm dt} = y - x^3$$ $$\frac{\mathrm dy}{\mathrm dt} = -x - y^3$$ with initial conditions $x_0,y_0 = 1,0$ for $t$ from $1$ to $100$. I don't know ...