Questions tagged [modeling]

Questions about approaches for simulating physical systems or phenomena by building from related understanding and basic principles.

Filter by
Sorted by
Tagged with
1 vote
0 answers
53 views

How to take a derivative of a function with respect to another function inside the function?

I have these two equations: ...
user avatar
4 votes
1 answer
564 views

My model has not finished evaluating in more than a day so can't test if it works, what is wrong with it?

Hello I have this modified monocentric city model that I have been working on for a while. Sorry for the long post, I wanted to add the whole code, because it's all connected. My suspicion is that it ...
user avatar
2 votes
1 answer
107 views

The nonlinear state-space model of a spherical pendulum cannot be linearized and cannot be controlled?

I am attempting to model and control a spherical pendulum. I have derived the equations as follows: ...
user avatar
  • 23
0 votes
0 answers
66 views

How to plot elements from an array?

Im trying to solve a differential equation for a range of parameters (1->4). I then want to automatically plot a graph for each of those parameters. ...
user avatar
  • 1
0 votes
0 answers
177 views

Error: "ReplaceAll: ... is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing." when solving a root

I have this code: ...
user avatar
5 votes
2 answers
227 views

Showing that a Hopf bifurcation exists?

I have the following system of ODEs: dx/dt = a/(1 + z) - Q*z dy/dt = Qx - qy dz/dt = qy - cz/(K + z). Assuming K = 1, Q = q < c, and a = c*(Sqrt[c/Q] - 1), is there a way to use Mathematica to test ...
user avatar
11 votes
1 answer
294 views

Generating random sequence of integers with ordering constraints

I would like to write a Mathematica routine for generating random musical melodies that obey (some of) the constraints of traditional tonal harmony. For simplicity's sake, I'm interested only in ...
user avatar
  • 1,857
0 votes
1 answer
164 views

Can Mathematica do thermal/mechanical analysis of modeled solid systems?

I want to do thermal and mechanical analysis of various parts which may have complicated geometries. I am contemplating buying SolidWorks because it does this: you model the part and then use their ...
user avatar
  • 3,896
4 votes
0 answers
64 views

Why is EstimatedProcess so slow for a vector ARProcess?

I'm trying to fit some 4 x N data to a vector auto-regressive model. However, EstimatedProcess is very slow for this. For a 4-th order vector AR process, it takes more than 10 seconds (for N approx. ...
user avatar
  • 176
2 votes
1 answer
74 views

select the right numbers based on a condition

I want to optimize my stock portfolio based on three components: the price of the different stocks the number to buy of each of the stocks the expected return of each stock (after 12 months) For ...
user avatar
1 vote
0 answers
54 views

Non linear differential equation plot [closed]

Consider the following paper: https://reader.elsevier.com/reader/sd/pii/S0096300306007715?token=2B98E3B12F1E623C99A0787996469AF36E8EF230F6ED5289EAFB60B64CE79A6ACCF74B946A34F3370C65D4FC99018648&...
user avatar
  • 465
8 votes
1 answer
318 views

Can LearnDistribution learn conditionality?

I would like to apply LearnDistribution to multivariate conditional distributions. Here's a simple artificial example: ...
user avatar
  • 30.4k
19 votes
2 answers
668 views

Large deformation of solids

Link to notebook with this question and code I'd like to understand how large deformations of solid mechanics work and how they are implemented. For this am looking at the following reference problem: ...
user avatar
  • 36.1k
0 votes
1 answer
81 views

NDSolve not finding the right solution for a mass hanging of a thread

My NDSolve isn't predicting the right trajectory for one particular case of a problem. System Consider a mass vertically hanging by an almost inelastic thread. The ...
user avatar
  • 902
1 vote
2 answers
72 views

How to model the following system of ODE's in Mathematica with plots of the solution?

Consider the following (i) \begin{align} \frac{d S}{dt} &= -\frac{\beta S I}{N}\\[2ex] \frac{dI}{dt} &= \frac{\beta S I}{N} \end{align} Where $N=S+I$ is the total population. (ii) \begin{align}...
user avatar
  • 465
1 vote
1 answer
77 views

Help with plotting the bifurcation diagram $R_0$ vs $I.$ [closed]

I am working on the paper "A short study of an SIR model with inclusion of an alert class, two explicit nonlinear incidence rates and saturated treatment rate" by Kumar, Nilam and Kishor and ...
user avatar
  • 113
11 votes
3 answers
514 views

Mass Transport Model

