It is aimed to smoothly perform engagement and disengagement of a fastener of a packaging bag and easily take out an inner content by a desired amount. The image forming apparatus includes a heating device to heat a recording material to be conveyed, a cooling fan that blows air from an air blowing port facing a part of the heating device, and a shutter that moves such that an opening width of the air blowing port is regulated depending on a width of the recording material. The fixation device has at least one heating device for melting the toner image, past which the substrate can be taken. The metal increases the total mass of the proof mass as compared to a proof mass of similar dimensions made solely from semiconductor materials, without increasing the size of the proof mass. The cost function corresponds to a maximized value of the control variable.