1
vote
1answer
56 views

Find an expression of the direction field

I have a directions vector field which I got empirically using quiver in Matlab. I want to find some analytical expressions that might work at least in part of the direction field. How can I ...
1
vote
1answer
28 views

Relative error when computing derivatives via FFT

I want to compute a discrete derivative via the FFT. This amounts to multiplication by the wave number in Fourier space, as detailed in the stack exchange answer here. When I increase the ...
-1
votes
0answers
20 views

Using matlab ode23s to solve the 6 nonlinear differential equations:

Using matlab ode23s solver i am trying to solve the 6 nonlinear differential equations: Non-linear differential equations: $ \frac{dc_0}{dt}= c_0*(- K_F - K_D - K_N * s_0 - K_P*(1-q_0))$ ...
0
votes
0answers
34 views

The phase portrait of a second order of nonlinear system using matlab

I have the following system $$ \ddot{x} + 0.6\dot{x} + 3x + x^{2} = 0 $$ In the book I'm reading, the phase portrait of the nonlinear system for the aforementioned equation is I would like to ...
0
votes
0answers
32 views

An error in least square optimization problem in Matlab

I am new to MATLAB and I want to formulate the following lease square expression in Matlab. I have some codes that I am typing here. But the optimization problem solution seems not to be correct. Does ...
2
votes
0answers
59 views

How to solve this complicated differential equation?

I need to know how to solve this complicated differential equation in $z$ either analytically or numerically : \begin{eqnarray} \frac{dx_1}{dz} &=& -ib_1x_1 - ikx_2 \\ \frac{dx_2}{dz} ...
0
votes
1answer
51 views

How to solve these two differential equation?

I try to solve these two difference equation ; $$ \frac{dq}{dz} = -j\left(b_1q - kp\right),\\ \frac{dp}{dz} = -j\left(b_2p - kq\right) $$ where $j$ stands for $\sqrt{-1}$, and $b_1$ ,$b_2$ and k are ...
0
votes
0answers
35 views

Solving solely continuous system of ode's with matlab

I'm working with the numerical integration of the system of differential equations, $\dot{x}=f(x)$ with the vectorfield, $f(x)$ being solely continuous. Examples of the systems which I'm working on ...
0
votes
0answers
18 views

Transform and numerically solve an ODE with heaviside of form $F'(z) = g(F(z)) + d + c \mathbf{H}(\bar{z} - z)$

I have an ODE in $F(z)$ (really a system of equations, but assume the vastly simplified form here) $$ F'(z) = g(F(z)) + d + c \mathbf{H}(\bar{z} - z) $$ Where $g(\cdot)$ is some non-linear operator ...
1
vote
1answer
108 views

Solving Differential Equations theoretically and using matlab

i am trying to solve the initial value and elliptic boundary value problems below. but now i need some help solving them using matlab. for the elliptic problem, any method is ok, but for the initial ...
0
votes
2answers
43 views

Solving 2nd degree ODE with Euler method in MATLAB

I am trying to solve the equation below; $$\ddot{x}= -x + sin(t)$$ by the initial conditions; $$x(0) = 0 \\ \dot{x}(0)= 0$$ my MATLAB code is as follows: ...
0
votes
0answers
34 views

Errors in numericaly solving hyperbolic PDE in matlab

I am a beginner for PDE and I want to solve a hyperbolic PDE using matlab's builtin function hyperbolic(). However I am facing some erros and I could not resolve them. Can someone suggest or comment ...
4
votes
1answer
69 views

Due to numerical inaccuracy, the solution of a boundary value problems becomes negative

I treat a toy example to get my point across. In reality I have to deal with a much more complex model. Let us consider a one dimensional boundary value problem using the bvp5c solver in Matlab. Two ...
0
votes
0answers
59 views

How to represent Non-linear equation in State Space form? (To solve in MATLAB)

I have a set of differential equations. I am using state space representation to convert it 1st order form and then am solving via RK method using ode45 function. I know how to do this when the ...
1
vote
0answers
74 views

Numeric solution of third order ODE

I need to solve the following third order (non-linear) ODE by numerical methods: \begin{equation}\tag{1} h^{3} \dfrac{d^3 h}{d x^3} = h-1. \end{equation} By assumption, the solution should approach $ ...
1
vote
0answers
175 views

Change MATLAB code from Lax-Wendroff to Leapfrog

I want to see how leapfrog would look using this code, but I'm having issues implementing it. I think my biggest problem is adding in the $ U_j^{n-1}$ term, I just don't get the logic. Here's what ...
1
vote
2answers
39 views

How to plot not only the result but also the derivatives of an ode using the ode45 function in Matlab?

I have already successfully run a code for the simulation of the deflection of beams under different loadings. I used the Matlab program and the ode45 solver for Initial value Problems and bvp4c ...
1
vote
0answers
29 views

Matlab functions of variables

So I am writing a function to compute the following equations for an SIR model: So here's my code: ...
0
votes
1answer
36 views

Matlab using subscript variable

I'm trying to write a function in matlab but I don't quite know if it is working. In the equation line i have: xdot(2) = N_h * x; to signify: $$\frac{dy}{dt} = ...
1
vote
1answer
93 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
39 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
88 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
45 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
124 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
50 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 ...
0
votes
1answer
44 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
59 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
90 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
368 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
37 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
359 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
38 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
82 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, ...
0
votes
2answers
1k 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
26 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
68 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
222 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
28 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
122 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
128 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
486 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
37 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
131 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 ...
2
votes
1answer
1k 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
54 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
169 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
140 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
157 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
158 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 ...