only_ever_generator 0.0.9 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/bootstrap/app.js +84 -77
  2. package/dist/constants/prompts/card_gen_prompt.js +118 -25
  3. package/dist/constants/prompts/typology_prompt.js +8 -10
  4. package/dist/constants/source_data.js +1 -5
  5. package/dist/index.js +114 -14
  6. package/dist/service/open_ai_request.js +1 -0
  7. package/dist/typology_gen/generate_typology.js +15 -60
  8. package/package.json +3 -10
  9. package/readme.md +12 -3
  10. package/src/bootstrap/app.ts +100 -81
  11. package/src/class/services/open_ai_service.ts +18 -0
  12. package/src/constants/prompts/card_gen_prompt.ts +119 -25
  13. package/src/constants/prompts/typology_prompt.ts +8 -10
  14. package/src/constants/source_data.ts +0 -5
  15. package/src/index.ts +117 -20
  16. package/src/service/open_ai_request.ts +46 -0
  17. package/src/typology_gen/generate_typology.ts +11 -62
  18. package/dist/card_gen/generate_cards.js +0 -184
  19. package/dist/constants/api_constants.js +0 -7
  20. package/dist/parse/parse_card_response.js +0 -288
  21. package/dist/parse/parse_source_content.js +0 -62
  22. package/dist/parse/response_format_card.js +0 -210
  23. package/dist/parse/response_format_typology.js +0 -47
  24. package/dist/parse_response/parse_card_response.js +0 -288
  25. package/dist/services/open_ai_service.js +0 -60
  26. package/dist/utils/generate_args.js +0 -37
  27. package/src/card_gen/generate_cards.ts +0 -192
  28. package/src/constants/api_constants.ts +0 -3
  29. package/src/parse/parse_card_response.ts +0 -290
  30. package/src/services/open_ai_service.ts +0 -54
  31. package/src/utils/generate_args.ts +0 -38
  32. /package/src/{parse → class/parse}/parse_source_content.ts +0 -0
  33. /package/src/{parse → parse_response}/response_format_card.ts +0 -0
  34. /package/src/{parse → parse_response}/response_format_typology.ts +0 -0
@@ -1,78 +1,85 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OnlyEverGenerator = void 0;
13
- const generate_cards_1 = require("../card_gen/generate_cards");
14
- const parse_source_content_1 = require("../parse/parse_source_content");
15
- const open_ai_service_1 = require("../services/open_ai_service");
16
- const card_gen_prompt_1 = require("../constants/prompts/card_gen_prompt");
17
- const typology_prompt_1 = require("../constants/prompts/typology_prompt");
18
- const generate_typology_1 = require("../typology_gen/generate_typology");
19
- const generate_args_1 = require("../utils/generate_args");
20
- const source_data_1 = require("../constants/source_data");
21
- /// OnlyEverGenerator
22
- class OnlyEverGenerator {
23
- constructor(apiKey, model, content, expected_fields) {
24
- this.api_key = '';
25
- this.parsedContent = '';
26
- this.typologyResponse = {};
27
- this.cardgenResponse = {};
28
- this.summarizeResponse = {};
29
- this.api_key = apiKey;
30
- this.openAiService = new open_ai_service_1.OpenAiService(apiKey, model !== null && model !== void 0 ? model : 'gpt-3.5-turbo-1106');
31
- this.parsedContent = new parse_source_content_1.ParseSourceContent(content).parse();
32
- this.expectedFields = (0, source_data_1.returnFields)();
33
- }
34
- ;
35
- generate() {
36
- return __awaiter(this, arguments, void 0, function* (generate_typology = false, generate_card = false) {
37
- var _a, _b;
38
- let typologyPrompt = (0, typology_prompt_1.returnTypologyPrompt)();
39
- let cardPrompt = (0, card_gen_prompt_1.returnCardGenPrompt)();
40
- let args = new generate_args_1.GenerateArgs(generate_card, generate_typology, false, {
41
- typology_prompt: typologyPrompt,
42
- card_gen_prompt: cardPrompt,
43
- summary_prompt: ''
44
- });
45
- const responseToReturn = [];
46
- const whatNeedsToBeGenerated = args.getWhatNeedsToBeGenerated();
47
- for (let elem of whatNeedsToBeGenerated)
48
- if (elem == 'generate_tyopology') {
49
- this.typologyResponse = yield this.generateTypology((_a = args.prompts.typology_prompt) !== null && _a !== void 0 ? _a : '');
50
- responseToReturn.push(this.typologyResponse);
51
- }
52
- else if (elem == 'generate_card') {
53
- this.cardgenResponse = yield this.generateCard((_b = args.prompts.card_gen_prompt) !== null && _b !== void 0 ? _b : '', this.parsedContent + JSON.stringify(this.typologyResponse));
54
- responseToReturn.push(this.cardgenResponse);
55
- }
56
- return responseToReturn;
57
- });
58
- }
59
- _returnParsedContent() {
60
- return this.parsedContent;
61
- }
62
- generateCard(prompt, content) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- let generateCards = new generate_cards_1.GenerateCards(this.openAiService);
65
- let cardgenResponse = yield generateCards.generateCards(prompt !== null && prompt !== void 0 ? prompt : '', content);
66
- // let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
67
- // response['type'] = 'card_gen';
68
- return cardgenResponse;
69
- });
70
- }
71
- generateTypology(prompt) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- let response = yield new generate_typology_1.GenerateTypology(this.openAiService, prompt, this.parsedContent, this.expectedFields).generate();
74
- return response;
75
- });
76
- }
77
- }
78
- exports.OnlyEverGenerator = OnlyEverGenerator;
2
+ // import { ParseSourceContent } from "../class/parse/parse_source_content";
3
+ // import { OpenAiService } from "../class/services/open_ai_service";
4
+ // export class OnlyEverGenerator{
5
+ // public api_key: string = '';
6
+ // public openAiService: OpenAiService | undefined;
7
+ // parsedContent: String = '';
8
+ // constructor(apiKey:string, content: Array<any>){
9
+ // this.api_key = apiKey;
10
+ // this.openAiService = new OpenAiService(apiKey);
11
+ // this.parsedContent = new ParseSourceContent(content).parse();
12
+ // };
13
+ // typologyResponse = {};
14
+ // cardgenResponse = {};
15
+ // summarizeResponse = {};
16
+ // async generate(
17
+ // args: GenerateArgs
18
+ // ): Promise<Array<any>> {
19
+ // const responseToReturn = [];
20
+ // const whatNeedsToBeGenerated = args.getWhatNeedsToBeGenerated();
21
+ // for(let elem of whatNeedsToBeGenerated)
22
+ // if(elem == 'generate_tyopology'){
23
+ // this.typologyResponse = await this.generateTypology(args.prompts.typology_prompt ?? '', this.parsedContent);
24
+ // responseToReturn.push(this.typologyResponse);
25
+ // }else if(elem == 'generate_card'){
26
+ // this.cardgenResponse = await this.generateCard(args.prompts.card_gen_prompt ?? '', this.parsedContent + JSON.stringify(this.typologyResponse));
27
+ // responseToReturn.push(this.cardgenResponse);
28
+ // }else if(elem == 'generate_summary'){
29
+ // this.summarizeResponse = await this.generateSummary(args.prompts.summary_prompt ?? '', this.parsedContent);
30
+ // responseToReturn.push(this.summarizeResponse);
31
+ // }
32
+ // return responseToReturn;
33
+ // }
34
+ // returnParsedContent(){
35
+ // return this.parsedContent;
36
+ // }
37
+ // async generateCard(prompt: String, content: String){
38
+ // let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
39
+ // response['type'] = 'card_gen';
40
+ // return response;
41
+ // }
42
+ // async generateTypology(prompt:String,content:String){
43
+ // let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
44
+ // response['type'] = 'typology';
45
+ // return response;
46
+ // }
47
+ // async generateSummary(prompt:String,content:String){
48
+ // let response = await this.openAiService?.sendRequest(prompt,this.parsedContent);
49
+ // response['type']= 'summary';
50
+ // return response;
51
+ // }
52
+ // }
53
+ // export class GenerateArgs{
54
+ // public generate_card : boolean = false;
55
+ // public generate_typology: boolean = false;
56
+ // public generate_summary: boolean = false;
57
+ // public prompts = {
58
+ // typology_prompt: '',
59
+ // card_gen_prompt: '',
60
+ // summary_prompt: ''
61
+ // }
62
+ // constructor(generate_card: boolean,generate_typology: boolean, generate_summary: boolean, prompts = {
63
+ // typology_prompt: '',
64
+ // card_gen_prompt: '',
65
+ // summary_prompt: ''
66
+ // }){
67
+ // this.generate_card = generate_card;
68
+ // this.generate_typology = generate_typology;
69
+ // this.generate_summary = generate_summary;
70
+ // this.prompts = prompts
71
+ // }
72
+ // getWhatNeedsToBeGenerated(){
73
+ // let returnData = [];
74
+ // if(this.generate_typology == true){
75
+ // returnData.push('generate_tyopology')
76
+ // }
77
+ // if(this.generate_summary == true){
78
+ // returnData.push('generate_summary')
79
+ // }
80
+ // if(this.generate_card == true){
81
+ // returnData.push('generate_card');
82
+ // }
83
+ // return returnData;
84
+ // }
85
+ // }
@@ -27,7 +27,7 @@ json
27
27
  {
28
28
  "type": "flash" | "mcq" | "cloze" | "match",
29
29
  "card_content": { "front": "...", "back": "..." | "prompt": "...", "choices": [ ... ] | "prompt": "...", "options": [ ... ] | "right_choice 1": "...", "left_choice 1": "..." },
30
- "card_reference": "heading",
30
+ "card_reference": "source_title#heading",
31
31
  "concepts": ["Concept1", "Concept2", "..."],
32
32
  "facts": ["Fact1", "Fact2", "..."]
33
33
  }
