Skip to content

No support for non-square problems? #270

Open
@JurajLieskovsky

Description

@JurajLieskovsky

Hi, does NLsolve not support non-square problems? I ran into an error when trying to solve a problem with more equations than than unknown variables which I replicated on a small testing script.

using NLsolve
using Rotations

j = [0,1,0]

function f(ϕ,u)
	RotX(ϕ[1])*RotY(ϕ[2])*RotY(ϕ[3])*j - u
end

function g(ϕ,u)
	RotX(ϕ[1])*RotY(ϕ[2])*j - u
end

v = [0,cos(pi/3),sin(pi/3)]

f([pi/3;0;0],v)
nlsolve((x)->f(x,v),[pi/4;0;0])

g([pi/3;0],v)
nlsolve((x)->g(x,v),[pi/4;0])

with console output

julia> nlsolve((x)->g(x,v),[pi/4;0])                                                                 
ERROR: BoundsError: attempt to access 2-element Array{Float64,1} at index [1, 2, 3]

I am sure that the newton method is applicable to such problems so I do not see a reason why NLsolve would not handle it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions