Debian Codegraph @

Aircraft/c172p/Nasal/electrical.nas

raw
1 ##
2 # Procedural model of a Cessna 172S electrical system. Includes a
3 # preliminary battery charge/discharge model and realistic ammeter
4 # gauge modeling.
5 #
6 # Modelled after the POH and a maintenance manual.
7 # Sources/discussion: https://github.com/c172p-team/c172p/pull/1496
8 #
9
10 ##
11 # Initialize internal values
12 #
13
14 var vbus_volts = 0.0;
15 var ebus1_volts = 0.0;
16 var ebus2_volts = 0.0;
17
18 var ammeter_ave = 0.0;
19
20 ##
21 # Beacon and Strobe intermittent instantiation
22 #
23
24 aircraft.light.new("/sim/model/c172p/lighting/strobes", [0.1, 1.3]);
25 aircraft.light.new("/sim/model/c172p/lighting/beacon", [0.3, 1.3]);
26
27 var old_flap_position = 0;
28 var current_flap_position = getprop("/surface-positions/flap-pos-norm");
29 var old_gear_position = 0;
30 var current_gear_position = getprop("/controls/gear/gear-down-command");
31 var radio_lighting_load = 0;
32
33 # Init avionics breaker (POH 7-26); the breaker is integrated into the switch.
34 var brk_avionics_master = props.globals.getNode("/controls/circuit-breakers/avionics-master", 1);
35 brk_avionics_master.setBoolValue(getprop("/controls/switches/master-avionics"));
36 setlistener(brk_avionics_master, func (node) {
37 # when breaker trips, set switch to OFF
38 if (!node.getBoolValue())
39 setprop("/controls/switches/master-avionics", 0);
40 }, 0, 0);
41 setlistener("/controls/switches/master-avionics", func (node) {
42 # when switch is set to ON, reset the breaker
43 if (node.getBoolValue())
44 brk_avionics_master.setBoolValue(1);
45 }, 1, 0);
46
47
48
49 ##
50 # Battery model class.
51 #
52
53 var BatteryClass = {};
54
55 BatteryClass.new = func {
56 var obj = { parents : [BatteryClass],
57 ideal_volts : 24.0,
58 ideal_amps : 30.0,
59 amp_hours : 13.36,
60 charge_percent : getprop("/systems/electrical/battery-charge-percent") or 1.0,
61 charge_amps : 7.0 };
62 setprop("/systems/electrical/battery-charge-percent", obj.charge_percent);
63 return obj;
64 }
65
66 ##
67 # Passing in positive amps means the battery will be discharged.
68 # Negative amps indicates a battery charge.
69 #
70
71 BatteryClass.apply_load = func (amps, dt) {
72 var old_charge_percent = getprop("/systems/electrical/battery-charge-percent") or 0;
73
74 if (getprop("/sim/freeze/replay-state"))
75 return me.amp_hours * old_charge_percent;
76
77 var amphrs_used = amps * dt / 3600.0;
78 var percent_used = amphrs_used / me.amp_hours;
79
80 var new_charge_percent = std.max(0.0, std.min(old_charge_percent - percent_used, 1.0)) or 0;
81
82 if (new_charge_percent < 0.1 and old_charge_percent >= 0.1)
83 gui.popupTip("Warning: Low battery! Enable alternator or apply external power to recharge battery!", 10);
84 me.charge_percent = new_charge_percent;
85 setprop("/systems/electrical/battery-charge-percent", new_charge_percent);
86 return me.amp_hours * new_charge_percent;
87 }
88
89 ##
90 # Return output volts based on percent charged. Currently based on a simple
91 # polynomial percent charge vs. volts function.
92 #
93
94 BatteryClass.get_output_volts = func {
95 var x = 1.0 - me.charge_percent;
96 var tmp = -(3.0 * x - 1.0);
97 var factor = (tmp*tmp*tmp*tmp*tmp + 32) / 32;
98 return me.ideal_volts * factor;
99 }
100
101
102 ##
103 # Return output amps available. This function is totally wrong and should be
104 # fixed at some point with a more sensible function based on charge percent.
105 # There is probably some physical limits to the number of instantaneous amps
106 # a battery can produce (cold cranking amps?)
107 #
108
109 BatteryClass.get_output_amps = func {
110 var x = 1.0 - me.charge_percent;
111 var tmp = -(3.0 * x - 1.0);
112 var factor = (tmp*tmp*tmp*tmp*tmp + 32) / 32;
113 return me.ideal_amps * factor;
114 }
115
116 ##
117 # Set the current charge instantly to 100 %.
118 #
119
120 BatteryClass.reset_to_full_charge = func {
121 me.apply_load(-(1.0 - me.charge_percent) * me.amp_hours, 3600);
122 }
123
124 ##
125 # Alternator model class.
126 #
127
128 var AlternatorClass = {};
129
130 AlternatorClass.new = func {
131 var obj = { parents : [AlternatorClass],
132 rpm_source : "/engines/active-engine/rpm",
133 rpm_threshold : 800.0,
134 ideal_volts : 28.0,
135 ideal_amps : 60.0 };
136 setprop( obj.rpm_source, 0.0 );
137 return obj;
138 }
139
140 ##
141 # Computes available amps and returns remaining amps after load is applied
142 #
143
144 AlternatorClass.apply_load = func( amps, dt ) {
145 # Scale alternator output for rpms < 800. For rpms >= 800
146 # give full output. This is just a WAG, and probably not how
147 # it really works but I'm keeping things "simple" to start.
148 var rpm = getprop( me.rpm_source );
149 var factor = rpm / me.rpm_threshold;
150 if ( factor > 1.0 ) {
151 factor = 1.0;
152 }
153 # print( "alternator amps = ", me.ideal_amps * factor );
154 var available_amps = me.ideal_amps * factor;
155 return available_amps - amps;
156 }
157
158 ##
159 # Return output volts based on rpm
160 #
161
162 AlternatorClass.get_output_volts = func {
163 # scale alternator output for rpms < 800. For rpms >= 800
164 # give full output. This is just a WAG, and probably not how
165 # it really works but I'm keeping things "simple" to start.
166 var rpm = getprop( me.rpm_source );
167 var factor = rpm / me.rpm_threshold;
168 if ( factor > 1.0 ) {
169 factor = 1.0;
170 }
171 # print( "alternator volts = ", me.ideal_volts * factor );
172 return me.ideal_volts * factor;
173 }
174
175
176 ##
177 # Return output amps available based on rpm.
178 #
179
180 AlternatorClass.get_output_amps = func {
181 # scale alternator output for rpms < 800. For rpms >= 800
182 # give full output. This is just a WAG, and probably not how
183 # it really works but I'm keeping things "simple" to start.
184 var rpm = getprop( me.rpm_source );
185 var factor = rpm / me.rpm_threshold;
186 if ( factor > 1.0 ) {
187 factor = 1.0;
188 }
189 # print( "alternator amps = ", ideal_amps * factor );
190 return me.ideal_amps * factor;
191 }
192
193 var battery = BatteryClass.new();
194 var alternator = AlternatorClass.new();
195
196 var reset_battery_and_circuit_breakers = func {
197 # Charge battery to 100 %
198 battery.reset_to_full_charge();
199
200 # Reset circuit breakers
201 setprop("/controls/circuit-breakers/master", 1);
202 setprop("/controls/circuit-breakers/flaps", 1);
203 setprop("/controls/circuit-breakers/pitot-heat", 1);
204 setprop("/controls/circuit-breakers/instr", 1);
205 setprop("/controls/circuit-breakers/intlt", 1);
206 setprop("/controls/circuit-breakers/navlt", 1);
207 setprop("/controls/circuit-breakers/landing", 1);
208 setprop("/controls/circuit-breakers/bcnlt", 1);
209 setprop("/controls/circuit-breakers/strobe", 1);
210 setprop("/controls/circuit-breakers/turn-coordinator", 1);
211 setprop("/controls/circuit-breakers/radio1", 1);
212 setprop("/controls/circuit-breakers/radio2", 1);
213 setprop("/controls/circuit-breakers/radio3", 1);
214 setprop("/controls/circuit-breakers/radio4", 1);
215 setprop("/controls/circuit-breakers/radio5", 1);
216 setprop("/controls/circuit-breakers/autopilot", 1);
217
218 if (getprop("/fdm/jsbsim/bushkit") == 4) {
219 setprop("/controls/circuit-breakers/gear-select", 1);
220 setprop("/controls/circuit-breakers/gear-advisory", 1);
221 setprop("/controls/circuit-breakers/hydraulic-pump", 1);
222 }
223 }
224
225 ##
226 # This is the main electrical system update function.
227 #
228
229 var ElectricalSystemUpdater = {
230 new : func {
231 var m = {
232 parents: [ElectricalSystemUpdater]
233 };
234 # Request that the update function be called each frame
235 m.loop = updateloop.UpdateLoop.new(components: [m], update_period: 0.0, enable: 0);
236 return m;
237 },
238
239 enable: func {
240 me.loop.reset();
241 me.loop.enable();
242 },
243
244 disable: func {
245 me.loop.disable();
246 },
247
248 reset: func {
249 # Do nothing
250 },
251
252 update: func (dt) {
253 update_virtual_bus(dt);
254 }
255 };
256
257 ##
258 # Model the system of relays and connections that join the battery,
259 # alternator, starter, master/alt switches, external power supply.
260 #
261
262 var update_virtual_bus = func (dt) {
263 var serviceable = getprop("/systems/electrical/serviceable");
264 var external_volts = 0.0;
265 var load = 0.0;
266 var draw = 0.0;
267 var battery_volts = 0.0;
268 var alternator_volts = 0.0;
269 if ( serviceable ) {
270 battery_volts = battery.get_output_volts();
271 alternator_volts = alternator.get_output_volts();
272 }
273
274 # switch state
275 var master_bat = getprop("/controls/switches/master-bat");
276 var master_alt = getprop("/controls/switches/master-alt");
277 if (getprop("/controls/electric/external-power"))
278 {
279 external_volts = 28;
280 }
281
282 # determine power source
283 var bus_volts = 0.0;
284 var power_source = nil;
285 if ( master_bat ) {
286 bus_volts = battery_volts;
287 power_source = "battery";
288 }
289 if ( master_alt and (alternator_volts > bus_volts) ) {
290 bus_volts = alternator_volts;
291 power_source = "alternator";
292 }
293 if ( external_volts > bus_volts) {
294 # Ground-power-unit is connected to the plus-side of the battery. If
295 # the reverse-polarity-contactor is closed (which it is if the GPU
296 # has power and was plugged in correctly), the GPU powers the starter,
297 # and also the electrical system.
298 bus_volts = external_volts;
299 power_source = "external";
300 }
301 #print( "virtual bus volts = ", bus_volts );
302
303 # bus network (1. these must be called in the right order, 2. the
304 # bus routine itself determins where it draws power from.)
305 draw += electrical_bus_1();
306 draw += avionics_bus_1();
307
308 if (bus_volts) load = draw / bus_volts;
309
310 # swtich the master breaker off if load is out of limits
311 if ( load > 330 ) {
312 setprop("/controls/circuit-breakers/master", 0)
313 }
314
315
316 # charge/discharge the battery
317 # show battery charge/discharge on the ammeter
318 var ammeter = 0.0;
319 var bat_charge_pct = getprop("/systems/electrical/battery-charge-percent") or 0;
320 if ( power_source == "battery" ) {
321 battery.apply_load( load, dt );
322 ammeter = -load;
323 } elsif ( master_bat and bat_charge_pct >= 1.0) {
324 # show small charge with fully loaded battery and only small load
325 # (ie. show the conservatory charge rate)
326 if (load < 20.0 and ammeter < 3.0) ammeter = 3.0;
327 } elsif ( bus_volts > battery_volts and master_bat and bat_charge_pct < 1.0) {
328 # Charge, but only if master_bat switch is ON.
329 # If it's off, power is coming either from the alternator, or GPU.
330 # If the battery contactor is open (which it is always with master_bat=OFF),
331 # the battery is removed from the system.
332 # The charge rate depends on the power source and the battery condition.
333 # Normal charge rates are not more than two needle widths (~7 amps).
334 battery.apply_load( -battery.charge_amps, dt );
335 ammeter = battery.charge_amps;
336 }
337
338 # print( "ammeter = ", ammeter );
339
340 # filter ammeter needle pos
341 ammeter_ave = 0.8 * ammeter_ave + 0.2 * ammeter;
342
343 # outputs
344 setprop("/systems/electrical/amps", ammeter_ave);
345 setprop("/systems/electrical/volts", bus_volts);
346 if (bus_volts > 12)
347 vbus_volts = bus_volts;
348 else
349 vbus_volts = 0.0;
350
351 return load;
352 }
353
354 var electrical_bus_1 = func() {
355 var bus_volts = 0.0;
356 var load = 0.0;
357
358 # check master breaker
359 if ( getprop("/controls/circuit-breakers/master") ) {
360 # we are feed from the virtual bus
361 bus_volts = vbus_volts;
362 }
363 #print("Bus volts: ", bus_volts);
364
365 # Flaps 10 amp breaker
366 if (getprop("/controls/circuit-breakers/flaps")) {
367 setprop("/systems/electrical/outputs/flaps", bus_volts);
368 } else {
369 setprop("/systems/electrical/outputs/flaps", 0.0);
370 }
371 current_flap_position = getprop("/surface-positions/flap-pos-norm");
372 if (current_flap_position != old_flap_position) {
373 old_flap_position = current_flap_position;
374 if (getprop("/systems/electrical/outputs/flaps") > 12) {
375 load += 4.5 * bus_volts; # 3.5-4.5
376 }
377 }
378
379 # Pitot Heat Power
380 if (getprop("/controls/anti-ice/pitot-heat" ) and getprop("controls/anti-ice/pitot-heat")) {
381 setprop("/systems/electrical/outputs/pitot-heat", bus_volts);
382 load += 5 * bus_volts;
383 } else {
384 setprop("/systems/electrical/outputs/pitot-heat", 0.0);
385 }
386
387 # Instrument Power: ignition, fuel, oil temperature
388 if ( getprop("/controls/circuit-breakers/instr") ) {
389 setprop("/systems/electrical/outputs/instr-ignition-switch", bus_volts);
390 if ( bus_volts > 12 ) {
391 # starter
392 var starter_svc = getprop("/engines/active-engine/starter/serviceable");
393 var starter_molten = getprop("/engines/active-engine/starter/overheated");
394 if ( getprop("controls/switches/starter") and starter_svc and !starter_molten ) {
395 setprop("systems/electrical/outputs/starter", bus_volts);
396 } else {
397 setprop("systems/electrical/outputs/starter", 0.0);
398 }
399 } else {
400 setprop("systems/electrical/outputs/starter", 0.0);
401 }
402 } else {
403 setprop("/systems/electrical/outputs/instr-ignition-switch", 0.0);
404 setprop("/systems/electrical/outputs/starter", 0.0);
405 }
406
407 # Interior lights (cabin red and post)
408 if (getprop("/controls/circuit-breakers/intlt")) {
409 setprop("/systems/electrical/outputs/cabin-lights", bus_volts);
410 var instruments_norm = getprop("/controls/lighting/instruments-norm");
411 load += (5 * instruments_norm) * bus_volts; # 3.5-5 amp
412 } else {
413 setprop("/systems/electrical/outputs/cabin-lights", 0.0);
414 }
415 # Interior lights (dome white)
416 if (getprop("/systems/electrical/outputs/cabin-lights")and getprop("/controls/switches/dome-white")) {
417 var dome_white_norm = getprop("/controls/lighting/dome-white-norm");
418 load += (5 * dome_white_norm) * bus_volts; # 3.5-5 amp
419 }
420
421 # Avionics (radio lighting)
422 if (getprop("/controls/circuit-breakers/intlt")) {
423 setprop("/systems/electrical/outputs/instrument-lights", bus_volts);
424 var radio_norm = getprop("/controls/lighting/radio-norm");
425 load += (radio_lighting_load * radio_norm) * bus_volts; # 3.5-5 amp
426 } else {
427 setprop("/systems/electrical/outputs/instrument-lights", 0.0);
428 }
429
430 # Landing Light Power
431 if ( getprop("/controls/circuit-breakers/landing") and getprop("/controls/lighting/landing-lights") ) {
432 setprop("/systems/electrical/outputs/landing-lights", bus_volts);
433 load += 14.5 * bus_volts; # 14-18 amps
434 } else {
435 setprop("/systems/electrical/outputs/landing-lights", 0.0 );
436 }
437
438 # Taxi Lights Power
439 # Notice taxi lights also use landing lights breaker. It is not a bug.
440 if ( getprop("/controls/circuit-breakers/landing") and getprop("/controls/lighting/taxi-light" ) ) {
441 setprop("/systems/electrical/outputs/taxi-light", bus_volts);
442 load += 14.5 * bus_volts; # 14-18 amps
443 } else {
444 setprop("/systems/electrical/outputs/taxi-light", 0.0);
445 }
446
447 # Beacon Power
448 if ( getprop("/controls/circuit-breakers/bcnlt") and getprop("/controls/lighting/beacon" ) ) {
449 setprop("/systems/electrical/outputs/beacon", bus_volts);
450 load += 4.5 * bus_volts; # 4.5-5 amps
451 } else {
452 setprop("/systems/electrical/outputs/beacon", 0.0);
453 }
454
455 # Nav Lights Power
456 if ( getprop("/controls/circuit-breakers/navlt") and getprop("/controls/lighting/nav-lights" ) ) {
457 setprop("/systems/electrical/outputs/nav-lights", bus_volts);
458 load += 5 * bus_volts; # 4.5-5 amps
459 } else {
460 setprop("/systems/electrical/outputs/nav-lights", 0.0);
461 }
462
463 # Strobe Lights Power
464 if ( getprop("/controls/circuit-breakers/strobe") and getprop("/controls/lighting/strobe" ) ) {
465 setprop("/systems/electrical/outputs/strobe", bus_volts);
466 setprop("/systems/electrical/outputs/strobe-norm", (bus_volts/24));
467 load += 5 * bus_volts; # 4.5-5 amps
468 } else {
469 setprop("/systems/electrical/outputs/strobe", 0.0);
470 setprop("/systems/electrical/outputs/strobe-norm", 0.0);
471 }
472
473 # Directional gyro Power
474 # DG/HI is vacuum powered. This looks obsolete here and could probably be removed.
475 #if (getprop("/controls/circuit-breakers/turn-coordinator") and getprop("/controls/switches/master-avionics")) {
476 # setprop("/systems/electrical/outputs/DG", bus_volts);
477 # load += 14 * bus_volts;
478 #} else {
479 # setprop("/systems/electrical/outputs/DG", 0.0);
480 #}
481
482 # Turn Coordinator Power
483 if (getprop("/controls/circuit-breakers/turn-coordinator") ) {
484 setprop("/systems/electrical/outputs/turn-coordinator", bus_volts);
485 load += 14 * bus_volts;
486 } else {
487 setprop("/systems/electrical/outputs/turn-coordinator", 0.0);
488 }
489
490 # Gear Select Power
491 if ( getprop("/controls/circuit-breakers/gear-select") ) {
492 setprop("/systems/electrical/outputs/gear-select", bus_volts);
493 load += 5 * bus_volts;
494 } else {
495 setprop("/systems/electrical/outputs/gear-select", 0.0);
496 }
497
498 # Gear Advisory Power
499 if ( getprop("/controls/circuit-breakers/gear-advisory") ) {
500 setprop("/systems/electrical/outputs/gear-advisory", bus_volts);
501 if (getprop("/velocities/groundspeed-kt") > 10 and getprop("/velocities/groundspeed-kt") < 70) {
502 load += 2 * bus_volts;
503 }
504 } else {
505 setprop("/systems/electrical/outputs/gear-advisory", 0.0);
506 }
507
508 # Hydraulic Pump Power
509 if ( getprop("/controls/circuit-breakers/hydraulic-pump") ) {
510 setprop("/systems/electrical/outputs/hydraulic-pump", bus_volts);
511 } else {
512 setprop("/systems/electrical/outputs/hydraulic-pump", 0.0);
513 }
514 current_gear_position = getprop("controls/gear/gear-down-command");
515 if (current_gear_position != old_gear_position) {
516 old_gear_position = current_gear_position;
517 if (getprop("/systems/electrical/outputs/hydraulic-pump") > 12) {
518 load += 40 * bus_volts;
519 }
520 }
521
522 # Avionics Fan Power
523 # Power comes trough the strobe breaker
524 if ( bus_volts > 12 and getprop("/controls/circuit-breakers/strobe")) {
525 setprop("/systems/electrical/outputs/avionics-fan[0]", bus_volts);
526 load += bus_volts / 28;
527 } else {
528 setprop("/systems/electrical/outputs/avionics-fan[0]", 0);
529 }
530
531 # register bus voltage
532 ebus1_volts = bus_volts;
533
534 # return cumulative load
535 return load;
536 }
537
538 var avionics_bus_1 = func() {
539 var bus_volts = 0.0;
540 var load = 0.0;
541
542 # we are fed from the electrical bus 1
543 var master_av = getprop("/controls/switches/master-avionics");
544 if ( master_av ) {
545 bus_volts = ebus1_volts;
546 }
547
548 # Avionics Fan Power
549 #setprop("/systems/electrical/outputs/avionics-fan", bus_volts);
550
551 # Audio Panel 1 Power
552 if ( getprop("/controls/circuit-breakers/radio1") ) {
553 setprop("/systems/electrical/outputs/audio-panel[0]", bus_volts);
554 setprop("/instrumentation/audio-panel[0]/operable", 1);
555 load += 5 * bus_volts;
556 } else {
557 setprop("/systems/electrical/outputs/audio-panel[0]", 0.0);
558 setprop("/instrumentation/audio-panel[0]/operable", 0);
559 }
560
561 # Com and Nav 1 Power
562 if (getprop("/controls/circuit-breakers/radio2") and getprop("/instrumentation/nav[0]/power-btn")) {
563 setprop("/systems/electrical/outputs/nav[0]", bus_volts);
564 setprop("systems/electrical/outputs/comm[0]", bus_volts);
565 load += 5 * bus_volts;
566 radio_lighting_load = 1.0;
567 } else {
568 setprop("/systems/electrical/outputs/nav[0]", 0.0);
569 setprop("systems/electrical/outputs/comm[0]", 0.0);
570 }
571
572 # Com and Nav 2 Power
573 if (getprop("/controls/circuit-breakers/radio3") and getprop("/instrumentation/nav[1]/power-btn")) {
574 setprop("/systems/electrical/outputs/nav[1]", bus_volts);
575 setprop("systems/electrical/outputs/comm[1]", bus_volts);
576 load += 5 * bus_volts;
577 radio_lighting_load += 1.0;
578 } else {
579 setprop("/systems/electrical/outputs/nav[1]", 0.0);
580 setprop("systems/electrical/outputs/comm[1]", 0.0);
581 }
582
583 # Transponder Power
584 if (getprop("/controls/circuit-breakers/radio4") and getprop("/instrumentation/transponder/inputs/knob-mode")) {
585 setprop("/systems/electrical/outputs/transponder", bus_volts);
586 load += 5 * bus_volts;
587 radio_lighting_load += 1.0;
588 } else {
589 setprop("/systems/electrical/outputs/transponder", 0.0);
590 }
591
592 # ADF Power
593 # Note, ADF and DME are secured by the same breaker
594 if (getprop("/controls/circuit-breakers/radio5") and getprop("/instrumentation/adf[0]/power-btn")) {
595 setprop("/systems/electrical/outputs/adf", bus_volts);
596 load += 5 * bus_volts;
597 radio_lighting_load += 1.0;
598 } else {
599 setprop("/systems/electrical/outputs/adf", 0.0);
600 }
601 # DME ADF Power
602 # Note, ADF and DME are secured by the same breaker
603 if (getprop("/controls/circuit-breakers/radio5") and getprop("/instrumentation/dme[0]/power-btn")) {
604 setprop("/systems/electrical/outputs/dme", bus_volts);
605 load += 5 * bus_volts;
606 radio_lighting_load += 1.0;
607 } else {
608 setprop("/systems/electrical/outputs/dme", 0.0);
609 }
610
611 # Autopilot Power
612 if ( getprop("/controls/circuit-breakers/autopilot") and getprop("/autopilot/kap140/serviceable") ) {
613 setprop("/systems/electrical/outputs/autopilot", bus_volts);
614 load += 5 * bus_volts;
615 radio_lighting_load += 1.0;
616 } else {
617 setprop("/systems/electrical/outputs/autopilot", 0.0);
618 }
619
620 # return cumulative load
621 return load;
622 }
623
624 ##
625 # Initialize the electrical system
626 #
627
628 var system_updater = ElectricalSystemUpdater.new();
629
630 # checking if battery should be automatically recharged
631 if (!getprop("/systems/electrical/save-battery-charge")) {
632 battery.reset_to_full_charge();
633 };
634
635 system_updater.enable();
636
637 print("Electrical system initialized");
638