@@ -66,6 +66,7 @@ json
66
66
  {
67
67
  "missing_facts": ["fact1", "fact2", "fact3", "..."]
68
68
  }
69
+
69
70
  After you have the complete list of concepts and facts, including any missing ones you identified, proceed to generate test cards for each.
70
71
 
71
72
  1. Clarity: Ensure the test content is clear and unambiguous.
@@ -76,29 +77,23 @@ After you have the complete list of concepts and facts, including any missing on
76
77
  Test cards must be one of the following types:
77
78
 
78
79
  1. Flashcards: Have a front and back.
79
- 2. A flashcard consists of two sides: a front and a back. Both the front and back text content must not exceed more than 300 characters in length.
80
80
 
81
- json schema for Flash Cards:
81
+ json
82
82
  {
83
83
  "type": "flash",
84
84
  "card_content": {
85
- "front": "<content for the front of the flashcard>",
86
- "back": "<content for the back of the flashcard>"
85
+ "front": "<content for the front>",
86
+ "back": "<content for the back>"
87
87
  },
88
- "card_reference": "heading",
88
+ "card_reference": "source_title#heading",
89
89
  "concepts": ["Concept1", "Concept2", "..."],
90
90
  "facts": ["Fact1", "Fact2", "..."]
91
91
  }
92
92
 
93
-
93
+ - Each side must not exceed 300 characters.
94
94
  2. Multiple Choice Questions (MCQ): Provide multiple choices to pick from. One or more should be correct.
95
- • Minimum choices required: 2
96
- • Maximum choices allowed: 8
97
- • Minimum correct choices required: 1
98
- • Maximum character length for the prompt: 320
99
- • Maximum character length for each choice: 42
100
95
 
101
- json schema for mcqs
96
+ json
102
97
  {
103
98
  "type": "mcq",
104
99
  "card_content": {
@@ -109,43 +104,46 @@ json schema for mcqs
109
104
  "... up to 8 choices"
110
105
  ]
111
106
  },
112
- "card_reference": "heading",
107
+ "card_reference": "source_title#heading",
113
108
  "concepts": ["Concept1", "Concept2", "..."],
114
109
  "facts": ["Fact1", "Fact2", "..."]
115
110
  }
116
111
 
117
- 3. Cloze:
118
- Fill-in-the-blank style test card. Use double curly braces {{}} to indicate a cloze this is absolute necessagr
119
112
  • Minimum choices required: 2
120
113
  • Maximum choices allowed: 8
121
114
  • Minimum correct choices required: 1
122
115
  • Maximum character length for the prompt: 320
123
- • Maximum character length for an individual cloze: 90
116
+ • Maximum character length for each choice: 42
117
+
118
+ 3. Cloze: Fill-in-the-blank style test card. Use double curly braces {{}} to indicate a cloze.
124
119
 
125
- json schema for cloze
120
+ json
126
121
  {
127
122
  "type": "cloze",
128
123
  "card_content": {
129
- "text": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
124
+ "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature.",
130
125
  "options": [
131
126
  {"option": "notes", "cloze": "c0"},
132
127
  {"option": "scale", "cloze": "c1"},
133
128
  {"option": "mode", "cloze": "c2"},
134
- {"option": "chords", "cloze": null},
129
+ {"option": "chords", "cloze": "null"},
135
130
  "... up to 8 choices"
136
131
  ]
137
132
  },
138
- "card_reference": "heading",
133
+ "card_reference": "source_title#heading",
139
134
  "concepts": ["Concept1", "Concept2", "..."],
140
135
  "facts": ["Fact1", "Fact2", "..."]
141
136
  }
142
137
 
143
-
138
+ • Minimum choices required: 2
139
+ • Maximum choices allowed: 8
140
+ • Minimum correct choices required: 1
141
+ • Maximum character length for the prompt: 320
142
+ • Maximum character length for an individual cloze: 90
144
143
 
145
144
  4. Match: Pairing items.
146
- • Maximum character length for each item in a pair: 42
147
145
 
148
- json schema for match
146
+ json
149
147
  {
150
148
  "type": "match",
151
149
  "card_content": {
@@ -153,11 +151,106 @@ json schema for match
153
151
  "right_choice 2": "left_choice 2",
154
152
  "... up to 8 total pairs"
155
153
  },
156
- "card_reference": "heading",
154
+ "card_reference": "source_title#heading",
157
155
  "concepts": ["Concept1", "Concept2", "..."],
158
156
  "facts": ["Fact1", "Fact2", "..."]
159
157
  }
160
158
 
