Tag Info

Hot answers tagged

8

For the first question: you can use ForAll (as you used $\forall$!) also in Mathematica. Once you have acquired a region, you can minimize argument constrained on it: ArgMin[{n, Resolve[ForAll[m, m >= n && Element[n, Integers], m^2 0.2 (1 - 0.2^2)^m < 1 && m > 0]]}, n] 227 If you take a hard look at the statement ...


7

from the documentation of WhenEvent: WhenEvent expressions can be used in NDSolve, NDSolveValue, ParametricNDSolve, ParametricNDSolveValue, DSolve, and DSolveValue. so I think no, you can't use WhenEvent within FindMinimum. You might be able to do some things similar to what WhenEvent can be used for with the EvaluationMonitor or StepMonitor options ...


5

Suppose λ[ω_, θ_, ϕ_] := Sin[ω - θ] Cos[ϕ] l[θ_, ϕ_] := 10 Sin[θ] Sin[ϕ] then Plot3D[{(ω /. Last@FindMaximum[λ[ω, θ, ϕ], {ω, π}]), l[θ, ϕ]}, {θ, 0, π/4}, {ϕ, 0, π/4}] The desired answer is the orange surface when it is above the blue surface, which is obtained from Plot3D[If[(ω /. Last@FindMaximum[λ[ω, θ, ϕ], {ω, π}]) > l[θ, ϕ], (ω ...


5

define GammaEq so that it takes only numeric arguments, Clear[GammaEQ] GammaEq[ω_?NumericQ, rules_] := ... and give FindMinimum a good starting point: FindMinimum[Abs[GammaEq[2*π*ω, rules]], {ω, 6}] {0.62902, {ω -> 6.39389}} As for the code, since this is a purely numerical function, you can speed it up tremendously by applying your rules ...


4

According to the documentation, for the Nelder-Mead method, "Tolerance" is the tolerance for accepting constraint violations I think you actually meant to use either PrecisionGoal or AccuracyGoal, as per the documentation under NMaximize, depending on whether you want relative or absolute convergence criteria. Indeed, if you set AccuracyGoal to a ...


4

What you want to do is called "event location" and is realized with NDSolve using WhenEvent. In principle you give it a predicate that is true when the spaceship is at periapsis and NDSolve uses a root finding method to figure out exactly when this happens. G = 6.672*10^-11; m[1] = 6.4185*10^23; m[2] = 100; p[1] = {0, 0}; p[2] = {1000000, 1000000}; v[1] = ...


3

G = 6672*10^-14; m[1] = 64185*10^19; m[2] = 100; p[1] = {0, 0}; p[2] = {10^6, 10^6}; v[1] = {0, 2500}; v[2] = {0, 0}; tmax = 1000; soln = NDSolve[{ x[1]''[t] == -(G m[1] (x[1][t] - x[2][t]))/ Norm[{x[1][t], y[1][t]} - {x[2][t], y[2][t]}]^3, y[1]''[t] == -(G m[1] (y[1][t] - y[2][t]))/ Norm[{x[1][t], y[1][t]} - {x[2][t], y[2][t]}]^3, ...


3

WhenEvent is not supported by FindMinimum. It is supported by methods such as NDSolve and ParametricNDSolve which produce interpolation functions themselves. So without a more specific function to work with I can suggest you to do the following (I am doing something similar right now) Write your interpolation as a result of one of the Solve methods so that ...


2

Collecting timings for a range of starting values for the p parameter shows that the timing is critically dependent on this value. The peak happens to be close to the fitted value of p, 0.215. I assume that the gradient in the neigborhood is so low that the algorithm needs many iterations to converge. The multidimensionality of the situation won't help ...


2

I wanted to give an answer that is based on George's one but uses the Eigenvectors instead of the Eigenvalues, as I noticed that in the crossing regions the Eigenvalue method has issues (jumps in the Eigenvector plot) whereas the Eigenvectors even at intersections of the Eigenvalues are orthogonal and thus can be easily distinguished. What I did is simply ...


2

expr1 = Sum[50/10000*1/4*1/4*n*97/100*Exp[-h1*1/4*n], {n, 1, 4}] - Sum[1/2*1/4*n*97/100*(Exp[-h1*1/4*(n - 1)] - Exp[-h1*1/4*n]), {n, 1, 4}]; expr2 = Sum[77/10000*1/4*1/4*n*97/100*Exp[-h1*1/4*n], {n, 1, 4}] + Sum[77/10000*1/4*1/4*n*94/100*Exp[-h2*1/4*n], {n, 5, 8}] - Sum[1/2*1/4*n*97/100*(Exp[-h1*1/4*(n - 1)] - Exp[-h1*1/4*n]), {n, 1, 4}] + ...


1

Creating a Table won't help you. You need to create an array (list) for your individual variables like eVars = Array[e,n] where n is some fixed integer. Then you need to create an appropriate objective function, that mixes all the components together in the way you want them to interact and yield a real value, not some kind of vector. From a ...


1

RegionPlot3D[-a + b + c > 0 && -a + b + c^2 > 0 && a > 1 && b > 0 && c > 0, {a, -10, 20}, {b, -10, 10}, {c, -10, 10}, AxesLabel -> {a, b, c}]



Only top voted, non community-wiki answers of a minimum length are eligible