All Questions

Filter by
Sorted by
Tagged with
3
votes
2answers
124 views

Initial values of position (x) and speed (v) of a particle visualizing using Mathematica

$$\vec{F}(\vec{r})=-m\omega^2\begin{pmatrix}x\\4y\end{pmatrix}$$ I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the <...
0
votes
1answer
254 views

Solving Differential Equation System for HIV Treatment Model

I was working on a project about optimal strategies for HIV treatment, models used from [Butler, Kirschner, and Lenhart] 1997. This model explains the spread of HIV viruses in the human body, where ...
3
votes
1answer
228 views

How to directly input calculated Geodesic differential equation into *NDSolve*

I am trying to find the trajectory of a test particle around a relativistic object. Initially, I was trying the Kerr metric as spacetime but the final simulations clearly were not correct as I saw the ...
1
vote
1answer
66 views

Infinite potential, prevent value to go beyond zero, initial value problem

How do you make a wall potential in Mathematica. Meaning : I want my potential to have a wall at 0 : $ U(x)=\left\{ \begin{split} & x>0 : U(x) = f(x)\\ &x=0: U(x)=U_0 \\ & x<0: U(x)=...
2
votes
0answers
74 views

NDSolve can solve two systems of equations separately but not simultaneously

I want to solve a system of coupled equations. After facing problems solving the coupled system, I reduced it to both of the systems uncoupled. Even uncoupled, the equations will not solve ...
0
votes
1answer
340 views

Gross-Pitaevskii equation with NDSolve

I want to solve the Gross-Pitaevskii equation with NDSolve, I tried the following code: ...
1
vote
2answers
342 views

Schrödinger equation with a potential step

I want to simulate a Gaussian wave packet colliding with a potential step. I tried this (it indicates what do I want to solve, however I know it is naive): ...
3
votes
1answer
414 views

Schemes for nonlinear advection equation

I am working in the traffic flow problem using the Lighthill-Whitham-Richards model together with the Greenshields equation. The equation of that model is this: $$ \frac{\partial\rho}{\partial t}+v_{...
0
votes
0answers
73 views

How to organize code for simulating many ODEs?

I have a large model with many variables (about a hundred) and many differential equations (non-linear). What is the best way to handle a system this size in Mathematica? Note that I am not asking ...
2
votes
1answer
127 views

How to use FindFit to do kinetic simulation?

I'd like to simulate the chemical kinetic model by fitting the experimental data. Here are my codes for simulation. ...
3
votes
1answer
235 views

Time varying delay differential equations

I would like to know if it is possible in Mathematica to simulate a differential equation with varying delay for example the logistic equation: $$x'(t)=x(t)(1-x(t-\tau(t)))$$ where for example $\tau(...
3
votes
0answers
96 views

Why does the domain of an interpolating function not match the corresponding ParametricNDSolve solution range?

Question I had believed - and mostly observed - that when I use ParametricNDSolve the obtained ParametricFunctions given as the ...
2
votes
1answer
403 views

Manipulate initial conditions of a DE

I have a differential equation that I want to solve numerically, $$y''(t)+3H(t)y'(t)+m^2y(t)=0, \quad H(t)^2=\frac{1}{6M_p^2}(y'(t)^2+m^2y(t)^2)$$ $$N=\int H(t)dt$$ I want to plot $y'(t)$ vs $N$ but I ...
4
votes
2answers
332 views

Calculating the current through coil with a flyback diode using NDSolve

I plan to simulate the current through a coil with flyback (or freewheel) diode for an arbitrary voltage signal (square or PWM modulated signal is possible). You can find the circuit diagram over ...
1
vote
0answers
105 views

How to avoid unnecessary calculations in a numerical simulation and improve performance? [closed]

Corresponding to the previous question I posted: Discontinuous boundary condition distorts in the numeric solution. ...
1
vote
0answers
103 views

How to define inclusions in FEM/NDSolve? [closed]

I am trying to simulate the compaction process of hot mix asphalts and want to do this with mathematica's FEM libraries. How can I define inclusions in meshes (i.e aggregate particles in the binder) ...
7
votes
1answer
209 views

Issues with modeling pulses in a very simple system of DAEs

Bug introduced in 10.4.1 or earlier and fixed in 11.0.0 Bug has been confirmed by WRI [Case:3594387]: It does appear that the NDSolve function is not behaving properly in this case and an incident ...
11
votes
1answer
478 views

Beam deformation due to localized force distribution

I would like to simulate the deformation of a beam which is fixed on one end and has some localized forces applied along the top. I have been inspired by this Mathematica example: http://www....
2
votes
2answers
523 views

Solving coupled first-order autonomous differential equations

I am trying to run a simulation of a circuit to observe chaotic behavior, and have obtained a set of differential equations from an analysis of the circuit. I thought perhaps I could produce a plot ...
5
votes
2answers
893 views

Evaluation problems with NDSolve using the fixed step ExplicitEuler-Method

Motivation I am using Mathematica to implement System Dynamics (SD) models, e.g. differential equation models as applied to management/economic problems following the "methodology" of Jay W. ...
0
votes
1answer
127 views

My simulation is not never finishing and it is taking so much time?

I am running simple code which involves calculation of two first order differential equations.It is taking so much time and i am unable to get the results as the simulation is never finishing. ...
1
vote
1answer
386 views

Simulate a polygon bouncing with collision detection inside a circle/polygon

Simulate a polygon bouncing with collision detection inside a circle/polygon. the example can be see in help page by searching WhenEvent; ...
3
votes
0answers
158 views

How to control pedestrians to enter the simulation region with random functions?

I am working on simulating crowds of a cross-typed region, given that pedestrians entering from 4 gates of north, east, west and south, ...
8
votes
1answer
623 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
17
votes
2answers
632 views

Partial Differential Equation in Parallel

is there any native way to implement multi-core parallel solving of PDE in Wolfram Mathematica? WM 10 now supports Finite Elements Method, but it is actually useless without parallelization. Usually ...
33
votes
4answers
7k views

Animation of double pendulum

Sadly, I am a completely newbie. I am studying Physics and in our theoretical physics class we got the task to solve the double pendulum using Mathematica. We just got the program, but no introduction ...
2
votes
1answer
560 views

NDSolve with arrays and Tables of Equations and WhenEvent

I've been toying around with NDSolve for a while, and read through the website. By doing so I discovered that I could use it for vectors and arrays with much pleasure. So I wanted to write a simple ...
8
votes
1answer
1k views

Detecting a collision in n-body simulation with NDSolve

Consider this three-body system: ...
4
votes
5answers
900 views

Problem using WhenEvent to constrain solution

Note: This question has also been posted at the Wolfram Community Problem: Simulate pressure in volume 1 and 2 for 1 second. The circuit is as follows: From this I set up the governing DE for both ...
6
votes
1answer
589 views

Changing a wave simulation

I want to adjust some code that I found on this Wolfram Demonstration: http://demonstrations.wolfram.com/WaterRipplesPassingThroughASlit/ Basically it shows a wave passing through a single slit. I ...
1
vote
2answers
1k views

Running a Numerical Simulation on a System of Differential Equations with unique initial conditions

I have a system of differential equations as follows: ...