Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joint beamforming optimization #1

Closed
WenXun64 opened this issue Apr 29, 2024 · 5 comments
Closed

joint beamforming optimization #1

WenXun64 opened this issue Apr 29, 2024 · 5 comments

Comments

@WenXun64
Copy link

In the process of replicating the graphics, the beam mode from the results of the joint beamforming optimization was well shifted, and the communication beam at 90° and 135° I simulated was wrong. Why is that?
untitled

@LacoLuo
Copy link
Owner

LacoLuo commented Apr 30, 2024

If you have just cloned the GitHub repo and run the code without any modifications, the following points may help you resolve the problem.

  1. To verify the correctness of the CVX solutions, you can manually check if the solutions satisfy all constraints in the problem.

  2. I have asked my colleague to test the code, and he can reproduce the results. But, I have realized that some syntax in my code may cause errors due to the Matlab version. So, to make sure the environments match, below are the versions of the softwares I used in this simulation

  • Matlab: 2022a/2023b
  • CVX: 2.2
  • SDPT3: 4.0

@WenXun64
Copy link
Author

WenXun64 commented May 1, 2024

Based on your advice, I have changed my environments match to Matlab:2023b and CVX:2.2.
But, when I use the SDPT3:4.0 solver, the results are as follows:
image
When I use the SeDuMi:1.02 solver, the results are as follows:
image
Under the SeDuMi:1.02 solver, the results look similar to your article, but there are still slight differences in beam pattern, such as pattern gain, and communication beam deviation of 0.05° at 90°.
Could you tell me some suggestions?

@LacoLuo
Copy link
Owner

LacoLuo commented May 1, 2024

For now, I just have a few potential reasons in mind.

The error in the first figure may result from improper scaling of the problem's values. Sometimes, manual scaling is necessary to ensure that the values fall within the precision range of the solvers.

As for the small beam deviation, I think it occurs because numerical solvers make certain assumptions about precision and error tolerance, leading to small numerical errors in the solutions.

The solution to the problem is optimal but may not be unique. I didn't check this thoroughly. If this is the case, it could explain the difference in the beam pattern.

Below are links to some relevant posts on CVX forum for your reference:

  1. https://ask.cvxr.com/t/scaling-and-numerical-stability/320
  2. https://ask.cvxr.com/t/dealing-with-small-numerical-errors/414/3
  3. https://ask.cvxr.com/t/different-optimal-solution-for-same-mathematically-codes/10522

You may use some better solvers, such as Mosek and Gurobi, to ensure stable results. They also provide academic licenses.

@WenXun64
Copy link
Author

WenXun64 commented May 4, 2024

Thank you for your patient answer. By using Mosek solver, the simulation results have been improved to some extent.

I would like to know what manual scaling you made when emulation the first figure. Could you please tell me in detail?

@LacoLuo
Copy link
Owner

LacoLuo commented May 4, 2024

Since I didn't have this issue before, I didn't do manual scaling in my code.
If you want to do manual scaling, you may try multiplying both sides of the constraints by a large number, e.g., 1e4.
Some variables have large values, resulting in small values in the constraints, e.g., sqrt(1/gamma_t).

@LacoLuo LacoLuo closed this as completed Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants