Skyrmion is a topologically protected spin texture excited in magnetic thin films. The radii of skyrmions are typically 10-100 nm. Because of the size, the skyrmion is expected to be a candidate for memory and novel-device usages. To realize the futuristic devices that will be using the skyrmion circuit, the tracks which guide the motion of skyrmions are needed. The tracks patterned with differences in the magnetic-anisotropy energy are well-paved without a potential pocket, whereas the tracks carved out of magnetic films have the potential pockets at corners due to the demagnetizing field. Therefore, the tracks patterned with the magnetic anisotropy plays a key role in making the skyrmion circuits. The experiment along this idea has been conducted for the hub and bent tracks. However, we have little known the motion of skyrmions in these tracks. This work aims to identify the forces acting between skyrmions and walls of the tracks. The static force on a skyrmion can be expressed as minus the gradient of the potential energy caused by the magnetic-anisotropy undulation. The potential can be estimated numerically, modeling the shape of skyrmions with their radii and domain wall widths. We find that the forces depend not only on the distance from the wall but also on the shape of skyrmions. We have also performed micromagnetic simulations where the Magnus force and the acceleration by the magnetic-anisotropy gradient are taken into account as well as the force by the walls. The simulation results show good agreement with those calculated from the modeled skyrmions.