I've asked similar questions before about Mathematica's Mass Transport model. My aim is to model these systems and show how they change by manipulating various parameters. This time it's the following ...
user avatar
  • 351
1 vote
1 answer
342 views

Solving time dependent Schrodinger equation for a wavefunction and harmonic oscillator [closed]

How can I obtain a GIF/graph similar to these ones here by solving the time-dependent Schrodinger equation $$ i\hbar\frac{\partial ψ(x,t)}{\partial t} = -\frac{\hbar^2}{2m}\nabla^2ψ(x,t) + V(x)ψ(x,t)$$...
user avatar
  • 327
5 votes
1 answer
147 views

Mass Transfer Value

I'm trying to model the following boundary condition using MassTransferValue. $$ D_A \frac{\partial[A]} {\partial x} + D_B \frac{\partial[B]} {\partial x}+ D_C \...
user avatar
  • 351
8 votes
2 answers
314 views

How to add an attractive potential (migration term) named component to Mass Transport PDE

Wolfram Mathematica 12.2 now features "Named Partial Differential Equation Terms" For specific physics fields, relevant PDE terms have been packaged as components and augmented with ...
user avatar
  • 29.3k
1 vote
0 answers
96 views

2D transient heat equation resolution

I'm writing a code to get the analytical solution mentioned in Sun et al., 2013. I will copy here the passages needed to solve the equation. The 2D transient heat equation is: First of all, I set the ...
user avatar
3 votes
0 answers
81 views

Graph embedding constrained to a surface?

Have been contemplating it for a while, but did not dare to post as I felt like this must be a major undertaking to implement. Then saw the excellent answers to a recent question RegionPlot3D KnotData ...
user avatar
1 vote
0 answers
52 views

Microcontrollerembedcode unable to connect to Arduino Yun

Hi Mathematica enthusiasts, I am trying to follow this tutorial off Wolfram reference for microcontrollers Real Time Data Acquisition I have an Arduino Yun Rev2 hooked up exactly as it is from the ...
user avatar
0 votes
1 answer
55 views

finding FWHM of a dataset with unknown mathematical equation

I have a dataset. I have plotted using "Listloglinearplot". Now I need to find the FWHM (full width half maxima) of the same, However I dont know which mathematical eqution describes best to ...
user avatar
  • 309
0 votes
0 answers
84 views

NDSolve for ODE-PDE Problem

happy holidays, I am solving a coupled ODE - PDE system -for simplicity all coefficients are taken as 1-. I checked other questions on the issue but couldn't find any suitable answer or comparison. ...
user avatar
  • 191
0 votes
0 answers
63 views

How to formulate NDSolve[...] for a two-sector SIR model

The following Code aims to simulate the employment effects of a pandemic, drawing on the conventional SIR model. I extended the SIR model with two economic sectors (...
user avatar
  • 4,391
3 votes
1 answer
108 views

Does mathematica have support for mixture models?

Does Mathematica have support mixture models? Similar to the R language libraries mclust or ...
user avatar
  • 2,301
6 votes
3 answers
848 views

Time dependent Schrödinger equation in 2D

I have the following Schrödinger equation in $2D$: \begin{cases} \partial_t \Psi(x,t) = V(x,t) \Psi(x,t) \quad x \in [-10,10]^2\\ \Psi(x,0)=\exp( \frac{1}{2} (-x^2+y^2)) \end{cases} where the ...
user avatar
  • 401
0 votes
1 answer
92 views

Equation Plotting

I'm using the mean field theory approximation and the Ising Model for magnetization to come up with the following equation: m(T) = tanh(m(T)/T) where T is an ...
user avatar
2 votes
3 answers
184 views

Nonlinear Difference Equations [closed]

How can I plot the nonlinear difference equations?
user avatar
1 vote
1 answer
193 views

Smoothing a function after interpolation + trying to fit 3D data into model without accurate prior knowledge

I have a physical problem simulation that generates this data set in the two cylindrical coordinates $(r,z)$ (doesn't include $\phi$ dependence). The data set (see .wdx file) is in the flattened form $...
user avatar
0 votes
0 answers
121 views

Magnetostatics analysis of Switched Reluctance Motor in Mathematica

Accidentally stumbled upon magnetostatic calculation in Mathematica. https://www.wolfram.com/language/12/nonlinear-finite-elements/magnetostatics.html?product=mathematica I would like to ask a ...
user avatar
  • 1,721
2 votes
1 answer
121 views

Linear Quadratic Integrator

With a given linear drive system ...
user avatar
2 votes
1 answer
164 views

How to Make a Bifurcation plot of a non linear system of ODEs

I am modelling bacterial growth. I have a quite difficult non linear systems of ODE's. I have 2 bacteria that i'm modelling with competition, as wel as transfer to a different place. so there are 2 ...
user avatar
  • 21
0 votes
0 answers
93 views

Error in Monte Carlo simulation. Now Random walk (dotted curve) doesn't fit to the analytical curve (dashed curve)

I've been trying to code a kinetic monte carlo simulation for a system of consecutive chemical reactions using a fixed (repaired) code that the user flinty gives me in the last questions I post: ...
user avatar
  • 13
3 votes
1 answer
216 views

Stiff System of ODEs: NDSolve Convergence Issues

I have tried to use NDSolve for solving 4th order coupled ODEs problems (see the attached codes). The MMA solver fails to solve this problem. ...
user avatar
  • 1,746
2 votes
1 answer
155 views

NDSolve Convergence Issue for Coupled Field Problems

I have tried to use NDSolve to solve a coupled field Eqs (see the attached Codes). The MMA solver seems to failed to converge to the requested accuracy or precision within 100 iterations ...
user avatar
  • 1,746
1 vote
1 answer
82 views

Strange error not found in a monte carlo code, Infinite expression 1/0 encountered

I've been trying to code a kinetic monte carlo simulation for a dimerization reaction, 2M ---> D. However I have a kinetic Monte Carlo code for a first order decomposition reaction of AIBN (that's ...
user avatar
  • 13
4 votes
2 answers
212 views

Find the best fit with some conditions

I have this code to find the best values for $l$, $s$ and $j$: ...
user avatar
  • 1,252
8 votes
2 answers
317 views

Two-dimensional Laplacian coupled with another equation leading to a BVP with integral bc(s)

I have the two-dimensional Laplacian $(\nabla^2 T(x,y)=0)$ coupled with another equation. The Laplacian is defined over $x\in[0,L], y\in[0,l]$. On manipulating the second equation (which I have ...
user avatar
  • 143
1 vote
2 answers
147 views

FindFit problem, some models work -- and some do not

I asked this question. Answers and comments were appreciated. But (some) of the comments did not make satisfied. [Maybe due to my bad English I did not describe my problem very well]. Let me try ...
user avatar
1 vote
3 answers
156 views

FindFit, FindFormula, Fit, NonlinearModelFit - Which one to use? (I got no good curves & plots)

See this code, what mistake I did? (I got no plot) ...
user avatar
0 votes
1 answer
40 views

Having trouble with NDSolve [closed]

I'm trying to plot the solutions to the following set of differential equations, I'm doing this through NDSolve with the following code, ...
user avatar
  • 103
2 votes
1 answer
84 views

FindFit low speed when fitting polynomial coefficients: is it possible to significantly increase the speed?

I work in Mathematica with a Butterworth filter, the transfer function of which depends on the selected order and cutoff frequency. I want to evaluate the change in the location of the roots on the ...
user avatar
  • 1,721
2 votes
1 answer
125 views

How to model the movement of a mass over a dome?

I'm trying to replicate the graphs and animation found in this page that studies the movement of a mass over a dome solving numerically the differential equation ...
user avatar
4 votes
1 answer
80 views

Trying to recreate a plot which tracks the age of individuals inside a compartment model

I am using a compartment model from this paper. I am trying to recreate Figure 6. I will be honest, I have no clue how to approach this. The paper doesn't give information on how to achieve the ...
user avatar
  • 57
2 votes
1 answer
326 views

Find best equation for data and the area under curve

How can I find the best formula that describe the following Figure and also find the area under the curve (the numerical value): The data for the figure can be found here: https://pastebin.com/...
user avatar
  • 421
1 vote
1 answer
69 views

How can I get a plot of "surface area coverage" of a parametric plot?

I have a parametric function defined by the x and y functions: ...
user avatar
0 votes
0 answers
72 views

Why do I keep getting these error messages?

I am trying to fit a parametric differential equation system to the data of the infection cases in Hungary. I keep getting the error messages: ParametricNDSolveValue::ndcf: Repeated convergence ...
user avatar
  • 39
3 votes
0 answers
73 views

Simple neural network with feedbacks in state-space form

Having studied more or less in detail the mechanisms of working with the state-space that Mathematica provides us with, I asked myself: can these tools be applied to neural networks? This article ...
user avatar
  • 1,721