New answers tagged

2 votes
Accepted

Post Processing of Solution and Plot of Coupled Partial Differential Equation Over a Semi-Circular Domain

I can't get the same exact plot for the second part. This is what I get This is the code. Feel free to change it as needed. ...
Nasser's user avatar
  • 135k
3 votes
Accepted

Solution and Plot of Coupled Partial Differential Equation Over a Semi-Circular Domain.II

Since you used NDSolveValue to solve the first PDE, then you can use that solution in the second PDE using sol1[r,θ] and not as ...
Nasser's user avatar
  • 135k
2 votes
Accepted

NDSolveValue result contradicts initial condition

Let's have a look at the mesh that is automatically generated: Needs["NDSolve`FEM`"] mesh = ToElementMesh[rg] Now, we evaluate the ic at the coordinates ...
user21's user avatar
  • 39.1k
0 votes
Accepted

Solve Differential Equation Numerically

First, consider the case d = 0: eq0 = y''[x] - Exp[y[x]] + Exp[-2 y[x]] + 1; with y'[0] == 30 and ...
bbgodfrey's user avatar
  • 60.4k
2 votes

Plot general solutions

...
Bob Hanlon's user avatar
  • 149k
3 votes

Plot general solutions

Mathematica does not give an explicit solution, because it can't integrate the integrals. In addition, even it it did, you can't plot the solution since $A$ is not known. Even giving $A$ a numerical ...
Nasser's user avatar
  • 135k
0 votes

A way to generalize my code for this non linear ODE problem

Here is an example how to solve for F. ...
Daniel Huber's user avatar
  • 45.4k
1 vote
Accepted

Adding symbolic functions and manipulating results of DSolve

$Version (* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *) Clear["Global`*"] eqn = y''[x] + w^2 y[x] == A Cos[q x]; Ask for the ...
Bob Hanlon's user avatar
  • 149k
3 votes
Accepted

Solution of Dimensionless Partial Differential Equation Over a Semi-Circular Domain

Another approach: When dealing with numerical solvers, discontinuities introduced by functions like HeavisideTheta can pose significant challenges. These ...
E. Chan-López's user avatar
4 votes

Solution of Dimensionless Partial Differential Equation Over a Semi-Circular Domain

Replacing HeavisideTheta with Piecewise makes it work. it could be a limitation of NDSolve. I do not know. ...
Nasser's user avatar
  • 135k
2 votes

Solve dimensionless PDE in polar coordinate over a semi-circular re

in V 13.3.1 ...
Nasser's user avatar
  • 135k
0 votes

Labelling vector state variables for solution of system of ODEs

I'm guessing the output of a working DSolve call is something like this: ...
Goofy's user avatar
  • 608
2 votes

A code for producing system of equations for central difference method

to generate the equations, just use Table command. To solve them is different issue. Since they are non-linear. $$ y^{\prime\prime}=y+\sin\left( y^{\prime}\right) $$ 3 point centered difference for $...
Nasser's user avatar
  • 135k
1 vote
Accepted

Solving differential equation with hyperbolic functions

These is a simple integral problem ...
Roland F's user avatar
  • 2,244
1 vote
Accepted

How to plot a differential equation?

If Q,a are given constants your equation gives an implicit result x[R] ...
Ulrich Neumann's user avatar
1 vote
Accepted

FEM solution for onedimensional boundary value problem doesn't evaluate

That's a typo: You used "MaxCellMeasure->0.1" but you should use: "MaxCellMeasure" -> 0.1
user21's user avatar
  • 39.1k
2 votes

How to numerically solve symmetric top with fixed point motion equations with Mathematica?

This is Manipulate of Symmetric top gyroscope motion. It has many options to explore the dynamics. I wanted to improve it more, but no time now. But it works and has many options to play with. Code <...
Nasser's user avatar
  • 135k
0 votes

Solving Geodesics from Christoffel Symbols

