Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 6358

Questions on the use of numerical functions NIntegrate and NDSolve.

1 vote
Accepted

How to solve in principle such coupled ODEs

I think substituting a in the definition of int, which is called by a is trouble, and what you really need is to make sure int isn't evaluated when z[t] isn't a number. The following seems to work, a …
Chris K's user avatar
  • 20.4k
2 votes

Stability of the numerical methods for SDE

The strength of noise σ = 20 seems large so that it can overwhelm the mean trend. Luckily Mathematica can give some analytical insights into this stochastic process. Clear[σ] proc = StratonovichProc …
Chris K's user avatar
  • 20.4k
4 votes

Solving this system of differential equation with NDSolve

I fixed the exp that @cvgmt noted, pulled τc and Ip out of NDSolve, and got rid of the extra initial conditions. τc[t] := (η L^3)/(8 c π^2) (n[t] (σe11 - σ111) V)^2; Ip[t] := 2.5 E^(-(t - 8)^2/(2 sd)) …
Chris K's user avatar
  • 20.4k
4 votes

Solve PDE system with mixed parabolic–elliptic equations

As I commented above, replacing 0 with time derivatives in the $w$ and $z$ equations times a small number $e$ lets NDSolve solve these equations. pts = 100; T = 0.2;(*Time integration -- the system e …
Chris K's user avatar
  • 20.4k
3 votes

Problem finding separatrices for ODE system

Sorry, I don't have time for a real answer right now, but here are some ideas that might help you or someone else come up with a robust solution. If you plot the function being solved inside sepICS y …
Chris K's user avatar
  • 20.4k
5 votes
Accepted

NIntegrate failed to converge and why?

Simply increasing the MaxRecursion gives an answer without the NIntegrate::ncvb message: paverage = NIntegrate[p1, {t, 40, 40 + period}, MaxRecursion -> 100]/period (* {-311.506} *) BTW, looking …
Chris K's user avatar
  • 20.4k
3 votes
0 answers
97 views

Area / NIntegrate over a Region fails depending on variable name

I'm trying to plot how the Area of an ImplicitRegion defined by four (ugly) inequalities depends on parameters. It seems I need to Simplify first. a12 = \[Rho]/A; a13 = A \[Rho]; a21 = A \[Rho]; a23 …
Chris K's user avatar
  • 20.4k
3 votes
Accepted

Locating Periodic Orbits

You could use FindRoot to tweak the period (tmax) and x0 to get back to the starting point, with the other coordinates of the system fixed: map[H_,om_,x0_?NumericQ,y0_,ux0_,uy0_?NumericQ,tmin_,tmax_? …
Chris K's user avatar
  • 20.4k
3 votes

NDSolve not working for certain parameters

The derivatives on the left hand side of your differential equation are multiplied by f[z], which is zero at z=1. This leads to the error messages Power::infy: Infinite expression 1/0. encountered. …
Chris K's user avatar
  • 20.4k
3 votes
2 answers
284 views

WhenEvent applied at initial time

Can a time-based WhenEvent be triggered at the initial time within NDSolve? As a minimal example, a pulse is to be applied every integer time t, but NDSolve skips the initial pulse at t=0: sol = NDS …
Chris K's user avatar
  • 20.4k
2 votes

Force NDSolve to choose given branch at a critical point

Here's a way to numerically get the "curvy forks" of the pitchfork in the second example, using a pseudo-arclength continuation function I hacked together earlier. First, define TrackRootPAL from the …
Chris K's user avatar
  • 20.4k
0 votes

Locating periodic orbits with Mathematica

Not an answer, but an extended comment. I am not sure there is a periodic orbit in your implementation of this system in Mathematica. Plot[Evaluate[x[1.303900184464743, 3.81159928041479][t] /. solp] …
Chris K's user avatar
  • 20.4k
3 votes

Hybrid ODE simulation with very small parameters

Your code works for me with L = C1 = .001, it's just slow (326 seconds). Looking at the output shows why: Plot[u[t] /. sol, {t, 0, tmax}, PlotPoints -> 2000] Plot[u[t] /. sol, {t, tmax - 0.01, tmax} …
Chris K's user avatar
  • 20.4k
8 votes

How to solve this PDE for steady state?

Following @user21's suggestion to look at this example in the docs, I made the following tweaks: vars = {p[t, x1, x2], t, {x1, x2}}; \[CapitalOmega] = Rectangle[{0, 0}, {3, 3}]; pars = <|"ModelForm" - …
Chris K's user avatar
  • 20.4k
2 votes

How to plot poincare map as shown in below image for Duffing equation?

If you run your first code for the same amount of time as the Poincare section, you'll see that they do agree (and that they're not particularly interesting parameter values): T = 2*Pi/1.2; sol = NDS …
Chris K's user avatar
  • 20.4k

15 30 50 per page