# HP Forums

Full Version: Why solve() is not solving?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm trying to solve a complex equation. This is the function i defined "gamma":
[attachment=3722]

If i write:
[attachment=3723]

The calculator says:
[attachment=3724]

As you can see in the second image, no result is returned. Why? Is there a way to solve this or i have to write it in explicit form?
Maybe, because the Gamma function isn't a function, that can be described analytical. So you can only solve witha numreical algorithm?
I tried to use fsolve() with no success. Now i've re-wrote the function using 2*pi*f instead of omega and both solve and fsolve converge to a solution.
(07-07-2016 01:22 PM)tiamattia Wrote: [ -> ]I'm trying to solve a complex equation. This is the function i defined "gamma":

Can you show how you defined it? It should work provided your definition is correct.
Hello Tim,
I defined it with this cmd:
[attachment=3725]
Did you just replace omega by 2*pi*f or make any other changes?

Note, you can just copy/paste your text directly from the emulator if you are using that. Makes it easier rather then pictures everyone has to type and hope they didn't make a mistake.
Yes, this is what i'm executing:
Code:
``` Cmd: √(-ω^2*μ*ε*0.00000125664*8.85419e−12+()*ω*μ*σ*0.00000125664)▶gamma(ω,σ,ε,μ) Result: (ω,σ,ε,μ)->√((-ω²)*μ*ε*0.00000125664*8.85419e−12+()*ω*μ*σ*0.00000125664) Cmd: gamma(1,1,1,1)  Result: 7.92666386315e−4+7.92666386322e−4* Cmd: solve(gamma(x,1,1,1) = 7.92666386315e−4+7.92666386322e−4*()) Result: [] Cmd: fsolve(gamma(x,1,1,1) = 7.92666386315e−4+7.92666386322e−4*(), x = 1) Result: 4.88592031168e−9+5.90761930892e−7* As you can see, the result of fsolve is way different from 1. Cmd: √(-(2*π*f)^2*μ*ε*0.00000125664*8.85419e−12+()*2*π*f*μ*σ*0.00000125664)▶gamma(f,σ,ε​,μ) Result: (f,σ,ε,μ)->√((-(2*π*f)²)*μ*ε*0.00000125664*8.85419e−12+()*2*π*f*μ*σ*0.00000125664) Cmd: gamma(1,1,1,1) Result: 1.98691997624e−3+1.98691997635e−3* Cmd: solve(gamma(x,1,1,1)=1.98691997624e−3+1.98691997635e−3*) The emulator crashes after this command. The calc instead solves this. The result is: {0.999999999998+5.53621719455e−11*} Cmd: fsolve((gamma(x,1,1,1)) = (1.98691997624e−3+1.98691997635e−3*()),x = 1) The emulator crashes after this command. The calc instead solves this. The result is: 0.999999999998```

(I'm using the character sigma (lower case) σ, that is an alias of the character sigma (upper case) ∑ which is the summation function, as a variable. I don't think this is the problem beacuse i'm using it in both situations...)
There is an invalid char in your definition (charcode E003). This makes the equation a symbolic equation depending on this variable (i.e. gamma(x,1,1,1) depends on x and this variable),
That's i, the imaginary unit. It is defined it in the private user area of the calc charachter map.
Did you type purge(x) before the solve and fsolve commands? The reason I ask is when I can cut and pasted your equations into the emulator I obtained the expected results: {1.00000005156}. When I typed x:=3 first I got empty brackets: [].