`); let searchUrl = `/search/`; history.forEach((elem) => { prevsearch.find('#prevsearch-options').append(`
${elem} `); }); } $('#search-pretype-options').empty(); $('#search-pretype-options').append(prevsearch); let prevbooks = $(false); [ {title:"Recently Opened Textbooks", books:previous_books}, {title:"Recommended Textbooks", books:recommended_books} ].forEach((book_segment) => { if (Array.isArray(book_segment.books) && book_segment.books.length>0 && nsegments<2) { nsegments+=1; prevbooks = $(`
${book_segment.title} `); let searchUrl = "/books/xxx/"; book_segment.books.forEach((elem) => { prevbooks.find('#prevbooks-options'+nsegments.toString()).append(`
${elem.title} ${ordinal(elem.edition)} ${elem.author} `); }); } $('#search-pretype-options').append(prevbooks); }); } function anon_pretype() { let prebooks = null; try { prebooks = JSON.parse(localStorage.getItem('PRETYPE_BOOKS_ANON')); }catch(e) {} if ('previous_books' in prebooks && 'recommended_books' in prebooks) { previous_books = prebooks.previous_books; recommended_books = prebooks.recommended_books; if (typeof PREVBOOKS !== 'undefined' && Array.isArray(PREVBOOKS)) { new_prevbooks = PREVBOOKS; previous_books.forEach(elem => { for (let i = 0; i < new_prevbooks.length; i++) { if (elem.id == new_prevbooks[i].id) { return; } } new_prevbooks.push(elem); }); new_prevbooks = new_prevbooks.slice(0,3); previous_books = new_prevbooks; } if (typeof RECBOOKS !== 'undefined' && Array.isArray(RECBOOKS)) { new_recbooks = RECBOOKS; for (let j = 0; j < new_recbooks.length; j++) { new_recbooks[j].viewed_at = new Date(); } let insert = true; for (let i=0; i < recommended_books.length; i++){ for (let j = 0; j < new_recbooks.length; j++) { if (recommended_books[i].id == new_recbooks[j].id) { insert = false; } } if (insert){ new_recbooks.push(recommended_books[i]); } } new_recbooks.sort((a,b)=>{ adate = new Date(2000, 0, 1); bdate = new Date(2000, 0, 1); if ('viewed_at' in a) {adate = new Date(a.viewed_at);} if ('viewed_at' in b) {bdate = new Date(b.viewed_at);} // 100000000: instead of just erasing the suggestions from previous week, // we just move them to the back of the queue acurweek = ((new Date()).getDate()-adate.getDate()>7)?0:100000000; bcurweek = ((new Date()).getDate()-bdate.getDate()>7)?0:100000000; aviews = 0; bviews = 0; if ('views' in a) {aviews = acurweek+a.views;} if ('views' in b) {bviews = bcurweek+b.views;} return bviews - aviews; }); new_recbooks = new_recbooks.slice(0,3); recommended_books = new_recbooks; } localStorage.setItem('PRETYPE_BOOKS_ANON', JSON.stringify({ previous_books: previous_books, recommended_books: recommended_books })); build_popup(); } } var whiletyping_search_object = null; var whiletyping_search = { books: [], curriculum: [], topics: [] } var single_whiletyping_ajax_promise = null; var whiletyping_database_initial_burst = 0; //number of consecutive calls, after 3 we start the 1 per 5 min calls function get_whiletyping_database() { //gets the database from the server. // 1. by validating against a local database value we confirm that the framework is working and // reduce the ammount of continuous calls produced by errors to 1 per 5 minutes. return localforage.getItem('whiletyping_last_attempt').then(function(value) { if ( value==null || (new Date()) - (new Date(value)) > 1000*60*5 || (whiletyping_database_initial_burst < 3) ) { localforage.setItem('whiletyping_last_attempt', (new Date()).getTime()); // 2. Make an ajax call to the server and get the search database. let databaseUrl = `/search/whiletype_database/`; let resp = single_whiletyping_ajax_promise; if (resp === null) { whiletyping_database_initial_burst = whiletyping_database_initial_burst + 1; single_whiletyping_ajax_promise = resp = new Promise((resolve, reject) => { $.ajax({ url: databaseUrl, type: 'POST', data:{csrfmiddlewaretoken: "bnof01B6jrhFGowiEXHtXTT59vdB4ZbtAUwDEdrdwU2Ai9OHbag2fBx5fCiQaBrw"}, success: function (data) { // 3. verify that the elements of the database exist and are arrays if ( ('books' in data) && ('curriculum' in data) && ('topics' in data) && Array.isArray(data.books) && Array.isArray(data.curriculum) && Array.isArray(data.topics)) { localforage.setItem('whiletyping_last_success', (new Date()).getTime()); localforage.setItem('whiletyping_database', data); resolve(data); } }, error: function (error) { console.log(error); resolve(null); }, complete: function (data) { single_whiletyping_ajax_promise = null; } }) }); } return resp; } return Promise.resolve(null); }).catch(function(err) { console.log(err); return Promise.resolve(null); }); } function get_whiletyping_search_object() { // gets the fuse objects that will be in charge of the search if (whiletyping_search_object){ return Promise.resolve(whiletyping_search_object); } database_promise = localforage.getItem('whiletyping_database').then(function(database) { return localforage.getItem('whiletyping_last_success').then(function(last_success) { if (database==null || (new Date()) - (new Date(last_success)) > 1000*60*60*24*30 || (new Date('2023-04-25T00:00:00')) - (new Date(last_success)) > 0) { // New database update return get_whiletyping_database().then(function(new_database) { if (new_database) { database = new_database; } return database; }); } else { return Promise.resolve(database); } }); }); return database_promise.then(function(database) { if (database) { const options = { isCaseSensitive: false, includeScore: true, shouldSort: true, // includeMatches: false, // findAllMatches: false, // minMatchCharLength: 1, // location: 0, threshold: 0.2, // distance: 100, // useExtendedSearch: false, ignoreLocation: true, // ignoreFieldNorm: false, // fieldNormWeight: 1, keys: [ "title" ] }; let curriculum_index={}; let topics_index={}; database.curriculum.forEach(c => curriculum_index[c.id]=c); database.topics.forEach(t => topics_index[t.id]=t); for (j=0; j
Solutions
Textbooks
`); } function build_solutions() { if (Array.isArray(solution_search_result)) { const viewAllHTML = userSubscribed ? `View All` : ''; var solutions_section = $(` Solutions ${viewAllHTML} `); let questionUrl = "/questions/xxx/"; let askUrl = "/ask/question/xxx/"; solution_search_result.forEach((elem) => { let url = ('course' in elem)?askUrl:questionUrl; let solution_type = ('course' in elem)?'ask':'question'; let subtitle = ('course' in elem)?(elem.course??""):(elem.book ?? "")+" "+(elem.chapter?"Chapter "+elem.chapter:""); solutions_section.find('#whiletyping-solutions').append(` ${elem.text} ${subtitle} `); }); $('#search-solution-options').empty(); if (Array.isArray(solution_search_result) && solution_search_result.length>0){ $('#search-solution-options').append(solutions_section); } MathJax.typesetPromise([document.getElementById('search-solution-options')]); } } function build_textbooks() { $('#search-pretype-options').empty(); $('#search-pretype-options').append($('#search-solution-options').html()); if (Array.isArray(textbook_search_result)) { var books_section = $(` Textbooks View All `); let searchUrl = "/books/xxx/"; textbook_search_result.forEach((elem) => { books_section.find('#whiletyping-books').append(` ${elem.title} ${ordinal(elem.edition)} ${elem.author} `); }); } if (Array.isArray(textbook_search_result) && textbook_search_result.length>0){ $('#search-pretype-options').append(books_section); } } function build_popup(first_time = false) { if ($('#search-text').val()=='') { build_pretype(); } else { solution_and_textbook_search(); } } var search_text_out = true; var search_popup_out = true; const is_login = false; const user_hash = null; function pretype_setup() { $('#search-text').focusin(function() { $('#search-popup').addClass('show'); resize_popup(); search_text_out = false; }); $( window ).resize(function() { resize_popup(); }); $('#search-text').focusout(() => { search_text_out = true; if (search_text_out && search_popup_out) { $('#search-popup').removeClass('show'); } }); $('#search-popup').mouseenter(() => { search_popup_out = false; }); $('#search-popup').mouseleave(() => { search_popup_out = true; if (search_text_out && search_popup_out) { $('#search-popup').removeClass('show'); } }); $('#search-text').on("keyup", delay(() => { build_popup(); }, 200)); build_popup(true); let prevbookUrl = `/search/pretype_books/`; let prebooks = null; try { prebooks = JSON.parse(localStorage.getItem('PRETYPE_BOOKS_'+(is_login?user_hash:'ANON'))); }catch(e) {} if (prebooks && 'previous_books' in prebooks && 'recommended_books' in prebooks) { if (is_login) { previous_books = prebooks.previous_books; recommended_books = prebooks.recommended_books; if (prebooks.time && new Date().getTime()-prebooks.time<1000*60*60*6) { build_popup(); return; } } else { anon_pretype(); return; } } $.ajax({ url: prevbookUrl, method: 'POST', data:{csrfmiddlewaretoken: "bnof01B6jrhFGowiEXHtXTT59vdB4ZbtAUwDEdrdwU2Ai9OHbag2fBx5fCiQaBrw"}, success: function(response){ previous_books = response.previous_books; recommended_books = response.recommended_books; if (is_login) { localStorage.setItem('PRETYPE_BOOKS_'+user_hash, JSON.stringify({ previous_books: previous_books, recommended_books: recommended_books, time: new Date().getTime() })); } build_popup(); }, error: function(response){ console.log(response); } }); } $( document ).ready(pretype_setup); $( document ).ready(function(){ $('#search-popup').on('click', '.search-view-item', function(e) { e.preventDefault(); let autoCompleteSearchViewUrl = `/search/autocomplete_search_view/`; let objectUrl = $(this).attr('href'); let selectedId = $(this).data('objid'); let searchResults = []; $("#whiletyping-solutions").find("a").each(function() { let is_selected = selectedId === $(this).data('objid'); searchResults.push({ objectId: $(this).data('objid'), contentType: $(this).data('contenttype'), category: $(this).data('category'), selected: is_selected }); }); $("#whiletyping-books").find("a").each(function() { let is_selected = selectedId === $(this).data('objid'); searchResults.push({ objectId: $(this).data('objid'), contentType: $(this).data('contenttype'), category: $(this).data('category'), selected: is_selected }); }); $.ajax({ url: autoCompleteSearchViewUrl, method: 'POST', data:{ csrfmiddlewaretoken: "bnof01B6jrhFGowiEXHtXTT59vdB4ZbtAUwDEdrdwU2Ai9OHbag2fBx5fCiQaBrw", query: $('#search-text').val(), searchObjects: JSON.stringify(searchResults) }, dataType: 'json', complete: function(data){ window.location.href = objectUrl; } }); }); });
FAQs
VSWR (Voltage Standing Wave Ratio) is a measure of how efficiently radio-frequency power is transmitted from a power source, through a transmission line, into a load (for example, from a power amplifier through a transmission line, to an antenna). In an ideal system, 100% of the energy is transmitted.
How do you calculate the attenuation in dB for a transmission line? ›
transmission line attenuation
For example, for the EM theory, the attenuation should be the real part of the complex propagation constant real(γ)=α. And it can be converted to dB by 20*log10(exp(α*z)), where z is the length of transmission line.
What is a standing wave pattern in a transmission line? ›
What Are Standing Wave Patterns? Standing wave patterns are a series of crests and troughs that appear at definite locations along a transmission line. When the incident wave reaches the end of the transmission line, it is reflected back. This causes the reflected wave to interfere with the incident wave.
What is the effect of transmission line loss on SWR measured at the input to the line? ›
**Mismatch Loss:** Transmission line loss can be due to mismatch between the characteristic impedance of the line and the load impedance. This mismatch causes some of the signal power to be reflected back towards the source, contributing to an increase in SWR.
What is the VSWR on a transmission line always? ›
The VSWR is always a real and positive number for antennas. The smaller the VSWR is, the better the antenna is matched to the transmission line and the more power is delivered to the antenna. The minimum VSWR is 1.0.
What is an ideal VSWR? ›
A VSWR of less than 1.5:1 is ideal, a VSWR of 2:1 is considered to be marginally acceptable in low power applications where power loss is more critical, although a VSWR as high as 6:1 may still be usable with the right equipment.
How much is 3 dB attenuation? ›
An attenuation of 3dB corresponds to cutting power in half, while a gain of 3 db corresponds to a doubling of the power level. A gain of -3 dB is the same as an attenuation of +3 dB, corresponding to half the original power level.
What is attenuation in a transmission line? ›
Attenuation is a general term that refers to any reduction in the strength of a signal. Attenuation occurs with any type of signal, whether digital or analog. Sometimes called loss, attenuation is a natural consequence of signal transmission over long distances.
How do you calculate dB attenuation? ›
dB = 20 × log10 (Vout / Vin)
In this example, the attenuation is approximately − 6.02 dB -6.02 \text{ dB} −6.02 dB. This means the output voltage (10 V) is half the strength of the input voltage (20 V), indicating a reduction in signal strength.
What is the transmission line in wave theory? ›
Transmission line theory explains the results in terms of a forward and a reflected wave, the two components summing at each end to satisfy the boundary conditions: zero current for an open circuit, zero voltage for a short.
A resonant transmission line is a line where a standing wave exists, even without a source, and which is ideally terminated on reactive, mismatched loads.
What does an SWR reading of less than 1.5 1 mean? ›
SWR Range Explanations. SWR 1.0-1.5: The ideal range! If your SWR is under 1.5, you're in great shape. If you're at 1.5 and really, really want to drop down to closer to 1, it's likely possible to do with addition tuning, different equipment or a different mounting location.
What is the formula for standing wave ratio of transmission line? ›
VSWR = (ZL + ZO + ZL - ZO)/(ZL + ZO - ZL + ZO) = ZL/ZO. Therefore: VSWR = (ZL + ZO + ZO - ZL)/(ZL + ZO - ZO + ZL) = ZO/ZL. We noted above that VSWR is a specification given in ratio form relative to 1, as an example 1.5:1.
What is the formula for VSWR? ›
Specifically, return loss is related to the reflection coefficient (Γ) as follows: Return Loss (dB) = -20 log10|Γ|. On the other hand, VSWR and the reflection coefficient are connected by the equation: VSWR = (1+|Γ|)/(1-|Γ|).
What is the reason for VSWR? ›
The measurement VSWR is a value that will report how well the antenna is impedance matched to the radio or transmission line it is connected to. For this reason, VSWR should be measured and monitored at all times to allow you to detect (even act upon) an issue before it affects your network.
What is the VSWR effect? ›
A high VSWR indicates reduced efficiency in the transmission line and increased reflected energy, which can damage transmitters and reduce their effectiveness. With perfect impedance matching, energy transfers seamlessly from the power stages to the load.
What does VSWR 1.5 1 mean? ›
A higher VSWR indicates more reflected power i.e., reduced efficiency in power delivered. In real-world RF components, a VSWR of lower than 1.5:1 is considered to be good, however, VSWR values can go up to 3:1 or higher depending on parameters such as operational frequency, bandwidth, power handling, etc.