Are there any aircraft that can mechanically modify the dihedral angle of the wings whilst in flight? Would this solution give any advantage?
There was one, and it did it to increase directional stability at supersonic speed. I am talking of the North American XB-70, of course. There were three benefits to this configuration:
- Improved directional stability. Without the effect of the folded-down wingtips, the XB-70 would had lost all directional stability upwards of Mach 2. The wingtips folded down to 64.5° anhedral (or is it -64.5° dihedral?) which effectively made them into ventral fins. This answer explains how a ventral fin is especially helpful at supersonic speed, because it works in the compressed air below the aircraft.
- Less shifting of the aerodynamic center. Since the transition to supersonic flight will shift the aerodynamic center back, folding the wing tips down reduces lift in the aft section of the wing, thus reducing the aftward shift.
- Better capture of the compressed lower wing flow for lift creation, which is called a waverider. This increases the pressure on the lower side of the wing at high supersonic speed and allows to fly with a reduced angle of attack, thus reducing drag.
XB-70 landing with wingtips straight (picture source)
XB-70 in flight with wingtips down (picture source)
The XB-70 is also one of only a few types where every aircraft ever built had different dihedral: AV-1, the first prototype, had 0° while AV-2, the second prototype, had 5° dihedral over the whole wing to improve yaw and roll stability. Only the dihedral of the outer panels could be adjusted in flight, however. According to this source (PDF!) they were the largest moveable aerodynamic device ever used on an airplane.
Other cases of variable dihedral were less intentional, though, and there was really no advantage to it:
Like on many Navy aircraft, the wings of the F-4 could be folded for stowage. If the mechanism was not locked, the wings would fold up. The F-4 was even powerful enough to be flyable this way. When only one side folded up, the F-4 would crash, however.
In general, any aircraft will have its dihedral modified in flight due to the aerodynamic loads, though it is more pronounced in case of aircraft having high aspect ratio and slender wings like the Boeing 787.
Image from stackexchange.com
The North American XB-70 had a wing tip which was foldable in flight, which helped trap the shock wave under the wing between the downturned wing tips, creating compression lift, and also improved directional stability at high speeds by adding more vertical surface to the aircraft and reducing the rearward shift of aerodynamic center.
Ornithopters vary their dihedral all the time.
Ornithopter built by University of Toronto School of aerospace technologies; image from philschophoto.com
Hang-gliders are an obvious answer. For over 30 years, all higher-performance hang-gliders have had a pull-cord to tighten/loosen the sail, variously called "variable billow" or "variable geometry". A sail which billows more in the middle will naturally give you higher dihedral. The tradeoff of course is higher drag, which is why it's controllable - pilots pull on VB/VG for best performance in glides, and let it off for tight manoeuvring (e.g thermalling) or slow flying (e.g. takeoff/landing).