Partly yes. But in reality it is much try and error. It hasn’t mostly the hard math that physics has. It’s more “what happens most times has to be true because it is replicable”
Physics would be more “because this happens regularly it fits nearly this formula” and more science based on mathematics then try and error like chemistry.
Electrical engineering is more physics than chemistry for example
Electrical engineering is more physics than chemistry for example