In an earlier comment I made, I mentioned that the term Exp[g[t] + f[r]] was common to all the spatial terms in your metric, and that you might want to consider factoring the exponential and ...
jdp's user avatar
  • 621
1 vote

Axisymmetric cylindrical Laplace's equation with a boundary condition at infinity

Oblate spheroidal coordinates are ...
Roland F's user avatar
  • 2,244
0 votes

How to force Wolfram solve the ODE with respect to h[s]?

but what should I print? Mathematica can't solve it analytically. Even if you replace all other terms by parameters ...
Nasser's user avatar
  • 135k
0 votes

How to reduct the terms of differential equation?

The dots . in the definition of detG seem to be wrong I think Try ...
Ulrich Neumann's user avatar
1 vote

Mathematica thinks that an initial condition is a boundary condition

Here is a way to solve it. Note that there is no need for the NeumannValue, as the 0 NeumannValue is the default. I have changed the initial condition on R and gave ...
user21's user avatar
  • 39.1k
3 votes
Accepted

Plotting Dengue Infection Prevalence Sensitivity to Biting Rate Variations

...
Alex Trounev's user avatar
  • 41.1k
2 votes
Accepted

Set of differential equations with trigonometric functions and a derivative squared

In this post we answer the question how to extend periodic solution t[y] up to $4 \pi$ and how to compute solution in a case of ...
Alex Trounev's user avatar
  • 41.1k
4 votes
Accepted

Modeling Infection Spread among Different Age Groups with Contact Matrix

I really enjoy your epidemic series :-) It is always better to decouple the weedy details of a specific model from the key question. Key question should be purified to bare minimum. Perhaps helpful, --...
Vitaliy Kaurov's user avatar
3 votes

Set of differential equations with trigonometric functions and a derivative squared

Try numerical solution NDSolve[...,Method->"StiffnessSwitching"]. Solutions seem to be complex, is this intended? ...
Ulrich Neumann's user avatar
11 votes
Accepted

The Poincaré Sections of Yang-Mills-Higgs System

I'm currently co-developing an interactive tool for extracting Poincaré sections from Hamiltonian systems. I've got a preliminary version up and running, so feel free to use it. It's available on the ...
E. Chan-López's user avatar
9 votes

The Poincaré Sections of Yang-Mills-Higgs System

If we take icv from your second example and define Hamiltonian as ...
Alex Trounev's user avatar
  • 41.1k
1 vote
Accepted

Evaluation and plot the result of NIntegrate obtained from NDSolve

Your definitions (keep h undefined) ...
Ulrich Neumann's user avatar
4 votes
Accepted

Solving coupled differential equations involving the square of the derivative

There are 2 branches in the analytical solution with variable p=pt, ...
Alex Trounev's user avatar
  • 41.1k
3 votes

Solving coupled differential equations involving the square of the derivative

I'll let you do the plotting. But these are not coupled ode's. The y[s] ode does not depend on t[s]. So you can solve that on ...
Nasser's user avatar
  • 135k
0 votes

Solving Geodesics from Christoffel Symbols

On my first post, I found the geodesics equations found from Christoffel symbols: ...
HMZ's user avatar
  • 11
0 votes

Solving Geodesics from Christoffel Symbols

Euler-Lagrange equation for geodesics produce the Christoffel symbols as coefficients of the products of velocities in the equation of motion, solved for the second order derivatives of the ...
Roland F's user avatar
  • 2,244
0 votes

How can I obtain the temperature profile from a pressure profile of a partially filled rotating cylinder?

For getting an image from the above code define $h, \rho, \omega$ and r[x_,y_]:=Sqrt[x^2+y^2] The ideal gas local state equation for a volume element reads $$p(r,z) \ r^2 \ d\phi\ dr\ dz = \rho(r,z)...
Roland F's user avatar
  • 2,244
1 vote

Plot the evaluated results of NDSolve

