Cannot solve a hyperbolic equation
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hasan Ghorbani
am 15 Apr. 2015
Beantwortet: Star Strider
am 15 Apr. 2015
Hi,
I am trying to solve following equation using Matlab:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149035/image.jpeg)
And here is my code:
syms z g;
eq1=z*sinh(790*g)==(12.3+i*1.49*10^-3);
eq2=tanh(395g)==z*(1.8*10^-9);
solve(eq1,eq2,z,g)
but I get following error:
Warning: Cannot solve symbolically. Returning a numeric approximation instead.
> In solve at 306
ans =
z: [1x1 sym]
g: [1x1 sym]
What I am doing wrong here?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 15 Apr. 2015
For one, you left out a multiplication operator (*) in ‘eq2’. The numeric output is appropriate, since you’re identifying ‘Z0’ and ‘gamma’.
The code (corrected):
syms z g;
eq1=z*sinh(790*g)==(12.3+1i*1.49E-3);
eq2=tanh(395*g)==z*(1.8E-9);
[z,g] = solve(eq1,eq2,z,g)
produces:
z =
58452.259506186817111402883076281 + 3.5404010317307016714429740047407i
g =
0.00000026636472784652195740050195875373 + 0.000000000016133473234585554676003727620685i
Use the vpa or vpasolve functions if you don’t want quite so many digits.
0 Kommentare
Weitere Antworten (1)
John D'Errico
am 15 Apr. 2015
Why must it be that you did something wrong? Must a symbolic solution exist for all problems? No.
So it gave you a numerical solution. Did you look at what it returned? Does the solution satisfy the equations you have posed?
That was NOT an error anyway, but a warning.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Numbers and Precision finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!