Comments (8)
Is it possible for Newton's method to solve the nonlinear system when it has more constraints than variables? I think you'd generally have to interpret it in the L2 sense instead?
from boundaryvaluediffeq.jl.
Well, yeah.
Does DiffEq exclusively use Newton's? BVP solvers use NLsolve, don't they? Does NLsolve provide anything else like Matlab's fsolve
?
Basically, my question comes from adapting a Matlab cruft for the problem in #52 which is solved with fsolve
. I hoped I could use the high-level abstractions of BVP instead of rewriting everything.
Sorry for double posting here and on Gitter. Could you consider mentioning this dimension match thing in the docs?
from boundaryvaluediffeq.jl.
Does DiffEq exclusively use Newton's? BVP solvers use NLsolve, don't they? Does NLsolve provide anything else like Matlab's fsolve?
Does fsolve
allow systems with more equations than variables? What algorithm is it using there? If it's possible we'll get it done.
from boundaryvaluediffeq.jl.
To be honest, I'm not familiar with the depths of Matlab. It seems that fsolve
with Levenberg–Marquardt (which multiplies J by its transpose, so non-square systems is not a problem) is automatically used to solve such problems:
function F = root2d(x)
F(1) = exp(-exp(-(x(1)+x(2)))) - x(2)*(1+x(1)^2);
F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - 0.5;
F(3) = x(1)^2 + x(2)^2 - 2;
end
clear all;
fun = @root2d;
x0 = [0,0];
x = fsolve(fun,x0)
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead.
> In fsolve (line 316)
No solution found.
fsolve stopped because the last step was ineffective. However, the vector of function
values is not near zero, as measured by the value of the function tolerance.
x = 0.2447 1.3199
The algorithm I'm translating to Julia, fsolve
ise used to minimize the 2-point BVP residual with 7 values fixed on the left and 7 on the right (14 BCs total) while the state vector has dimension 13, so there are 6 variables to find. And for that problem it produces realistic results.
Matlab references:
- Levenberg, K., “A Method for the Solution of Certain Problems in Least-Squares,” Quarterly Applied Mathematics 2, pp. 164-168, 1944.
- Marquardt, D., “An Algorithm for Least-squares Estimation of Nonlinear Parameters,” SIAM Journal Applied Mathematics, Vol. 11, pp. 431-441, 1963.
- Moré, J. J., “The Levenberg-Marquardt Algorithm: Implementation and Theory,” Numerical Analysis, ed. G. A. Watson, Lecture Notes in Mathematics 630, Springer Verlag, pp. 105-116, 1977.
from boundaryvaluediffeq.jl.
Yeah that's an L2 minimization, not a linear solve, which gives "exact" f(x)=0. That might be the only way to interpret it though?
from boundaryvaluediffeq.jl.
If this 'non-exact' solution eventually satisfies the BVP, it should be fine, I think.
from boundaryvaluediffeq.jl.
@YingboMa have you looked into this?
from boundaryvaluediffeq.jl.
This is handled currently. The user needs to pass in an NLLS solvers. Eventually once we have default solvers for NLLS in NonlinearSolve, the switching will be automatic!
from boundaryvaluediffeq.jl.
Related Issues (20)
- Error afer updating to BoundaryValueDiffEq v5: BoundsError in `interpolation` HOT 3
- Autoselect Correct Solver for Nonlinear Least Squares HOT 2
- Support Initial Guess Function
- Continuous Benchmarking HOT 1
- Free-Final-Time TPBVP/generalized BVP
- Solution interpolation in BC with MIRK solver not working? HOT 2
- Invalid Bandind error / Manifolds.jl HOT 11
- MIRK methods failed on swirling flow III when viscosity parameter is small
- Sensitivity Analysis of BVProblems HOT 3
- Pre-compilation failure HOT 1
- `TrustRegion(; radius_update_scheme = RadiusUpdateSchemes.Bastin)` doesn't work with `Shooting`
- Solving via Continuation: Interpolation error when using previous solution as initial guess HOT 3
- Example from the docs doesn't run HOT 1
- Manifolds.jl / `EmbeddedTorus` is failing again HOT 2
- MIRK4 adaptive time steps HOT 7
- Documentation
- Support Non-Vector Inputs for Multiple Shooting
- VJP Computation (for NonlinearSolve) is extremely inefficient
- Precompilation triggered at each include
- Indexing in boundary conditions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boundaryvaluediffeq.jl.