modified Here my approach (Mathematica v12.2) solving the problem with Shootingmethod Method->"Shooting" ...
Ulrich Neumann's user avatar
1 vote

Why does DSolve show result as {}?

(y2[x]/y1[x])' should be D[y2[x]/y1[x], x] since ' or ...
cvgmt's user avatar
  • 61.3k
3 votes
Accepted

What are some ways to speed up calculations

These can be calculated once: Bs = {0, 0.5, 1, 2, 5, 7}; entable = Table[en[B], {B, Bs}]; Then using the pre-calculated table ...
MelaGo's user avatar
  • 6,831
2 votes
Accepted

Axisymmetric cylindrical Laplace's equation with a boundary condition at infinity

Mathematica cannot DSolve a general linear PDE with nonconstant coefficients. The Laplace equation for cylindrical coordinates separates into products of three functions of the variables. $$\frac{1}{r}...
Roland F's user avatar
  • 2,244
1 vote

How to numerically solve symmetric top with fixed point motion equations with Mathematica?

The use of the Hamilton function (energy) in terms of the velocities for deriving equations of motion is always a dangerous mistake. Use the Lagrangian equations (trivial with two constant angular ...
Roland F's user avatar
  • 2,244
1 vote
Accepted

Second order Poisson ODE

This is some sort of a scaling problem: ...
user21's user avatar
  • 39.1k
0 votes

NDSolve problem with conservation laws

Replacing one IC seems to work: ...
I.M.'s user avatar
  • 2,761
2 votes
Accepted

Plot several graphs of a function density distribution using Table

DensityPlot has the Attibute "HoldAll": Attributes[DensityPlot] {HoldAll, Protected, ReadProtected} Therefore, if you want to evaluate "ps[B]" ...
Daniel Huber's user avatar
  • 45.4k
1 vote
Accepted

Need help solving cylindrical Laplacian

You'd need to use Cartesian coordinated (or use a RegionSymmetry). Something like this should get you started: ...
user21's user avatar
  • 39.1k
1 vote

How do I get a coefficient matrix from a second order ODE's system?

Looking what you have done aboove in your ask, I did it (turn a 2nd order ODE system in 4 equations 1st order ODE system). But, as I said, I need to comper this 2 situations (2nd order ODE system, ...
Victor Pinto Msc Student's user avatar
3 votes

How do I get a coefficient matrix from a second order ODE's system?

\begin{align*} x^{\prime\prime} & =\frac{k_{2}}{m_{1}}y-\frac{k_{1}+k_{2}}{m_{1}}x\\ y^{\prime\prime} & =\frac{k_{2}}{m_{2}}x-\frac{k_{3}+k_{2}}{m_{2}}y \end{align*} Let $x_{1}=x,x_{2}=x^{\...
Nasser's user avatar
  • 135k
1 vote

How do I get a coefficient matrix from a second order ODE's system?

Using CoefficientArrays: ...
E. Chan-López's user avatar
2 votes
Accepted

SIR Parameter Estimation in Mathematica

It looks like we try to estimate parameter $\beta$ with known $\gamma, \mu$ using one point only reportedData = n*0.08. In this case we can compute $\beta$ as ...
Alex Trounev's user avatar
  • 41.1k
3 votes
Accepted

Convert R code to Mathematica code of Poisson log-likelihood for the epidemic curve

It looks like we need to compute $\beta, \gamma$ using optimization with NMinimize in the form ...
Alex Trounev's user avatar
  • 41.1k
2 votes
Accepted

NDSolve is not picking the correct initial condition

This is a discretization problem. One needs to refine the spatial grid. One can see that the OPs NDSolve does in fact satisfy the initial condition, but only at 25 ...
Michael E2's user avatar
  • 233k
2 votes

NDSolve is not picking the correct initial condition

This is a problem of machine precision. Rationalize all constants and increase "WorkingPresision" to e.g. 26 ...
Daniel Huber's user avatar
  • 45.4k

Top 50 recent answers are included