159
+ • Maximum character length for each item in a pair: 42
160
+
161
+
162
+ The schema for each card type is below.
163
+
164
+ A flashcard consists of two sides: a front and a back. Both the front and back text content must not exceed more than 300 characters in length.
165
+
166
+ The content schema should be represented in this manner:
167
+ json
168
+ {
169
+ "front": "<content for the front of the flashcard>",
170
+ "back": "<content for the back of the flashcard>"
171
+ }
172
+
173
+
174
+ The schema for an mcq card is shown below.
175
+
176
+ json
177
+ {
178
+ "prompt": "<question text>",
179
+ "choices":
180
+ [
181
+ {
182
+ choice: "choice 1",
183
+ is_correct: true or false
184
+ },
185
+ {
186
+ choice: "choice 2",
187
+ is_correct: true or false
188
+ }
189
+ "... up to 8 choices"
190
+ ]
191
+ }
192
+
193
+ Minimum choices required: 2
194
+ Maximum choices allowed: 8
195
+ Minimum correct choices required: 1
196
+ Maximum character length for the prompt: 320
197
+ Maximum character length for each choice: 42
198
+
199
+
200
+ For questions of the "type": "cloze", which refers to a fill-in-the-blank style question, the format is outlined below. I have used the sample text here because it is easier to illustrate the schema with an example:
201
+
202
+ json
203
+ {
204
+ "prompt": "Accidentals in music denote {{c0:notes}} that do not belong to the {{c1:scale}} or {{c2:mode}} indicated by the key signature."
205
+ "options":
206
+ [
207
+ {
208
+ "option: "notes",
209
+ "cloze": "c0"
210
+ },
211
+ {
212
+ "option: "scale",
213
+ "cloze": "c1"
214
+ },
215
+ {
216
+ "option: "mode",
217
+ "cloze": "c2"
218
+ },
219
+ {
220
+ "option: "chords",
221
+ "cloze": "null"
222
+ },
223
+ {
224
+ "option: "tilda",
225
+ "cloze": "null"
226
+ },
227
+ {
228
+ "option: "score",
229
+ "cloze": "null"
230
+ },
231
+ "... up to a maximum of 8 choices total"
232
+ ]
233
+ }
234
+
235
+ Minimum choices required: 2
236
+ Maximum choices allowed: 8
237
+ Minimum correct choices required: 1
238
+ Maximum character length for the prompt: 320
239
+ Maximum character length for an individual cloze: 90
240
+
241
+ The schema for match type cards are as follows.
242
+ json
243
+ {
244
+ "right_choice 1": "left_choice 1",
245
+ "right_choice 2": "left_choice 2"
246
+ "right_choice 3": "left_choice 3"
247
+ "... up to 8 total pairs"
248
+ }
249
+
250
+ Maximum character length for each item in a pair: 42
251
+ Each test card needs a reference. A reference can either be the entire source or a specific heading in the source. Whenever possible, pick a main heading to direct the user to the most relevant part of the source material. The reference schema is as follows: source_title#main_heading, where #main_heading is optional.
252
+ PART 6
253
+
161
254
  Once you are done generating the test cards. Go back and evaulate the full list of concepts and fact that include any of the missing concepts or facts along with the list that was provided as the input.
162
255
 
163
256
  Are there any concept or fact that don't have a test card yet? If yes, go back and create one.
@@ -16,10 +16,7 @@ json
16
16
  "field": ["primary_field", "secondary_field", "tertiary_field"],
17
17
  "concepts": ["concept1", "concept2", "concept3", "..."],
18
18
  "facts": ["fact1", "fact2", "fact3", "..."],
19
- "generate_cards": [
20
- state: true or false,
21
- false_reason: "reason for marking the source as false. Leave empty for true."
22
- ],
19
+ "generate_cards": true or false
23
20
  "summary_cards": ["summary_card1", "summary_card2", "summary_card3", "..."]
24
21
  }
25
22
 
@@ -55,6 +52,7 @@ json
55
52
  {
56
53
  "concepts": ["concept1", "concept2", "concept3", "..."]
57
54
  }
55
+
58
56
  After classifying the content and identifying key concepts, proceed to extract and list verifiable facts. Facts are objective statements that must be supported by empirical evidence or observation, such as specific data on events, people, numbers, dates, or well-established ideas.
59
57
 
60
58
  1. **Definition of a Fact**: Ensure each fact is a standalone piece of information that is concrete and can be independently verified.
@@ -65,19 +63,19 @@ json
65
63
  {
66
64
  "facts": ["fact1", "fact2", "fact3", "..."]
67
65
  }
68
- After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals. If you decide that testing cards don't need to be generated then please provide a reason in less than 90 characters.
66
+
67
+ After analyzing the content, classifying its field, and identifying key concepts, and facts, assess whether the discovered elements warrant the creation of testing materials. Consider if these elements provide significant educational value to an average learner by enhancing understanding, offering practical applications, or supporting crucial educational goals.
69
68
 
70
69
  1. **Value Assessment**: Determine if the concepts and facts are essential for understanding the broader topic, are likely to be used in practical scenarios, or help in achieving educational benchmarks.
71
70
  2. **Criteria for Material Generation**: Generate testing materials if the concepts and facts are central to the content, have broad applicability, and are likely to reinforce or expand the learner’s knowledge significantly.
72
71
 
73
72
  Make your decision using this criterion and reflect it in the JSON format as follows:
74
73
  json
75
- "generate_cards":
76
- { state: true or false,
77
- false_reason: "reason for marking the source as false. Leave empty for true."
78
- }
74
+ {
75
+ "generate_cards": true or false
76
+ }
79
77
 
80
- After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
78
+ After analyzing the content, identifying key concepts, and facts, summarize the material using a series of engaging and informative cards. These cards should capture the essence of the content while highlighting the critical concepts and facts that you previously identified.
81
79
 
82
80
 
83
81
  1. **Inclusion Criteria**: The generate_cards should be true. Return an empty array if the generate_cards is false.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.returnFields = exports.returnHeadings = exports.returnSourceData = void 0;
3
+ exports.returnHeadings = exports.returnSourceData = void 0;
4
4
  const sourceString = [{ "block_type": "image", "img_src": "https://wikipedia.org/wiki/Special:Redirect/file/Electrolysis_Apparatus.png", "img_caption": "Illustration of a Hofmann electrolysis apparatus used in a school laboratory" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "In [[Chemistry|chemistry|0|wiki]] and [[Manufacturing|manufacturing|1|wiki]], **electrolysis** is a technique that uses [[Direct_current|direct electric current|2|wiki]] (DC) to drive an otherwise non-spontaneous [[Chemical_reaction|chemical reaction|3|wiki]]. Electrolysis is commercially important as a stage in the separation of [[Chemical_element|elements|4|wiki]] from naturally occurring sources such as [[Ores|ores|5|wiki]] using an [[Electrolytic_cell|electrolytic cell|6|wiki]]. The [[Voltage|voltage|7|wiki]] that is needed for electrolysis to occur is called the decomposition potential. The word \"lysis\" means to separate or break, so in terms, electrolysis would mean \"breakdown via electricity\"." }, { "block_type": "heading", "content": "Etymology", "heading_level": 1, "children": [{ "block_type": "paragraph", "content": "The word \"electrolysis\" was introduced by [[Michael_Faraday|Michael Faraday|8|wiki]] in 1834, using the [[Greek_language|Greek|9|wiki]] words ἤλεκτρον \"amber\", which since the 17th century was associated with [[Electrical_phenomena|electrical phenomena|10|wiki]], and λύσις meaning \"dissolution\". Nevertheless, electrolysis, as a tool to study chemical reactions and obtain pure [[Chemical_element|elements|11|wiki]], precedes the coinage of the term and formal description by Faraday." }] }, { "block_type": "heading", "content": "History", "heading_level": 1, "children": [{ "block_type": "paragraph", "content": "In the early nineteenth century, [[William_Nicholson_(chemist)|William Nicholson|12|wiki]] and [[Anthony_Carlisle|Anthony Carlisle|13|wiki]] sought to further [[Alessandro_Volta|Volta's|14|wiki]] experiments. They attached two wires to either side of a [[Voltaic_pile|voltaic pile|15|wiki]] and placed the other ends in a tube filled with water. They noticed when the wires were brought together that each wire produced bubbles. One type was hydrogen, the other was oxygen." }, { "block_type": "paragraph", "content": "In 1785 a Dutch scientist named [[Martin_van_Marum|Martin van Marum|16|wiki]] created an electrostatic generator that he used to reduce tin, zinc and antimony from their salts using a process later known as electrolysis. Though he unknowingly produced electrolysis, it was not until 1800 when William Nicholson and Anthony Carlisle discovered how electrolysis works." }, { "block_type": "paragraph", "content": "In 1791 [[Luigi_Galvani|Luigi Galvani|17|wiki]] experimented with frog legs. He claimed that placing animal muscle between two dissimilar metal sheets resulted in electricity. Responding to these claims, [[Alessandro_Volta|Alessandro Volta|18|wiki]] conducted his own tests. This would give insight to [[Humphry_Davy|Humphry Davy|19|wiki]]'s ideas on electrolysis. During preliminary experiments, Humphry Davy hypothesized that when two elements combine to form a compound, electrical energy is released. Humphry Davy would go on to create Decomposition Tables from his preliminary experiments on Electrolysis. The Decomposition Tables would give insight on the energies needed to break apart certain compounds." }, { "block_type": "paragraph", "content": "In 1817 [[Johan_August_Arfwedson|Johan August Arfwedson|20|wiki]] determined there was another element, lithium, in some of his samples; however, he could not isolate the component. It was not until 1821 that [[William_Thomas_Brande|William Thomas Brande|21|wiki]] used electrolysis to single it out. Two years later, he streamlined the process using lithium chloride and potassium chloride with electrolysis to produce lithium and lithium hydroxide." }, { "block_type": "paragraph", "content": "During the later years of Humphry Davy's research, Michael Faraday became his assistant. While studying the process of electrolysis under Humphry Davy, Michael Faraday discovered two [[Laws_of_electrolysis|laws of electrolysis|22|wiki]]." }, { "block_type": "paragraph", "content": "During the time of Maxwell and Faraday, concerns came about for [[Electropositive|electropositive|23|wiki]] and [[Electronegative|electronegative|24|wiki]] activities." }, { "block_type": "paragraph", "content": "In November 1875, [[Paul_Émile_Lecoq_de_Boisbaudran|Paul Émile Lecoq de Boisbaudran|25|wiki]] discovered [[Gallium|gallium|26|wiki]] using electrolysis of gallium hydroxide, producing 3.4 mg of gallium. The following December, he presented his discovery of gallium to the [[Académie_des_sciences|Académie des sciences|27|wiki]] in Paris." }, { "block_type": "paragraph", "content": "On June 26, 1886, [[Ferdinand_Frederick_Henri_Moissan|Ferdinand Frederick Henri Moissan|28|wiki]] finally felt comfortable performing electrolysis on [[Anhydrous|anhydrous|29|wiki]] hydrogen fluoride to create a gaseous fluorine pure element. Before he used hydrogen fluoride, Henri Moissan used fluoride salts with electrolysis. Thus on June 28, 1886, he performed his experiment in front of the Académie des sciences to show his discovery of the new element fluorine. While trying to find elemental fluorine through electrolysis of fluoride salts, many chemists perished including Paulin Louyet and Jérôme Nicklès." }, { "block_type": "paragraph", "content": "In 1886 [[Charles_Martin_Hall|Charles Martin Hall|30|wiki]] from America and [[Paul_Héroult|Paul Héroult|31|wiki]] from France both filed for American patents for the electrolysis of aluminum, with Héroult submitting his in May, and Hall, in July. Hall was able to get his patent by proving through letters to his brother and family evidence that his method was discovered before the French patent was submitted. This became known as the [[Hall–Héroult_process|Hall–Héroult process|32|wiki]] which benefited many industries because aluminum's price then dropped from four dollars to thirty cents per pound." }, { "block_type": "heading", "content": "Timeline", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "" }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "1785 – [[Martinus_van_Marum|Martinus van Marum|33|wiki]]'s electrostatic generator was used to reduce [[Tin|tin|34|wiki]], [[Zinc|zinc|35|wiki]], and [[Antimony|antimony|36|wiki]] from their salts using electrolysis." }, { "block_type": "list_item", "content": "1800 – [[William_Nicholson_(chemist)|William Nicholson|37|wiki]] and [[Anthony_Carlisle|Anthony Carlisle|38|wiki]] (and also [[Johann_Ritter|Johann Ritter|39|wiki]]), decomposed [[Water|water|40|wiki]] into [[Hydrogen|hydrogen|41|wiki]] and [[Oxygen|oxygen|42|wiki]]." }, { "block_type": "list_item", "content": "1808 – [[Potassium|Potassium|43|wiki]] (1807), [[Sodium|sodium|44|wiki]] (1807), [[Barium|barium|45|wiki]], [[Calcium|calcium|46|wiki]] and [[Magnesium|magnesium|47|wiki]] were discovered by [[Sir_Humphry_Davy|Humphry Davy|48|wiki]] using electrolysis." }, { "block_type": "list_item", "content": "1821 – [[Lithium|Lithium|49|wiki]] was discovered by the English chemist [[William_Thomas_Brande|William Thomas Brande|50|wiki]], who obtained it by electrolysis of lithium oxide." }, { "block_type": "list_item", "content": "1834 – [[Michael_Faraday|Michael Faraday|51|wiki]] published his [[Faraday's_laws_of_electrolysis|two laws of electrolysis|52|wiki]], provided a mathematical explanation for them, and introduced terminology such as electrode, electrolyte, anode, cathode, anion, and cation." }, { "block_type": "list_item", "content": "1875 – [[Paul_Émile_Lecoq_de_Boisbaudran|Paul Émile Lecoq de Boisbaudran|53|wiki]] discovered [[Gallium|gallium|54|wiki]] using electrolysis." }, { "block_type": "list_item", "content": "1886 – [[Fluorine|Fluorine|55|wiki]] was discovered by [[Henri_Moissan|Henri Moissan|56|wiki]] using electrolysis." }, { "block_type": "list_item", "content": "1886 – [[Hall–Héroult_process|Hall–Héroult process|57|wiki]] developed for making [[Aluminium|aluminium|58|wiki]]." }, { "block_type": "list_item", "content": "1890 – [[Castner–Kellner_process|Castner–Kellner process|59|wiki]] developed for making [[Sodium_hydroxide|sodium hydroxide|60|wiki]]." }] }] }] }, { "block_type": "heading", "content": "Overview", "heading_level": 1, "children": [{ "block_type": "paragraph", "content": "Electrolysis is the passing of a [[Direct_current|direct electric current|61|wiki]] through an [[Electrolyte|electrolyte|62|wiki]] producing chemical reactions at the [[Electrode|electrodes|63|wiki]] and [[Chemical_decomposition|decomposition|64|wiki]] of the materials." }, { "block_type": "paragraph", "content": "The main components required to achieve electrolysis are an [[Electrolyte|electrolyte|65|wiki]], electrodes, and an external power source. A partition (e.g. an [[Ion-exchange_membrane|ion-exchange membrane|66|wiki]] or a [[Salt_bridge|salt bridge|67|wiki]]) is optional to keep the products from diffusing to the vicinity of the opposite electrode." }, { "block_type": "paragraph", "content": "The electrolyte is a [[Chemical_substance|chemical substance|68|wiki]] which contains [[Ion|free ions|69|wiki]] and carries [[Electric_current|electric current|70|wiki]] (e.g. an ion-conducting [[Polymer|polymer|71|wiki]], solution, or a [[Ionic_liquid|ionic liquid|72|wiki]] compound). If the ions are not mobile, as in most solid [[Salt_(chemistry)|salts|73|wiki]], then electrolysis cannot occur. A liquid electrolyte is produced by:" }, { "block_type": "paragraph", "content": "The electrodes are immersed separated by a distance such that a current flows between them through the [[Electrolyte|electrolyte|74|wiki]] and are connected to the power source which completes the [[Electrical_circuit|electrical circuit|75|wiki]]. A [[Direct_current|direct current|76|wiki]] supplied by the power source drives the reaction causing ions in the electrolyte to be attracted toward the respective oppositely charged electrode." }, { "block_type": "paragraph", "content": "Electrodes of [[Metal|metal|77|wiki]], [[Graphite|graphite|78|wiki]] and [[Semiconductor|semiconductor|79|wiki]] material are widely used. Choice of suitable [[Electrode|electrode|80|wiki]] depends on chemical reactivity between the electrode and electrolyte and manufacturing cost. Historically, when non-reactive anodes were desired for electrolysis, graphite (called plumbago in Faraday's time) or platinum were chosen. They were found to be some of the least reactive materials for anodes. Platinum erodes very slowly compared to other materials, and graphite crumbles and can produce carbon dioxide in aqueous solutions but otherwise does not participate in the reaction. Cathodes may be made of the same material, or they may be made from a more reactive one since anode wear is greater due to oxidation at the anode." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Solvation|Solvation|81|wiki]] or reaction of an [[Ionic_compound|ionic compound|82|wiki]] with a [[Solvent|solvent|83|wiki]] (such as water) to produce mobile ions" }, { "block_type": "list_item", "content": "An ionic compound melted by heating" }] }, { "block_type": "heading", "content": "Process of electrolysis", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "The key process of electrolysis is the interchange of atoms and ions by the removal or addition of electrons due to the applied current. The desired products of electrolysis are often in a different physical state from the electrolyte and can be removed by mechanical processes (e.g. by collecting gas above an electrode or precipitating a product out of the electrolyte)." }, { "block_type": "paragraph", "content": "The quantity of the products is proportional to the current, and when two or more electrolytic cells are connected in series to the same power source, the products produced in the cells are proportional to their [[Equivalent_weight|equivalent weight|84|wiki]]. These are known as [[Faraday's_laws_of_electrolysis|Faraday's laws of electrolysis|85|wiki]]." }, { "block_type": "paragraph", "content": "Each electrode attracts ions that are of the opposite [[Electric_charge|charge|86|wiki]]. Positively charged ions ([[Cation|cations|87|wiki]]) move towards the electron-providing (negative) cathode. Negatively charged ions ([[Anion|anions|88|wiki]]) move towards the electron-extracting (positive) anode. In this process [[Electron|electrons|89|wiki]] are effectively introduced at the cathode as a [[Reagent|reactant|90|wiki]] and removed at the anode as a [[Product_(chemistry)|product|91|wiki]]. In chemistry, the loss of electrons is called [[Oxidation|oxidation|92|wiki]], while electron gain is called [[Reduction_(chemistry)|reduction|93|wiki]]." }, { "block_type": "paragraph", "content": "When neutral atoms or molecules, such as those on the surface of an electrode, gain or lose electrons they become ions and may dissolve in the electrolyte and react with other ions." }, { "block_type": "paragraph", "content": "When ions gain or lose electrons and become neutral, they will form compounds that separate from the electrolyte. Positive metal ions like Cu2+ deposit onto the cathode in a layer. The terms for this are [[Electroplating|electroplating|94|wiki]], [[Electrowinning|electrowinning|95|wiki]], and [[Electrorefining|electrorefining|96|wiki]]." }, { "block_type": "paragraph", "content": "When an ion gains or loses electrons without becoming neutral, its electronic charge is altered in the process." }, { "block_type": "paragraph", "content": "For example, the [[Chloralkali_process|electrolysis of brine|97|wiki]] produces hydrogen and chlorine gases which bubble from the electrolyte and are collected. The initial overall reaction is thus:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "The reaction at the anode results in chlorine gas from chlorine ions:" }, { "block_type": "paragraph", "content": "The reaction at the cathode results in hydrogen gas and hydroxide ions:" }, { "block_type": "paragraph", "content": "Without a partition between the electrodes, the OH− ions produced at the cathode are free to diffuse throughout the electrolyte to the anode. As the electrolyte becomes more [[Base_(chemistry)|basic|98|wiki]] due to the production of OH−, less Cl2 emerges from the solution as it begins to react with the hydroxide producing [[Hypochlorite|hypochlorite|99|wiki]] (ClO−) at the anode:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "The more opportunity the Cl2 has to interact with NaOH in the solution, the less Cl2 emerges at the surface of the solution and the faster the production of hypochlorite progresses. This depends on factors such as solution temperature, the amount of time the Cl2 molecule is in contact with the solution, and concentration of NaOH." }, { "block_type": "paragraph", "content": "Likewise, as hypochlorite increases in concentration, chlorates are produced from them:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "Other reactions occur, such as the [[Self-ionization_of_water|self-ionization of water|100|wiki]] and the decomposition of hypochlorite at the cathode, the rate of the latter depends on factors such as [[Diffusion|diffusion|101|wiki]] and the surface area of the cathode in contact with the electrolyte." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "2 NaCl + 2 H2O → 2 NaOH + H2 + Cl2" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "2 Cl− → Cl2 + 2 e−" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "2 H2O + 2 e− → H2 + 2 OH−" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Cl2 + 2 NaOH → NaCl + NaClO + H2O" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "3 NaClO → NaClO3 + 2 NaCl" }] }] }, { "block_type": "heading", "content": "Decomposition potential", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "Decomposition potential or decomposition voltage refers to the minimum voltage (difference in [[Electrode_potential|electrode potential|102|wiki]]) between [[Anode|anode|103|wiki]] and [[Cathode|cathode|104|wiki]] of an electrolytic cell that is needed for electrolysis to occur." }, { "block_type": "paragraph", "content": "The voltage at which electrolysis is thermodynamically preferred is the difference of the electrode potentials as calculated using the [[Nernst_equation|Nernst equation|105|wiki]]. Applying additional voltage, referred to as [[Overpotential|overpotential|106|wiki]], can increase the rate of reaction and is often needed above the thermodynamic value. It is especially necessary for electrolysis reactions involving gases, such as [[Oxygen|oxygen|107|wiki]], [[Hydrogen|hydrogen|108|wiki]] or [[Chlorine|chlorine|109|wiki]]." }] }, { "block_type": "heading", "content": "Oxidation and reduction at the electrodes", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "[[Oxidation|Oxidation|110|wiki]] of ions or neutral molecules occurs at the [[Anode|anode|111|wiki]]. For example, it is possible to oxidize ferrous ions to ferric ions at the anode: [[Redox|Reduction|112|wiki]] of ions or neutral molecules occurs at the [[Cathode|cathode|113|wiki]]. It is possible to reduce [[Ferricyanide|ferricyanide|114|wiki]] ions to [[Ferrocyanide|ferrocyanide|115|wiki]] ions at the cathode:" }, { "block_type": "paragraph", "content": "Neutral molecules can also react at either of the electrodes. For example: *p*-benzoquinone can be reduced to hydroquinone at the cathode:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "In the last example, H+ ions (hydrogen ions) also take part in the reaction and are provided by the acid in the solution, or by the solvent itself (water, methanol, etc.). Electrolysis reactions involving H+ ions are fairly common in acidic solutions. In aqueous alkaline solutions, reactions involving OH− (hydroxide ions) are common." }, { "block_type": "paragraph", "content": "Sometimes the solvents themselves (usually water) are oxidized or reduced at the electrodes. It is even possible to have electrolysis involving gases, e.g. by using a [[Gas_diffusion_electrode|gas diffusion electrode|116|wiki]]." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Fe(aq) → Fe(aq) + e−" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Fe(CN) + e− → Fe(CN)" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Image:P-Benzochinon.svg|35px|117|wiki]] + 2 e− + 2 H+ → [[Image:Hydrochinon2.svg|90px|118|wiki]]" }] }] }, { "block_type": "heading", "content": "Energy changes during electrolysis", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "The amount of electrical energy that must be added equals the change in [[Gibbs_free_energy|Gibbs free energy|119|wiki]] of the reaction plus the losses in the system. The losses can (in theory) be arbitrarily close to zero, so the maximum [[Thermodynamics|thermodynamic|120|wiki]] efficiency equals the [[Enthalpy|enthalpy|121|wiki]] change divided by the free energy change of the reaction. In most cases, the electric input is larger than the enthalpy change of the reaction, so some energy is released in the form of heat. In some cases, for instance, in the electrolysis of [[Steam|steam|122|wiki]] into hydrogen and oxygen at high temperature, the opposite is true and heat energy is absorbed. This heat is absorbed from the surroundings, and the [[Heating_value|heating value|123|wiki]] of the produced hydrogen is higher than the electric input." }] }, { "block_type": "heading", "content": "Variations", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "[[Pulsed_DC|Pulsating current|124|wiki]] results in products different from DC. For example, pulsing increases the ratio of [[Ozone|ozone|125|wiki]] to oxygen produced at the anode in the electrolysis of an aqueous acidic solution such as dilute sulphuric acid. Electrolysis of ethanol with pulsed current evolves an aldehyde instead of primarily an acid." }] }, { "block_type": "heading", "content": "Related processes", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "[[Galvanic_cell|Galvanic cells|126|wiki]] and [[Electric_battery|batteries|127|wiki]] use spontaneous, energy-releasing [[Redox_reactions|redox reactions|128|wiki]] to generate an electrical potential that provides useful power. When a [[Electric_battery|secondary battery|129|wiki]] is charged, its redox reaction is run in reverse and the system can be considered as an [[Electrolytic_cell|electrolytic cell|130|wiki]]." }] }] }, { "block_type": "heading", "content": "Industrial uses", "heading_level": 1, "children": [{ "block_type": "image", "img_src": "https://wikipedia.org/wiki/Special:Redirect/file/Hall-heroult-kk-2008-12-31.png", "img_caption": "Hall–Héroult process for producing aluminium" }, { "block_type": "paragraph", "content": "" }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Electrometallurgy|Electrometallurgy|131|wiki]] of [[Aluminium|aluminium|132|wiki]], [[Lithium|lithium|133|wiki]], [[Sodium|sodium|134|wiki]], [[Potassium|potassium|135|wiki]], [[Magnesium|magnesium|136|wiki]], [[Calcium|calcium|137|wiki]], and in some cases [[Copper|copper|138|wiki]]." }, { "block_type": "list_item", "content": "[[Chlorine_production|Production of chlorine|139|wiki]] and [[Sodium_hydroxide|sodium hydroxide|140|wiki]], called the [[Chloralkali_process|Chloralkali process|141|wiki]]." }, { "block_type": "list_item", "content": "Production of [[Sodium_chlorate|sodium chlorate|142|wiki]] and [[Potassium_chlorate|potassium chlorate|143|wiki]]." }, { "block_type": "list_item", "content": "Production of perfluorinated organic compounds such as [[Trifluoroacetic_acid|trifluoroacetic acid|144|wiki]] by the process of [[Electrofluorination|electrofluorination|145|wiki]]." }, { "block_type": "list_item", "content": "[[Copper_extraction_techniques|Purifying copper|146|wiki]] from refined [[Copper|copper|147|wiki]]." }, { "block_type": "list_item", "content": "Production of fuels such as [[Hydrogen|hydrogen|148|wiki]] for [[Spacecraft|spacecraft|149|wiki]], [[Nuclear_submarines|nuclear submarines|150|wiki]] and [[FCEV|vehicles|151|wiki]]." }, { "block_type": "list_item", "content": "[[Rust|Rust removal|152|wiki]] and cleaning of old coins and other metallic objects." }] }, { "block_type": "heading", "content": "Manufacturing processes", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "In manufacturing, electrolysis can be used for:" }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Electroplating|Electroplating|153|wiki]], where a thin film of metal is deposited over a substrate material. Electroplating is used in many industries for either functional or decorative purposes, as in-vehicle bodies and nickel coins." }, { "block_type": "list_item", "content": "[[Electrochemical_machining|Electrochemical machining|154|wiki]] (ECM), where an electrolytic cathode is used as a shaped tool for removing material by anodic oxidation from a workpiece. ECM is often used as a technique for [[Burr_(edge)|deburring|155|wiki]] or for etching metal surfaces like tools or knives with a permanent mark or logo." }] }] }] }, { "block_type": "heading", "content": "Competing half-reactions in solution electrolysis", "heading_level": 1, "children": [{ "block_type": "paragraph", "content": "Using a cell containing inert platinum electrodes, electrolysis of aqueous solutions of some salts leads to the reduction of the cations (such as metal deposition with, for example, zinc salts) and oxidation of the anions (such as the evolution of bromine with bromides). However, with salts of some metals (such as sodium) hydrogen is evolved at the cathode, and for salts containing some anions (such as sulfate ) oxygen is evolved at the anode. In both cases, this is due to water being reduced to form hydrogen or oxidized to form oxygen. In principle, the voltage required to electrolyze a salt solution can be derived from the [[Standard_electrode_potential|standard electrode potential|156|wiki]] for the reactions at the anode and cathode. The standard electrode potential is directly related to the [[Gibbs_free_energy|Gibbs free energy|157|wiki]], Δ*G*, for the reactions at each electrode and refers to an electrode with no current flowing. An extract from the [[Table_of_standard_electrode_potentials|table of standard electrode potentials|158|wiki]] is shown below." }, { "block_type": "paragraph", "content": "! [[Half-reaction|Half-reaction|159|wiki]] ! *E*° (V) ! Ref. In terms of electrolysis, this table should be interpreted as follows:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "Using the [[Nernst_equation|Nernst equation|160|wiki]] the [[Electrode_potential|electrode potential|161|wiki]] can be calculated for a specific concentration of ions, temperature and the number of electrons involved. For pure water ([[PH|pH|162|wiki]] 7): Comparable figures calculated in a similar way, for 1 M [[Zinc_bromide|zinc bromide|163|wiki]], ZnBr2, are −0.76 V for the reduction to Zn metal and +1.10 V for the oxidation producing bromine. The conclusion from these figures is that hydrogen should be produced at the cathode and oxygen at the anode from the electrolysis of water—which is at variance with the experimental observation that zinc metal is deposited and bromine is produced. The explanation is that these calculated potentials only indicate the thermodynamically preferred reaction. In practice, many other factors have to be taken into account such as the kinetics of some of the reaction steps involved. These factors together mean that a higher potential is required for the reduction and oxidation of water than predicted, and these are termed [[Overpotential|overpotentials|164|wiki]]. Experimentally it is known that overpotentials depend on the design of the cell and the nature of the electrodes." }, { "block_type": "paragraph", "content": "For the electrolysis of a neutral (pH 7) sodium chloride solution, the reduction of sodium ion is thermodynamically very difficult and water is reduced evolving hydrogen leaving hydroxide ions in solution. At the anode the oxidation of [[Chlorine|chlorine|165|wiki]] is observed rather than the oxidation of [[Water|water|166|wiki]] since the overpotential for the oxidation of [[Chloride|chloride|167|wiki]] to chlorine is lower than the overpotential for the oxidation of water to [[Oxygen|oxygen|168|wiki]]. The [[Hydroxide_ion|hydroxide ions|169|wiki]] and dissolved chlorine gas react further to form [[Hypochlorous_acid|hypochlorous acid|170|wiki]]. The aqueous solutions resulting from this process is called [[Electrolyzed_water|electrolyzed water|171|wiki]] and is used as a disinfectant and cleaning agent." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "{| class=\"wikitable\"" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Sodium|Na|172|wiki]]+ + e− Na(s)" }, { "block_type": "list_item", "content": "−2.71 ||" }, { "block_type": "list_item", "content": "[[Zinc|Zn|173|wiki]]2+ + 2 e− Zn(s)" }, { "block_type": "list_item", "content": "−0.7618 ||" }, { "block_type": "list_item", "content": "**2 H+ + 2 e− H2(g)**" }, { "block_type": "list_item", "content": "**≡ 0**||" }, { "block_type": "list_item", "content": "Br2(aq) + 2 e− 2 Br−" }, { "block_type": "list_item", "content": "+1.0873 ||" }, { "block_type": "list_item", "content": "O2(g) + 4 H+ + 4 e− 2 H2O" }, { "block_type": "list_item", "content": "+1.23 ||" }, { "block_type": "list_item", "content": "Cl2(g) + 2 e− 2 Cl−" }, { "block_type": "list_item", "content": "+1.36 ||" }, { "block_type": "list_item", "content": "+ 2 e− 2" }, { "block_type": "list_item", "content": "+2.07 ||" }, { "block_type": "list_item", "content": "}" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Cl2(g) + 2 e− 2 Cl−" }, { "block_type": "list_item", "content": "+1.36 ||" }, { "block_type": "list_item", "content": "+ 2 e− 2" }, { "block_type": "list_item", "content": "+2.07 ||" }, { "block_type": "list_item", "content": "}" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "+2.07 ||" }, { "block_type": "list_item", "content": "}" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Moving *down* the table, *E*° becomes more positive, and species on the *left* are more likely to be *reduced*: for example, zinc ions are more likely to be reduced to zinc metal than sodium ions are to be reduced to sodium metal." }, { "block_type": "list_item", "content": "Moving *up* the table, *E*° becomes more negative, and species on the *right* are more likely to be *oxidized*: for example, sodium metal is more likely to be oxidized to sodium ions than zinc metal is to be oxidized to zinc ions." }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "the electrode potential for the reduction producing hydrogen is −0.41 V," }, { "block_type": "list_item", "content": "the electrode potential for the oxidation producing oxygen is +0.82 V." }] }] }, { "block_type": "heading", "content": "Research trends", "heading_level": 1, "children": [{ "block_type": "heading", "content": "Electrolysis of carbon dioxide", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "The electrochemical reduction or electrocatalytic conversion of [[Carbon_dioxide|CO2|174|wiki]] can produce value-added chemicals such [[Methane|methane|175|wiki]], [[Ethylene|ethylene|176|wiki]], [[Ethanol|ethanol|177|wiki]], etc. The electrolysis of carbon dioxide gives formate or carbon monoxide, but sometimes more elaborate organic compounds such as [[Ethylene|ethylene|178|wiki]]. This technology is under research as a carbon-neutral route to organic compounds." }] }, { "block_type": "heading", "content": "Electrolysis of acidified water", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "Electrolysis of water produces [[Hydrogen|hydrogen|179|wiki]] and oxygen in a ratio of 2 to 1 respectively." }, { "block_type": "paragraph", "content": "The [[Energy_conversion_efficiency|energy efficiency|180|wiki]] of water electrolysis varies widely. The efficiency of an electrolyzer is a measure of the enthalpy contained in the hydrogen (to undergo combustion with oxygen or some other later reaction), compared with the input electrical energy. Heat/enthalpy values for hydrogen are well published in science and engineering texts, as 144 MJ/kg. Note that fuel cells (not electrolyzers) cannot use this full amount of heat/enthalpy, which has led to some confusion when calculating efficiency values for both types of technology. In the reaction, some energy is lost as heat. Some reports quote efficiencies between 50% and 70% for alkaline electrolyzers; however, much higher practical efficiencies are available with the use of [[Polymer_electrolyte_membrane_electrolysis|polymer electrolyte membrane electrolysis|181|wiki]] and catalytic technology, such as 95% efficiency." }, { "block_type": "paragraph", "content": "The [[National_Renewable_Energy_Laboratory|National Renewable Energy Laboratory|182|wiki]] estimated in 2006 that 1 kg of hydrogen (roughly equivalent to 3 kg, or 4 liters, of petroleum in energy terms) could be produced by wind powered electrolysis for between US$5.55 in the near term and US$2.27 in the longer term." }, { "block_type": "paragraph", "content": "About 4% of hydrogen gas produced worldwide is generated by electrolysis, and normally used onsite. Hydrogen is used for the creation of ammonia for fertilizer via the [[Haber_process|Haber process|183|wiki]], and converting heavy petroleum sources to lighter fractions via [[Hydrocracking|hydrocracking|184|wiki]]. Recently, onsite electrolysis has been utilized to capture hydrogen for hydrogen fuel-cells in [[Hydrogen_vehicles|hydrogen vehicles|185|wiki]]." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "2 H2O(l) → 2 H2(g) + O2(g) *E*° = +1.229 V" }] }] }, { "block_type": "heading", "content": "Carbon/hydrocarbon assisted water electrolysis", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "Recently, to reduce the energy input, the utilization of carbon ([[Coal|coal|186|wiki]]), [[Alcohol_(chemistry)|alcohols|187|wiki]] (hydrocarbon solution), and organic solution ([[Glycerol|glycerol|188|wiki]], formic acid, [[Ethylene_glycol|ethylene glycol|189|wiki]], etc.) with co-electrolysis of water has been proposed as a viable option. The carbon/hydrocarbon assisted water electrolysis (so-called CAWE) process for hydrogen generation would perform this operation in a single [[Electrochemical|electrochemical|190|wiki]] reactor. This system energy balance can be required only around 40% electric input with 60% coming from the chemical energy of carbon or hydrocarbon. This process utilizes solid coal/carbon particles or powder as fuels dispersed in acid/alkaline electrolyte in the form of slurry and the carbon contained source co-assist in the electrolysis process as following theoretical overall reactions:" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "or" }, { "block_type": "paragraph", "content": "" }, { "block_type": "paragraph", "content": "Thus, this CAWE approach is that the actual cell overpotential can be significantly reduced to below 1.0 V as compared to 1.5 V for conventional water electrolysis." }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Carbon/Coal slurry (C + 2H2O) → CO2 + 2H2 *E*′ = 0.21 V (reversible voltage) / *E*′ = 0.46 V (thermo-neutral voltage)" }] }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "Carbon/Coal slurry (C + H2O) → CO + H2 *E*′ = 0.52 V (reversible voltage) / *E*′ = 0.91 V (thermo-neutral voltage)" }] }] }, { "block_type": "heading", "content": "Electrocrystallization", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "A specialized application of electrolysis involves the growth of conductive crystals on one of the electrodes from oxidized or reduced species that are generated in situ. The technique has been used to obtain single crystals of low-dimensional electrical conductors, such as [[Charge-transfer_salt|charge-transfer salts|191|wiki]] and [[Linear_chain_compound|linear chain compounds|192|wiki]]." }] }, { "block_type": "heading", "content": "Electrolysis of Iron Ore", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "The current method of producing steel from [[Iron_ore|iron ore|193|wiki]] is very carbon intensive, in part to the direct release of CO2 in the blast furnace. A study of steel making in Germany found that producing 1 ton of steel emitted 2.1 tons of [[Global_warming_potential|CO2e|194|wiki]] with 22% of that being direct emissions from the blast furnace. As of 2022, steel production contributes 7–9% of global emissions. Electrolysis of iron can eliminate direct emissions and further reduce emissions if the electricity is created from green energy." }, { "block_type": "paragraph", "content": "The small-scale electrolysis of iron has been successfully reported by dissolving it in molten [[Oxide|oxide|195|wiki]] salts and using a platinum anode. Oxygen anions form oxygen gas and electrons at the anode. Iron cations consume electrons and form iron metal at the cathode. This method was performed a temperature of 1550 °C which presents a significant challenge to maintaining the reaction. Particularly, anode [[Corrosion|corrosion|196|wiki]] is a concern at these temperatures." }, { "block_type": "paragraph", "content": "Additionally, the low temperature reduction of iron oxide by dissolving it in alkaline water has been reported. The temperature is much lower than traditional iron production at 114 °C. The low temperatures also tend to correlate with higher current efficiencies, with an efficiency of 95% being reported. While these methods are promising, they struggle to be cost competitive because of the large economies of scale keeping the price of blast furnace iron low." }] }, { "block_type": "heading", "content": "Electrolysis of seawater", "heading_level": 2, "children": [{ "block_type": "paragraph", "content": "A 2020 study investigated direct electrolysis of seawater, alkaline electrolysis, [[Proton-exchange_membrane|proton-exchange membrane electrolysis|197|wiki]], and [[Solid_oxide_electrolyzer_cell|solid oxide electrolysis|198|wiki]]. Direct electrolysis of seawater follows known processes, forming an electrolysis cell in which the seawater acts as the electrolyte to allow for the reaction at the [[Anode|anode|199|wiki]], and the reaction at the [[Cathode|cathode|200|wiki]],. The inclusion of [[Magnesium|magnesium|201|wiki]] and [[Calcium|calcium|202|wiki]] [[Ion|ions|203|wiki]] in the seawater makes the production of alkali [[Hydroxide|hydroxides|204|wiki]] possible that could form scales in the electrolyser cell, cutting down on lifespan and increasing the need for maintenance. The alkaline electrolyzers operate with the following reactions at the anode, and cathode,, and use high base solutions as electrolytes, operating at 60-90 C and need additional separators to ensure the gas phase hydrogen and oxygen remain separate. The electrolyte can easily get contaminated, but the alkaline electrolyser can operate under pressure to improve energy consumption. The electrodes can be made of inexpensive materials and there's no requirement for an expensive catalyst in the design. Proton-exchange membrane electrolyzers operate with the reactions at the anode, and cathode,, at temperatures of 60-80 C, using a solid polymer electrolyte and requiring higher costs of processing to allow the solid electrolyte to touch uniformly to the electrodes. Similar to the alkaline electrolyzer, the proton exchange membrane electrolyser can operate at higher pressures, reducing the energy costs required to compress the hydrogen gas afterward, but the proton exchange membrane electrolyser also benefits from rapid response times to changes in power requirements or demands and not needing maintenance, at the cost of having a faster inherent degradation rate and being the most vulnerable to impurities in the water. Solid oxide electrolyzers run the reactions at the anode and at the cathode.The solid oxide electrolyzers require high temperatures (700-1000 C) to operate, generating superheated steam. They suffer from degradation when turned off, making it a more inflexible hydrogen generation technology. In a selected series of [[Multiple-criteria_decision_analysis|multiple-criteria decision-analysis|205|wiki]] comparisons in which the highest priority was placed on economic operation costs followed equally by environmental and social criteria, it was found that the proton exchange membrane electrolyser offered the most suitable combination of values (e.g., investment cost, maintenance, and operation cost, resistance to impurities, specific energy for hydrogen production at sea, risk of environmental impact, etc.), followed by the alkaline electrolyzer, with the alkaline electrolyser being the most economically feasible, but more hazardous in terms of safety and environmental concerns due to the need for basic electrolyte solutions as opposed to the solid polymers used in proton-exchange membranes. Due to the methods conducted in multiple-criteria decision analysis, non-objective weights are applied to the various factors, and so multiple methods of decision analysis were performed simultaneously to examine the electrolyzers in a way that minimizes the effects of bias on the performance conclusions." }] }] }, { "block_type": "heading", "content": "See also", "heading_level": 1, "children": [{ "block_type": "paragraph", "content": "" }, { "block_type": "list", "list_type": "ordered", "content": [{ "block_type": "list_item", "content": "[[Alkaline_water_electrolysis|Alkaline water electrolysis|206|wiki]]" }, { "block_type": "list_item", "content": "[[Castner–Kellner_process|Castner–Kellner process|207|wiki]]" }, { "block_type": "list_item", "content": "[[Electrolytic_cell|Electrolytic cell|208|wiki]]" }, { "block_type": "list_item", "content": "[[Electrochemical_engineering|Electrochemical engineering|209|wiki]]" }, { "block_type": "list_item", "content": "[[Faraday's_law_of_electrolysis|Faraday's law of electrolysis|210|wiki]]" }, { "block_type": "list_item", "content": "[[Faraday_constant|Faraday constant|211|wiki]]" }, { "block_type": "list_item", "content": "[[Faraday_efficiency|Faraday efficiency|212|wiki]]" }, { "block_type": "list_item", "content": "[[Galvanic_corrosion|Galvanic corrosion|213|wiki]]" }, { "block_type": "list_item", "content": "[[Galvanoluminescence|Galvanoluminescence|214|wiki]]" }, { "block_type": "list_item", "content": "[[Gas_cracker|Gas cracker|215|wiki]]" }, { "block_type": "list_item", "content": "[[Hall–Héroult_process|Hall–Héroult process|216|wiki]]" }, { "block_type": "list_item", "content": "[[High-pressure_electrolysis|High-pressure electrolysis|217|wiki]]" }, { "block_type": "list_item", "content": "[[Overpotential|Overpotential|218|wiki]]" }, { "block_type": "list_item", "content": "[[Patterson_Power_Cell|Patterson Power Cell|219|wiki]]" }, { "block_type": "list_item", "content": "[[Thermochemical_cycle|Thermochemical cycle|220|wiki]]" }, { "block_type": "list_item", "content": "[[Timeline_of_hydrogen_technologies|Timeline of hydrogen technologies|221|wiki]]" }, { "block_type": "list_item", "content": "[[PEM_electrolysis|PEM electrolysis|222|wiki]]" }] }] }, { "block_type": "heading", "content": "References", "heading_level": 1, "children": [] }];
5
5
  const headings = [
6
6
  "Etymology",
@@ -20,7 +20,3 @@ function returnHeadings() {
20
20
  return headings;
21
21
  }
22
22
  exports.returnHeadings = returnHeadings;
23
- function returnFields() {
24
- return ["Sciences", "Technology & Engineering", "Humanities & Cultural Studies", "Social Sciences & Global Studies", "Business & Management", "Health & Medicine", "Environmental Studies & Earth Sciences", "Education, Learning & Personal Development", "Creative & Performing Arts", "Law, Governance & Ethics", "Recreation, Lifestyle & Practical Skills", "Technology & Media Literacy", "Philosophy & Critical Thinking", "Space & Astronomical Sciences", "Agriculture & Food Sciences", "Trades & Craftsmanship", "Reference & Indexing", "Other"];
25
- }
26
- exports.returnFields = returnFields;