haasomeapi.apis.AdvancedOrderApi module¶
Functions¶
-
class
haasomeapi.apis.AdvancedOrderApi.
AdvancedOrderApi
(connectionstring: str, privatekey: str)¶ Bases:
haasomeapi.apis.ApiBase.ApiBase
The Advanced Order API Class. Gives access to the advanced order endpoints
Parameters: - connectionstring – str: Connection String Formatted Ex. http://<IP_ADDRESS>:9000
- privatekey – str: Private Key Set In The Haas Settings
-
activate_advanced_order
(guid: str)¶ Activates an advanced order
Parameters: guid – str: advanced order guid Returns: HaasomeClientResponse
Returns: In .result AdvancedOrderBase
-
add_stop_order
(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Create a stop order for a spot market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
add_stop_order_leverage
(accountguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Create a stop order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
add_take_profit_order
(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Createa take profit order for a spot market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
add_take_profit_order_leverage
(name: str, accountguid: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Create a take profit order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
add_trailing_stop_leverage
(accountguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Create trailing stop order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- trailingstoppercentage – float: Percentage for trailing top to follow
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
add_trailing_stop_order
(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Create a trailing stop order for a spot market
Parameters: - accountguid – str: The account guid
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- trailingstoppercentage – float: Percentage for trailing top to follow
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
deactivate_advanced_order
(guid: str)¶ Deactivates an advanced order
Parameters: guid – str: advanced order guid Returns: HaasomeClientResponse
Returns: In .result AdvancedOrderBase
-
get_advanced_orders
()¶ Retrieves the current created advanced orders
Returns: HaasomeClientResponse
Returns: In .result Dict[ AdvancedOrderBase
]
-
remove_advanced_order
(guid: str)¶ Removes (deletes) advanced order
Parameters: guid – str: advanced order guid Returns: HaasomeClientResponse
Returns: In .result bool if success
-
setup_stop_order
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify a stop order for a spot market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
setup_stop_order_leverage
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify a stop order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
setup_take_profit_order
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify take profit order for a spot market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
setup_take_profit_order_leverage
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify a take profit order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- triggerprice – float: Trigger price to execute the stop
- executionprice – float: Price for the order to be placed at
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
setup_trailing_stop_leverage
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify trailing stop order for a leverage/margin market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- contractname – str: Name of the contract (Options)
- leverage – float: Leverage percentage
- direction – EnumOrderType: Order Direction (Long/Short)
- executingtemplateguid – str: Executing Template To Use
- trailingstoppercentage – float: Percentage for trailing top to follow
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder
-
setup_trailing_stop_order
(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)¶ Modify a trailing stop order for a spot market
Parameters: - accountguid – str: The account guid
- orderguid – str: The advanced order guid to modify
- name – str: Name of the advanced order
- primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
- secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
- direction – EnumOrderType: Order Direction (Buy / Sell)
- executingtemplateguid – str: Executing Template To Use
- trailingstoppercentage – float: Percentage for trailing top to follow
- amount – float: Trade Amount
- startorderonactivation – bool: Start the adavnced order only on activation
- startorderprice – float: What price to start the order
- starttemplateguid – str: The template guid to use for the order
- activate – bool: Activate the order.
Returns: Returns: In .result
StopTakeProfitOrder


Car Price Predictor
Car Model Year
(yyyy)
Fuel Type
Please Choose...
Petrol
Diesel
CNG
Electric
Hybrid
LPG
Transmission Type
Please Choose...
Automatic
Manual
Engine or Battery Capacity
(eg. cc, kWh)
Kilometers Driven
Body Color
Please Choose...
White
Black
Blue
Grey
Silver
Green
Red
Gold
Brown
Pink
Maroon
Metallic
Purple
Orange
Yellow
Assembly Type
Please Choose...
Imported
Local
Body Type
Please Choose...
Sedan
Hatchback
SUV
Mini Van
Pick Up
Crossover
MPV
Coupe
Compact sedan
Compact SUV
Double Cabin
Station Wagon
Van
Subcompact hatchback
Micro Van
High Roof
Single Cabin
Pickup
Mini Vehicles
Off-Road Vehicles
Convertible
Truck
Other
Condition
Please Choose...
Excellent
Very Good
Good
Fair
Poor
Get Price


EEE 203
Signals and Systems
Spring 2016, MW 12:00-1:15 SCOB228
Instructor: Kostas Tsakalis, GWC 358, 965-1467,
Office Hours: see schedule or by appt.
Textbook: Oppenheim and Willsky Signals and
Systems, 2nd Ed., Prentice Hall, 1997.
Course Outline:
Grading: HW (10%), 5 Tests (50% average of best 4/5), Final (40%)
Absolute
Grading Scale: A > 90 > B > 75 > C
> 60 > D > 50 > E
(Cut-off
points may only decrease depending on the final grade distribution.)

Important Dates:
HW: see below
Tests: see below (typically
last 30min of class, 2 problems) Grade distribution
Final Exam, WED May 4 9:50-11:40 (Notice time!!!)
Academic integrity policy:
https://provost.asu.edu/index.php?q=academicintegrity
-------------------------------------------------------------------------------------
HW Assignments, Test Material, Handouts
Reading material: Class Notes #1 (.pdf)
Basic definitions and examples on system properties.
Linearity, Time Invariance, Causality, Memory, Stability.
Solved Problems:
Selection from
Ch.1-8
Other
Solved Problems Ch.1-10
Old tests and homework
Last tests and homework (note: different numbering)
!!! Convolution Demos: Try out this JAVA-based program (http://www.eas.asu.edu/~midle/jdsp/)
ASSIGNMENTS SEE LINK FOR HW PROBLEM STATEMENTS AND SOLUTIONS
Study: Chapters 1.1-1.4 and relevant
solved problems, including 2.20
HW#1. Due Date 2/1
2/8. Test 1 Material: HW#1
SOLUTIONS
Transformations of the independent variable; e.g.,
given x(t), sketch x(2t-1), given y[n], sketch y[1-n].
Elementary functions; unit step, e.g., given a
piece-wise constant x(t), express it in terms of unit steps;
unit delta, e.g., compute an integral involving
delta(.)
Study: Chapters 1.5, 1.6,
2 and relevant solved problems
HW#2 Due date 2/15
2/22. Test 2 Material: HW#2
SOLUTIONS
System properties and applications (Linearity,
time-invariance). Convolution
Study: Chapters 3, 4, 6 and relevant
solved problems
HW#3. Due date 2/29
3/14. Test 3 Material: HW#3
SOLUTIONS
Fourier Series: Signal
approximation, response of LTI systems to periodic inputs
Fourier Transform: Basic Properties
Fourier Transform Applications: Filtering
Notice: New dates
Study: Chapter 7 and relevant solved
problems
HW#4. Due date 3/21 3/28
3/28 4/4 Test 4 Material: HW#4 SOLUTIONS
Sampling and reconstruction
Study: Chapter 9 and relevant solved problems
HW#5. Due
date 4/4 4/11
4/11 4/18
Test 5 Material: HW#5 SOLUTIONS
Laplace transforms: Basic properties, System
transfer functions
Study: Chapters 5, 10 and relevant solved
problems
HW#6. Due date 4/18 4/25
4/25 Test 6 Material: HW#6 Practice Test with SolutionsZ-transforms: Basic properties, System
transfer functions
Other HW. Download the files: Problem description , Matlab file , Tada sound .
Study the problem described in the linked notes. Use the Matlab
program to experiment with
different parameter values (frequency, filters, etc)
-----------------------------------------------------------
EEE 203 FINAL EXAM Material:
System properties (L,TI,C,M,S),
e.g., given a system determine if it is TI.
Output of a system to
"composite" inputs from its output to elementary inputs.
Linear systems: General description; system
properties in terms of the impulse response; convolution;
e.g., given a linear system determine if it is
causal. Also given h and x find the convolution h*x.
Fourier Series expansions; expansion of periodic
signals (impulse-trains, pulse-trains);
properties of FS (simplify the computation of FS
using linearity, time shifts etc.);
filtering (computation of FS for the output);
Parseval's relation (finite FS approximation properties, compute
filter/other parameters
to retain/reject a certain percentage of the input
signal energy etc).
Fourier Transforms, Basic Properties. (Compute the
Fourier Transform of "composite" signals
using shifting/convolution/... properties. Compute
frequency-domain properties without
explicitly computing the transform itself).
Fourier Transforms, Applications:
Filtering (Use of the convolution property, ideal
filters, basic notions of non-ideal filters.
Steady-state response to sinusoids. Transfer functions of systems described by ODEs
with constant coefficients.).
Sampling and Reconstruction
(Frequency domain analysis of sampling systems).
Discrete time signals and
systems. Fundamental properties,
difference equations, transfer functions.
Steady-state response to
asymptotically (steady-state) periodic inputs.


Katherine Scott - Architectural Portfolio
student at the Bartlett, UCL \ MArch Architecture \ drawing fanatic
sample of current postgrad work
undergraduate work
prosthesis \ boating cartographies \ monochrome \ models \ drawings
find out what I am up to on my instagram


Forms
Entries
Map
Settings
Last recorded location:
Device ID:
Disposition Not Home Not Interested Already Has In Contract Angry Customer NS-Credit Fail Sale Not dispositioned


(Note: all chosen and user items will be lost)
Are you sure you want to clear user-entered items?
Debug Values
Stage:
Interval:
Multiply:
Times Run:
show graph
Test Notifications
😄
ℹ
⚠
Ⓧ
Special Effects
box/text resize
sound: countdown
sound: victory
Timer Controls
start
stop
App Controls
reset data
User Items
ADD
CLEAR
Available Items
Chosen Items
Raffler
Winner Present?
YES
NO
RAFFLE!
Results (
0
)
💾


{% extends "base.html" %} {% block content %}
| Date | Submited at | Submited by | Priority | Deadline | Status |
|---|---|---|---|---|---|
| {{ incident.submited_at }} | {{ incident.subject }} | {{ incident.submited_by }} | {{ incident.get_priority_display }} | {{ incident.deadline }} | {{ incident.get_status_display }} |


Contents
- How does residueEst work?
- Use a polynomial to fit a subsequence of points. Polyfit would do.
- The trick is learn from Goldilocks.
- Residue of exp(z)/z, around z0 == 0
- A second order pole, exp(3*z)./z.^2
- A second order pole, 1./z.^2, at z0 = 0
- Another 2nd order pole with a zero residue, 1./sin(z).^2, z0 = pi
How does residueEst work?
%{ How might one best compute the residue of a complex function at a known pole of low order using numerical techniques? Since the function is not finite at the pole, we cannot evaluate it directly there. The approach taken by residueEst is to sample the function at a geometric sequence of points approaching the pole. This is not unlike the approach I took with my derivest tools. For example, suppose we wish to compute the residue of the first order pole of 1./sin(z), at z = pi. (The residue is -1.) For a first order pole, the residue is given by the limit: lim (f(z)*(z-z0)) z --> z0 ResidueEst solves this problem by choosing some offset, dz, from z0. Pick some small offset, say 1e-16. Now, evaluate the function at a sequence of points z0 + dz, z0 + k*dz, z0 + k^2*dz, ..., z0 + k^n*dz. The default in derivest is to use the geometric factor of k = 4. %} format long g z0 = pi; dz = 1e-16; k = 4; delta = dz*k.^(0:30) % Now, evaluate the function at each of these points, z0 + delta, and % multiply by (z0 + delta - z0) == delta. fun = @(z) 1./sin(z); fun_of_z = fun(z0+delta).*delta
delta = Columns 1 through 3 1e-16 4e-16 1.6e-15 Columns 4 through 6 6.4e-15 2.56e-14 1.024e-13 Columns 7 through 9 4.096e-13 1.6384e-12 6.5536e-12 Columns 10 through 12 2.62144e-11 1.048576e-10 4.194304e-10 Columns 13 through 15 1.6777216e-09 6.7108864e-09 2.68435456e-08 Columns 16 through 18 1.073741824e-07 4.294967296e-07 1.7179869184e-06 Columns 19 through 21 6.8719476736e-06 2.74877906944e-05 0.0001099511627776 Columns 22 through 24 0.0004398046511104 0.0017592186044416 0.0070368744177664 Columns 25 through 27 0.0281474976710656 0.112589990684262 0.45035996273705 Columns 28 through 30 1.8014398509482 7.20575940379279 28.8230376151712 Column 31<PHONE_NUMBER>60685 fun_of_z = Columns 1 through 3 0.816561967659769 -1.24368623276475 -0.96741494953197 Columns 4 through 6 -1.05007818637943 -0.998645996304325 -0.999393504822813 Columns 7 through 9 -1.0006650249676 -1.00016932159893 -1.0000454724843 Columns 10 through 12 -0.999997574134254 -1.0000025407217 -1.00000060598878 Columns 13 through 15 -1.00000012230672 -1.00000000138628 -1.00000000424339 Columns 16 through 18 -1.00000000082177 -0.999999999966395 -1.0000000000115 Columns 19 through 21 -1.00000000003004 -1.00000000013473 -1.0000000020163 Columns 22 through 24 -1.00000003223861 -1.00000051580866 -1.00000825298128 Columns 25 through 27 -1.00013205914403 -1.00211587978403 -1.03462138368425 Columns 28 through 30 -1.85044046871399 -9.03930662202117 55.26083092194 Column 31 -142.066423215372
Use a polynomial to fit a subsequence of points. Polyfit would do.
Note that if we look at the points that are very close to z0, then the polynomial may have strange coefficients.
% For a first order pole, we are really only interested in the value % of the constant terms for this polynomial model. Essentially, this % is the extrapolated prediction of the limiting value of our product % extrapolated down to delta == 0. P0 = polyfit(delta(1:4),fun_of_z(1:4),2) % A nice feature of this sequence of points, is we can re-use the % function values, building a sliding sequence of models. P0 = polyfit(delta(2:5),fun_of_z(2:5),2) P0 = polyfit(delta(3:6),fun_of_z(3:6),2) P0 = polyfit(delta(4:7),fun_of_z(4:7),2) P0 = polyfit(delta(5:8),fun_of_z(5:8),2) % See how, as we move along this sequence using a sliding window of 4 % points, the constant terms is approaching -1. P0 = polyfit(delta(5:8),fun_of_z(5:8),2) P0 = polyfit(delta(12:15),fun_of_z(12:15),2) % At some point, we move just too far away from the pole, and our % extrapolated estimate at the pole becomes poor again. P0 = polyfit(delta(26:29),fun_of_z(26:29),2) P0 = polyfit(delta(27:30),fun_of_z(27:30),2)
Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = 1.40722697171131e+29 -1.08866090694287e+15 0.165206417147826 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = -7.74680625721916e+26<PHONE_NUMBER>6783.7 -1.14677041257162 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = 4.67339267331006e+24 -451780266912.317 -1.00159018384202 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = -1.05363184798865e+24<PHONE_NUMBER>59.053 -1.03508462443342 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = 3.39997173195685e+21 -6525897035.24524 -0.9986021313655 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = 3.39997173195685e+21 -6525897035.24524 -0.9986021313655 Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. P0 = -3107361376.59391<PHONE_NUMBER>59505 -1.00000049047424 P0 = -0.114884717006806 -0.297892275588167 -0.928218832274888 P0 = 0.149132944160628 -2.4122832973759 0.881916750679264
The trick is learn from Goldilocks.
Choose a prediction of the pole for some model that is not too close to the pole, nor to far away. The choice is made by a simple set of rules. First, discard any predictions of the limit that are either NaN or inf. Then trim off a few more predictions, leaving only those predictions in the middle. Next, each prediction is made from a polynomial model with ONE more data point than coefficients to estimate. This yields an estimate of the uncertainty in the constant term using standard statistical methodologies. While a 95% confidence limit has no true statistical meaning, since the data is not truly random, we can still use the information.
ResidueEst choose the model that had the narrowest confidence bounds around the constant term.
[res,errest] = residueEst(@(z) 1./sin(z),pi) % See that if the true residue is really is -1, then we should have % (approximately) % % abs(res - (-1)) < errest [abs(res - (-1)),errest]
res = -1.00000000000222 errest = 1.23720470391972e-11 ans = 2.22333262911434e-12 1.23720470391972e-11
Residue of exp(z)/z, around z0 == 0
Here the residue should be exp(0) == 1
[res,errest] = residueEst(@(z) exp(z)./z,0)
res = 1 errest = 0
A second order pole, exp(3*z)./z.^2
The residue should be 3.
[res,errest] = residueEst(@(z) exp(3*z)./z.^2,0,'poleorder',2) % The error estimate is a reaonable one here too. [abs(res - 3),errest]
res = 3.00000000019214 errest = 2.26398426905353e-10 ans = 1.92144078425827e-10 2.26398426905353e-10
A second order pole, 1./z.^2, at z0 = 0
The residue should be 0
[res,errest] = residueEst(@(z) 1./z.^2,0,'poleorder',2)
res = 1.77121275308468e-15 errest = 1.83193682355051e-14
Another 2nd order pole with a zero residue, 1./sin(z).^2, z0 = pi
The residue here is zero
[res,errest] = residueEst(@(z) 1./(sin(z).^2),pi,'poleorder',2)
res = -6.43430530792682e-09 errest = 3.61963048877858e-08


Tonight I think I found the answer to part of the question that last night's trip ('Horrifying') so forcefully put to me.
B, C and T came by and we decided to smoke some 5-MeO-DMT. C had already tried it and T was unsure, so B went first. She got the first, biggest hit, and after taking it smiled and closed her eyes for the journey. C went next, and reacted the same. I readied another hit and asked T if she wanted to try it, and she changer her mind again and said yes. I took one myself right after her. I was just about to take off when T began to panic. She said she was scared and couldn't breathe, and thought she was dying. I remembered last night's hellride, and empathized. I put my hand on her knee and said 'You're OK, try to breathe evenly.' She grabbed my hand and wouldn't let go. I got behind her on the bed to hold her up and kept trying to reassure her. She kept saying how afraid she was, and looked and sounded like a frightened child.
All the while I was peaking myself. She became the focal point of my universe, my whole existence was to try to comfort her. My body, such as I was aware of it, fused with hers, and my mind existed only to anchor this frightened being I'd merged with. It was as if I'd dissolved myself into a spiritual shield around her. As I began to reintegrate, I knew I'd found purpose. Friendship, love, sharing. As our peaks wore off, we all just laid on my bed talking about the experience. It was a beautiful thing. The sound of the wind and someone's windchimes through my window was tangible. After a while, T and I walked up to the supermarket. The night was cool and crisp, the stars bright, the air clean. Life is good.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Example:
int n = 3 + (9 * 8);
After quick-fix is applied, the result will be:
int n = 3 + 9 * 8;
Use the first checkbox below to ignore parentheses which help to clarify a binary
expression. Parentheses are clarifying if the expression parenthesized is an
instanceof
expression part of a larger
expression or has a different operator than the parent expression.
Use the second checkbox below to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses.
Use the third checkbox below to ignore parentheses around a single lambda parameter within a lambda expression.


Steem Online(BETA)
Market
News
Insights
Apps
Discover
Explore
Steem.Online
Home
Market
News
Insights
Apps
Discover
Explore
Login
Write
Account
Feed
Wallet
Log out


The harmonic oscillator is omnipresent in physics. Although you may think of this as being related to springs, it, or an equivalent mathematical representation, appears in just about any problem where a mode is sitting near its potential energy minimum. At that point, \( \partial_x V(x)=0 \), and the first non-zero term (aside from a constant) in the potential energy is that of a harmonic oscillator. In a solid, sound modes (phonons) are built on a picture of coupled harmonic oscillators, and in relativistic field theory the fundamental interactions are also built on coupled oscillators positioned infinitesimally close to one another in space. The phenomena of a resonance of an oscillator driven at a fixed frequency plays out repeatedly in atomic, nuclear and high-energy physics, when quantum mechanically the evolution of a state oscillates according to \( e^{-iEt} \) and exciting discrete quantum states has very similar mathematics as exciting discrete states of an oscillator.
The potential energy for a single particle as a function of its position \( x \) can be written as a Taylor expansion about some point \( b \) (we are considering a one-dimensional problem here)
$$ \begin{equation} V(x)=V(b)+(x-b)\frac{dV(x)}{dx}\vert_{b}+\frac{1}{2!}(x-b)^2\frac{d^2V(x)}{dx^2}\vert_{b} +\frac{1}{3!}(x-b)^3V(x)^{(3)}\vert_{b}+\cdots \label{_auto1} \end{equation} $$If the position \( b \) is at the minimum of the resonance, the first two non-zero terms of the potential are
$$ \begin{align} V(x)\approx& V(b)+\frac{1}{2!}(x-b)^2\frac{d^2V(x)}{dx^2}\vert_{b}, \label{_auto2}\\ \nonumber =&V(b)+\frac{1}{2}k(x-b)^2,~~~~k\equiv \frac{d^2V(x)}{dx^2}\vert_{b},\\ \nonumber F=&-\frac{dV(x)}{dx}=-k(x-b). \end{align} $$Our equation of motion is, with the only force given by the one-dimensional spring force,
$$ m\frac{d^2x}{dt^2}=-kx. $$Defining the natural frequency \( \omega_0^2=k/m \) we can rewrite this equation as
$$ \frac{d^2x}{dt^2}=-\omega_0^2x. $$We call this a natural frequency since it is defined by the constants that describe our system, the spring constant \( k \) and the mass \( m \) of the object.
We can as usual split this equation of motion into one equation for the derivative of the velocity and
$$ \frac{dv}{dt}=-\omega_0^2x, $$and
$$ \frac{dx}{dt}=v. $$The solution to the equations of motion is given by
$$ x(t) = A\cos{(\omega_0 t)}+B\sin{(\omega_0 t)}, $$where \( A \) and \( B \) are in general complex constants to be determined by the initial conditions.
Inserting the solution into the equation of motion we have
$$ \frac{d^2x}{dt^2}=-\omega_0^2x, $$we have
$$ \frac{d^2x}{dt^2} = -A\omega_0^2\cos{(\omega_0 t)}-B\omega_0^2\sin{(\omega_0 t)}, $$and the right-hand side is just \( -\omega_0^2 x(t) \). Thus, inserting the solution into the differential equation shows that we obtain the same original differential equation.
Let us assume that our initial time $t_0=0$s and that the initial position \( x(t_0)=x_0 \) and that \( v_0=0 \) (we skip units here). This gives us
$$ x(t=0) = x_0 =A, $$and it leaves \( B \) undetermined. Taking the derivative of \( x \) we obtain the velocity
$$ v(t) = -A\omega_0\sin{(\omega_0 t)}+B\omega_0\cos{(\omega_0 t)}, $$and with
$$ v(t=0) = 0=B, $$we see that our solution with these initial conditions becomes
$$ x(t) = x_0\cos{(\omega_0 t)}. $$From our first homework (exercise 1) we have that (we switch to \( \omega \) instead of \( \omega_0 \))
$$ \cos{(\omega t)} = \sum_{n=0}^{\infty}\left(-1\right)^n \frac{(\omega t)^{2n}}{(2n)!}, $$and
$$ \sin{(\omega t)} = \sum_{n=0}^{\infty}\left(-1\right)^n \frac{(\omega t)^{2n+1}}{(2n+1)!}, $$and that we could write
$$ \exp{(\pm\imath\omega t)} = \cos{(\omega t)}+\pm\imath\sin{(\omega t)}. $$This means (show this) that we can write our solution in terms of new constant \( C \) and \( D \) as
$$ x(t)=C\exp{(\imath\omega t)}+D\exp{(-\imath\omega t)}. $$To see the relation between these two forms we note that we can write our original solution \( x(t) = A\cos{(\omega t)}+B\sin{(\omega t)} \) as
$$ x(t) = (C+D)\cos{(\omega t)}+\imath(C-D)\sin{(\omega t)}, $$meaning that we have \( A=C+D \) and \( B=\imath(C-D) \).
We can also rewrite the solution in a simpler way. We define a new constant \( A=\sqrt{B_1^2+B_2^2} \) which can be thought as the hypotenuse of a right-angle triangle with sides \( B_1 \) and \( B_2 \) and \( B_1=A\cos{(\delta)} \) and \( B_2=A\sin{(\delta)} \).
We have then
$$ x(t) = A\left[\frac{B_1}{A}\cos{(\omega t)}+\frac{B_2}{A}\sin{(\omega t)}\right], $$which becomes
$$ x(t) = A\left[\cos{(\delta)}\cos{(\omega t)}+\sin{(\delta)}\sin{(\omega t)}\right], $$and using the trigonometric relations for addition of angles we have
$$ x(t) = A\cos{(\omega t-\delta)}, $$where \( \delta \) is a so-called phase shift.
Our energy is given by the kinetic energy and the harmonic oscillator potential energy, that is we have (for a one-dimensional harmonic oscillator potential)
$$ E=\frac{1}{2}mv^2+\frac{1}{2}kx^2. $$We assume that we have initial conditions \( v_0=0 \) (no kinetic energy) and \( x(t=0)=x_0 \). With these initial conditions we have
$$ x(t) = x_0\cos{(\omega_0 t)}, $$and the velocity is given by
$$ v(t) = -x_0\omega_0\sin{(\omega_0 t)}, $$The energy is conserved (as we have discussed before) and at \( t=t_0=0 \) we have thus
$$ E_0=\frac{1}{2}kx_0^2. $$At a time \( t\ne 0 \) we have
$$ E(t)=\frac{1}{2}mv^2+\frac{1}{2}kx^2=\frac{1}{2}mx_0^2\omega_0^2\sin^2{(\omega_0 t)}+\frac{1}{2}kx_0^2\cos^2{(\omega_0 t)}, $$Recalling that \( \omega_0^2=k/m \) we get
$$ E(t)=\frac{1}{2}kx_0^2\sin^2{(\omega_0 t)}+\frac{1}{2}kx_0^2\cos^2{(\omega_0 t)}=\frac{1}{2}kx_0^2=E_0. $$Energy is thus conserved
Note: Figure to be inserted.
We consider a pendulum of length \( l \) attached to the roof.
The pendulum consists of a rod and a small object attached to the rod. The mass of this object is \( m \) and it is the motion of this object we are concerned with. The distance from the object to the roof is \( \boldsymbol{r} \) and we have \( \vert \boldsymbol{r}\vert =l \).
The angle between the \( y \)-axis and the rod is \( \phi \). The forces at play are the gravitational force and a tension force from the rod to the object. The net for is
$$ \boldsymbol{F}^{\mathrm{net}}=\boldsymbol{T}+\boldsymbol{G}=T\sin{(\phi)}\boldsymbol{e}_1+T\cos{(\phi)}\boldsymbol{e}_2-mg\boldsymbol{e}_2, $$and with
$$ \boldsymbol{r}=l\sin{(\phi)}\boldsymbol{e}_1+l\cos{(\phi)}\boldsymbol{e}_2, $$the equation of motion becomes
$$ m\frac{d^2\boldsymbol{r}}{dt^2}=\boldsymbol{T}+\boldsymbol{G}=T\sin{(\phi)}\boldsymbol{e}_1+T\cos{(\phi)}\boldsymbol{e}_2-mg\boldsymbol{e}_2. $$Using the chain rule we can find the first derivative of \( \boldsymbol{r} \)
$$ \frac{d\boldsymbol{r}}{dt}=l\frac{d\phi}{dt}\cos{(\phi)}\boldsymbol{e}_1-l\frac{d\phi}{dt}\sin{(\phi)}\boldsymbol{e}_2, $$and thereafter the second derivative in the \( x \)-direction as
$$ \frac{d^2\boldsymbol{r}}{dt^2}\boldsymbol{e}_1=l\frac{d^2\phi}{dt^2}\cos{(\phi)}-l(\frac{d\phi}{dt})^2\sin{(\phi)}, $$and in the \( y \) direction
$$ \frac{d^2\boldsymbol{r}}{dt^2}\boldsymbol{e}_2=-l\frac{d^2\phi}{dt^2}\sin{(\phi)}-l(\frac{d\phi}{dt})^2\cos{(\phi)}. $$We can now set up the equations of motion in the \( x \) and \( y \) directions and get for the \( x \)-direction
$$ ml\frac{d^2\phi}{dt^2}\cos{(\phi)}-ml(\frac{d\phi}{dt})^2\sin{(\phi)}=T\sin{(\phi)}, $$and for the \( y \)-direction
$$ -ml\frac{d^2\phi}{dt^2}\sin{(\phi)}-ml(\frac{d\phi}{dt})^2\cos{(\phi)}=T\cos{(\phi)}-mg. $$This looks ugly!
Let us rewrite
$$ ml\frac{d^2\phi}{dt^2}\cos{(\phi)}=\left[ml(\frac{d\phi}{dt})^2+T\right]\sin{(\phi)}, $$and
$$ -ml\frac{d^2\phi}{dt^2}\sin{(\phi)}+mg=\left[ml(\frac{d\phi}{dt})^2+T\cos{(\phi)}\right]. $$Still not so nice.
How can we simplify the above equations, rewritten here
$$ ml\frac{d^2\phi}{dt^2}\cos{(\phi)}=\left[ml(\frac{d\phi}{dt})^2+T\right]\sin{(\phi)}, $$and
$$ -ml\frac{d^2\phi}{dt^2}\sin{(\phi)}+mg=\left[ml(\frac{d\phi}{dt})^2+T\right]\cos{(\phi)}. $$We multiply the first equation with \( \cos\phi \) and the second one with \( \sin\phi \) and then subtract the two equations. We get then
$$ -ml\frac{d^2\phi}{dt^2}(\cos{(\phi)})^2-ml\frac{d^2\phi}{dt^2}(\sin{(\phi)})^2+mg\sin{(\phi)}=0, $$leading to
$$ ml\frac{d^2\phi}{dt^2}=-mg\sin{(\phi)}. $$We are almost there.
We divide by \( m \) and \( l \) and we have the famous non-linear in \( \phi \) (due to the sine function) equation for the pendulumn
$$ \frac{d^2\phi}{dt^2}=-\frac{g}{l}\sin{(\phi)}. $$Introducing the natural frequency \( \omega_0^2=g/l \) we can rewrite the equation as
$$ \frac{d^2\phi}{dt^2}=-\omega_0^2\sin{(\phi)}. $$If we now assume that the angle is very small, we can approximate \( \sin{(\phi)}\approx \phi \) and we have essentially the same equation as we had for harmonic oscillations, that is
$$ \frac{d^2\phi}{dt^2}=-\omega_0^2\phi. $$The solution to this equation is again given by
$$ \phi(t) = A\cos{(\omega_0 t)}+B\sin{(\omega_0 t)}. $$For the general case, we have to resort to numerical solutions.
We consider only the case where the damping force is proportional to the velocity. This is counter to dragging friction, where the force is proportional in strength to the normal force and independent of velocity, and is also inconsistent with wind resistance, where the magnitude of the drag force is proportional the square of the velocity. Rolling resistance does seem to be mainly proportional to the velocity. However, the main motivation for considering damping forces proportional to the velocity is that the math is more friendly. This is because the differential equation is linear, i.e. each term is of order \( x \), \( \dot{x} \), \( \ddot{x}\cdots \), or even terms with no mention of \( x \), and there are no terms such as \( x^2 \) or \( x\ddot{x} \). The equations of motion for a spring with damping force \( -b\dot{x} \) are
$$ \begin{equation} m\ddot{x}+b\dot{x}+kx=0. \label{_auto3} \end{equation} $$Let us first study the numerical solution, thereafter we switch to the analytical analysis.
We study first the case without additional friction term and scale our equation in terms of a dimensionless time \( \tau \).
Let us remind ourselves about the differential equation we want to solve (the general case with damping due to friction)
$$ m\frac{d^2x}{dt^2} + b\frac{dx}{dt}+kx(t) =0. $$We divide by \( m \) and introduce \( \omega_0^2=\sqrt{k/m} \) and obtain
$$ \frac{d^2x}{dt^2} + \frac{b}{m}\frac{dx}{dt}+\omega_0^2x(t) =0. $$Thereafter we introduce a dimensionless time \( \tau = t\omega_0 \) (check that the dimensionality is correct) and rewrite our equation as
$$ \frac{d^2x}{d\tau^2} + \frac{b}{m\omega_0}\frac{dx}{d\tau}+x(\tau) =0, $$which gives us
$$ \frac{d^2x}{d\tau^2} + \frac{b}{m\omega_0}\frac{dx}{d\tau}+x(\tau) =0. $$We then define \( \gamma = b/(2m\omega_0) \) and rewrite our equations as
$$ \frac{d^2x}{d\tau^2} + 2\gamma\frac{dx}{d\tau}+x(\tau) =0. $$This is the equation we will code below. The first version employs the Euler-Cromer method.
# Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
import os
# Where to save the figures and data files
PROJECT_ROOT_DIR = "Results"
FIGURE_ID = "Results/FigureFiles"
DATA_ID = "DataFiles/"
if not os.path.exists(PROJECT_ROOT_DIR):
os.mkdir(PROJECT_ROOT_DIR)
if not os.path.exists(FIGURE_ID):
os.makedirs(FIGURE_ID)
if not os.path.exists(DATA_ID):
os.makedirs(DATA_ID)
def image_path(fig_id):
return os.path.join(FIGURE_ID, fig_id)
def data_path(dat_id):
return os.path.join(DATA_ID, dat_id)
def save_fig(fig_id):
plt.savefig(image_path(fig_id) + ".png", format='png')
from pylab import plt, mpl
plt.style.use('seaborn')
mpl.rcParams['font.family'] = 'serif'
DeltaT = 0.001
#set up arrays
tfinal = 20 # in dimensionless time
n = ceil(tfinal/DeltaT)
# set up arrays for t, v, and x
t = np.zeros(n)
v = np.zeros(n)
x = np.zeros(n)
# Initial conditions as simple one-dimensional arrays of time
x0 = 1.0
v0 = 0.0
x[0] = x0
v[0] = v0
gamma = 0.0
# Start integrating using Euler-Cromer's method
for i in range(n-1):
# Set up the acceleration
# Here you could have defined your own function for this
a = -2*gamma*v[i]-x[i]
# update velocity, time and position
v[i+1] = v[i] + DeltaT*a
x[i+1] = x[i] + DeltaT*v[i+1]
t[i+1] = t[i] + DeltaT
# Plot position as function of time
fig, ax = plt.subplots()
#ax.set_xlim(0, tfinal)
ax.set_ylabel('x[m]')
ax.set_xlabel('t[s]')
ax.plot(t, x)
fig.tight_layout()
save_fig("BlockEulerCromer")
plt.show()
When setting up the value of \( \gamma \) we see that for \( \gamma=0 \) we get the simple oscillatory motion with no damping. Choosing \( \gamma < 1 \) leads to the classical underdamped case with oscillatory motion, but where the motion comes to an end.
Choosing \( \gamma =1 \) leads to what normally is called critical damping and \( \gamma> 1 \) leads to critical overdamping. Try it out and try also to change the initial position and velocity. Setting \( \gamma=1 \) yields a situation, as discussed below in connection with the analytical solution, where the solution approaches quickly zero and does not oscillate. With zero initial velocity it will never cross zero.
Let us now focus on the analytical solution.
Just to make the solution a bit less messy, we rewrite this equation as
$$ \begin{equation} \label{eq:dampeddiffyq} \ddot{x}+2\beta\dot{x}+\omega_0^2x=0,~~~~\beta\equiv b/2m,~\omega_0\equiv\sqrt{k/m}. \end{equation} $$Both \( \beta \) and \( \omega \) have dimensions of inverse time. To find solutions (see appendix C in the text) you must make an educated guess at the form of the solution. To do this, first realize that the solution will need an arbitrary normalization \( A \) because the equation is linear. Secondly, realize that if the form is
$$ \begin{equation} x=Ae^{rt} \label{_auto4} \end{equation} $$that each derivative simply brings out an extra power of \( r \). This means that the \( Ae^{rt} \) factors out and one can simply solve for an equation for \( r \). Plugging this form into Eq. \eqref{eq:dampeddiffyq},
$$ \begin{equation} r^2+2\beta r+\omega_0^2=0. \label{_auto5} \end{equation} $$Because this is a quadratic equation there will be two solutions,
$$ \begin{equation} r=-\beta\pm\sqrt{\beta^2-\omega_0^2}. \label{_auto6} \end{equation} $$We refer to the two solutions as \( r_1 \) and \( r_2 \) corresponding to the \( + \) and \( - \) roots. As expected, there should be two arbitrary constants involved in the solution,
$$ \begin{equation} x=A_1e^{r_1t}+A_2e^{r_2t}, \label{_auto7} \end{equation} $$where the coefficients \( A_1 \) and \( A_2 \) are determined by initial conditions.
The roots listed above, \( \sqrt{\omega_0^2-\beta_0^2} \), will be imaginary if the damping is small and \( \beta < \omega_0 \). In that case, \( r \) is complex and the factor \( e{rt} \) will have some oscillatory behavior. If the roots are real, there will only be exponentially decaying solutions. There are three cases:
Here we have made use of the identity \( e^{i\omega't}=\cos\omega't+i\sin\omega't \). Because the constants are arbitrary, and because the real and imaginary parts are both solutions individually, we can simply consider the real part of the solution alone:
$$ \begin{eqnarray} \label{eq:homogsolution} x&=&B_1e^{-\beta t}\cos\omega't+B_2e^{-\beta t}\sin\omega't,\\ \nonumber \omega'&\equiv&\sqrt{\omega_0^2-\beta^2}. \end{eqnarray} $$In this case the two terms involving \( r_1 \) and \( r_2 \) are identical because \( \omega'=0 \). Because we need to arbitrary constants, there needs to be another solution. This is found by simply guessing, or by taking the limit of \( \omega'\rightarrow 0 \) from the underdamped solution. The solution is then
$$ \begin{equation} \label{eq:criticallydamped} x=Ae^{-\beta t}+Bte^{-\beta t}. \end{equation} $$The critically damped solution is interesting because the solution approaches zero quickly, but does not oscillate. For a problem with zero initial velocity, the solution never crosses zero. This is a good choice for designing shock absorbers or swinging doors.
This solution will also never pass the origin more than once, and then only if the initial velocity is strong and initially toward zero.
Given \( b \), \( m \) and \( \omega_0 \), find \( x(t) \) for a particle whose initial position is \( x=0 \) and has initial velocity \( v_0 \) (assuming an underdamped solution).
The solution is of the form,
$$ \begin{eqnarray*} x&=&e^{-\beta t}\left[A_1\cos(\omega' t)+A_2\sin\omega't\right],\\ \dot{x}&=&-\beta x+\omega'e^{-\beta t}\left[-A_1\sin\omega't+A_2\cos\omega't\right].\\ \omega'&\equiv&\sqrt{\omega_0^2-\beta^2},~~~\beta\equiv b/2m. \end{eqnarray*} $$From the initial conditions, \( A_1=0 \) because \( x(0)=0 \) and \( \omega'A_2=v_0 \). So
$$ x=\frac{v_0}{\omega'}e^{-\beta t}\sin\omega't. $$Here, we consider the force
$$ \begin{equation} F=-kx-b\dot{x}+F_0\cos\omega t, \label{_auto8} \end{equation} $$which leads to the differential equation
$$ \begin{equation} \label{eq:drivenosc} \ddot{x}+2\beta\dot{x}+\omega_0^2x=(F_0/m)\cos\omega t. \end{equation} $$Consider a single solution with no arbitrary constants, which we will call a {\it particular solution}, \( x_p(t) \). It should be emphasized that this is {\bf A} particular solution, because there exists an infinite number of such solutions because the general solution should have two arbitrary constants. Now consider solutions to the same equation without the driving term, which include two arbitrary constants. These are called either {\it homogenous solutions} or {\it complementary solutions}, and were given in the previous section, e.g. Eq. \eqref{eq:homogsolution} for the underdamped case. The homogenous solution already incorporates the two arbitrary constants, so any sum of a homogenous solution and a particular solution will represent the {\it general solution} of the equation. The general solution incorporates the two arbitrary constants \( A \) and \( B \) to accommodate the two initial conditions. One could have picked a different particular solution, i.e. the original particular solution plus any homogenous solution with the arbitrary constants \( A_p \) and \( B_p \) chosen at will. When one adds in the homogenous solution, which has adjustable constants with arbitrary constants \( A' \) and \( B' \), to the new particular solution, one can get the same general solution by simply adjusting the new constants such that \( A'+A_p=A \) and \( B'+B_p=B \). Thus, the choice of \( A_p \) and \( B_p \) are irrelevant, and when choosing the particular solution it is best to make the simplest choice possible.
To find a particular solution, one first guesses at the form,
$$ \begin{equation} \label{eq:partform} x_p(t)=D\cos(\omega t-\delta), \end{equation} $$and rewrite the differential equation as
$$ \begin{equation} D\left\{-\omega^2\cos(\omega t-\delta)-2\beta\omega\sin(\omega t-\delta)+\omega_0^2\cos(\omega t-\delta)\right\}=\frac{F_0}{m}\cos(\omega t). \label{_auto9} \end{equation} $$One can now use angle addition formulas to get
$$ \begin{eqnarray} D\left\{(-\omega^2\cos\delta+2\beta\omega\sin\delta+\omega_0^2\cos\delta)\cos(\omega t)\right.&&\\ \nonumber \left.+(-\omega^2\sin\delta-2\beta\omega\cos\delta+\omega_0^2\sin\delta)\sin(\omega t)\right\} &=&\frac{F_0}{m}\cos(\omega t). \end{eqnarray} $$Both the \( \cos \) and \( \sin \) terms need to equate if the expression is to hold at all times. Thus, this becomes two equations
$$ \begin{eqnarray} D\left\{-\omega^2\cos\delta+2\beta\omega\sin\delta+\omega_0^2\cos\delta\right\}&=&\frac{F_0}{m}\\ \nonumber -\omega^2\sin\delta-2\beta\omega\cos\delta+\omega_0^2\sin\delta&=&0. \end{eqnarray} $$After dividing by \( \cos\delta \), the lower expression leads to
$$ \begin{equation} \tan\delta=\frac{2\beta\omega}{\omega_0^2-\omega^2}. \label{_auto10} \end{equation} $$Using the identities \( \tan^2+1=\csc^2 \) and \( \sin^2+\cos^2=1 \), one can also express \( \sin\delta \) and \( \cos\delta \),
$$ \begin{eqnarray} \sin\delta&=&\frac{2\beta\omega}{\sqrt{(\omega_0^2-\omega^2)^2+4\omega^2\beta^2}},\\ \nonumber \cos\delta&=&\frac{(\omega_0^2-\omega^2)}{\sqrt{(\omega_0^2-\omega^2)^2+4\omega^2\beta^2}} \end{eqnarray} $$Inserting the expressions for \( \cos\delta \) and \( \sin\delta \) into the expression for \( D \),
$$ \begin{equation} \label{eq:Ddrive} D=\frac{F_0/m}{\sqrt{(\omega_0^2-\omega^2)^2+4\omega^2\beta^2}}. \end{equation} $$For a given initial condition, e.g. initial displacement and velocity, one must add the homogenous solution then solve for the two arbitrary constants. However, because the homogenous solutions decay with time as \( e^{-\beta t} \), the particular solution is all that remains at large times, and is therefore the steady state solution. Because the arbitrary constants are all in the homogenous solution, all memory of the initial conditions are lost at large times, \( t>>1/\beta \).
The amplitude of the motion, \( D \), is linearly proportional to the driving force (\( F_0/m \)), but also depends on the driving frequency \( \omega \). For small \( \beta \) the maximum will occur at \( \omega=\omega_0 \). This is referred to as a resonance. In the limit \( \beta\rightarrow 0 \) the amplitude at resonance approaches infinity.
Here, we derive the same expressions as in Equations \eqref{eq:partform} and \eqref{eq:Ddrive} but express the driving forces as
$$ \begin{eqnarray} F(t)&=&F_0e^{i\omega t}, \end{eqnarray} $$rather than as \( F_0\cos\omega t \). The real part of \( F \) is the same as before. For the differential equation,
$$ \begin{eqnarray} \label{eq:compdrive} \ddot{x}+2\beta\dot{x}+\omega_0^2x&=&\frac{F_0}{m}e^{i\omega t}, \end{eqnarray} $$one can treat \( x(t) \) as an imaginary function. Because the operations \( d^2/dt^2 \) and \( d/dt \) are real and thus do not mix the real and imaginary parts of \( x(t) \), Eq. \eqref{eq:compdrive} is effectively 2 equations. Because \( e^{\omega t}=\cos\omega t+i\sin\omega t \), the real part of the solution for \( x(t) \) gives the solution for a driving force \( F_0\cos\omega t \), and the imaginary part of \( x \) corresponds to the case where the driving force is \( F_0\sin\omega t \). It is rather easy to solve for the complex \( x \) in this case, and by taking the real part of the solution, one finds the answer for the \( \cos\omega t \) driving force.
We assume a simple form for the particular solution
$$ \begin{equation} x_p=De^{i\omega t}, \label{_auto11} \end{equation} $$where \( D \) is a complex constant.
From Eq. \eqref{eq:compdrive} one inserts the form for \( x_p \) above to get
$$ \begin{eqnarray} D\left\{-\omega^2+2i\beta\omega+\omega_0^2\right\}e^{i\omega t}=(F_0/m)e^{i\omega t},\\ \nonumber D=\frac{F_0/m}{(\omega_0^2-\omega^2)+2i\beta\omega}. \end{eqnarray} $$The norm and phase for \( D=|D|e^{-i\delta} \) can be read by inspection,
$$ \begin{equation} |D|=\frac{F_0/m}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}},~~~~\tan\delta=\frac{2\beta\omega}{\omega_0^2-\omega^2}. \label{_auto12} \end{equation} $$This is the same expression for \( \delta \) as before. One then finds \( x_p(t) \),
$$ \begin{eqnarray} \label{eq:fastdriven1} x_p(t)&=&\Re\frac{(F_0/m)e^{i\omega t-i\delta}}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}}\\ \nonumber &=&\frac{(F_0/m)\cos(\omega t-\delta)}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}}. \end{eqnarray} $$This is the same answer as before. If one wished to solve for the case where \( F(t)= F_0\sin\omega t \), the imaginary part of the solution would work
$$ \begin{eqnarray} \label{eq:fastdriven2} x_p(t)&=&\Im\frac{(F_0/m)e^{i\omega t-i\delta}}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}}\\ \nonumber &=&\frac{(F_0/m)\sin(\omega t-\delta)}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}}. \end{eqnarray} $$Consider the damped and driven harmonic oscillator worked out above. Given \( F_0, m,\beta \) and \( \omega_0 \), solve for the complete solution \( x(t) \) for the case where \( F=F_0\sin\omega t \) with initial conditions \( x(t=0)=0 \) and \( v(t=0)=0 \). Assume the underdamped case.
The general solution including the arbitrary constants includes both the homogenous and particular solutions,
$$ \begin{eqnarray*} x(t)&=&\frac{F_0}{m}\frac{\sin(\omega t-\delta)}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}} +A\cos\omega't e^{-\beta t}+B\sin\omega't e^{-\beta t}. \end{eqnarray*} $$The quantities \( \delta \) and \( \omega' \) are given earlier in the section, \( \omega'=\sqrt{\omega_0^2-\beta^2}, \delta=\tan^{-1}(2\beta\omega/(\omega_0^2-\omega^2) \). Here, solving the problem means finding the arbitrary constants \( A \) and \( B \). Satisfying the initial conditions for the initial position and velocity:
$$ \begin{eqnarray*} x(t=0)=0&=&-\eta\sin\delta+A,\\ v(t=0)=0&=&\omega\eta\cos\delta-\beta A+\omega'B,\\ \eta&\equiv&\frac{F_0}{m}\frac{1}{\sqrt{(\omega_0^2-\omega^2)^2+4\beta^2\omega^2}}. \end{eqnarray*} $$The problem is now reduced to 2 equations and 2 unknowns, \( A \) and \( B \). The solution is
$$ \begin{eqnarray} A&=& \eta\sin\delta ,~~~B=\frac{-\omega\eta\cos\delta+\beta\eta\sin\delta}{\omega'}. \end{eqnarray} $$From the previous two sections, the particular solution for a driving force, \( F=F_0\cos\omega t \), is
$$ \begin{eqnarray} x_p(t)&=&\frac{F_0/m}{\sqrt{(\omega_0^2-\omega^2)^2+4\omega^2\beta^2}}\cos(\omega_t-\delta),\\ \nonumber \delta&=&\tan^{-1}\left(\frac{2\beta\omega}{\omega_0^2-\omega^2}\right). \end{eqnarray} $$If one fixes the driving frequency \( \omega \) and adjusts the fundamental frequency \( \omega_0=\sqrt{k/m} \), the maximum amplitude occurs when \( \omega_0=\omega \) because that is when the term from the denominator \( (\omega_0^2-\omega^2)^2+4\omega^2\beta^2 \) is at a minimum. This is akin to dialing into a radio station. However, if one fixes \( \omega_0 \) and adjusts the driving frequency one minimize with respect to \( \omega \), e.g. set
$$ \begin{equation} \frac{d}{d\omega}\left[(\omega_0^2-\omega^2)^2+4\omega^2\beta^2\right]=0, \label{_auto13} \end{equation} $$and one finds that the maximum amplitude occurs when \( \omega=\sqrt{\omega_0^2-2\beta^2} \). If \( \beta \) is small relative to \( \omega_0 \), one can simply state that the maximum amplitude is
$$ \begin{equation} x_{\rm max}\approx\frac{F_0}{2m\beta \omega_0}. \label{_auto14} \end{equation} $$ $$ \begin{eqnarray} \frac{4\omega^2\beta^2}{(\omega_0^2-\omega^2)^2+4\omega^2\beta^2}=\frac{1}{2}. \end{eqnarray} $$For small damping this occurs when \( \omega=\omega_0\pm \beta \), so the \( FWHM\approx 2\beta \). For the purposes of tuning to a specific frequency, one wants the width to be as small as possible. The ratio of \( \omega_0 \) to \( FWHM \) is known as the {\it quality} factor, or \( Q \) factor,
$$ \begin{equation} Q\equiv \frac{\omega_0}{2\beta}. \label{_auto15} \end{equation} $$


Browse Developers
Boston Developers
| Name | City | Skills |
|---|---|---|
| John Foss | Cambridge | html5, css, php |
| Mark Judge | Fall River | html5, css |
| Jake Smith | Amesbury | html5, ror, php, asp |
| Henry Billard | Haverhill | Photoshop, html, css |
| Jen Sheehan | Medford | html5, Photoshop, css |
New Hampshire Developers
| Name | City | Skills |
|---|---|---|
| Steve Meadows | Exeter | html5, css, php |
| Frank Gill | Manchester | html5, css |
| Margo Walls | Nashua | html5, ror, php, asp |
| Kevin Teague | Concord | Photoshop, html, css |
| Jeff Goodrow | South Hampton | html5, Photoshop, css |


In this tutorial, I used the DE-MCMC sampler (Turner et al., 2013) to fit a hierarchical LBA model. This particular design has a stimulus (S) and a frequency (F) factor.
Set-up Model
I used the usual DMC-style syntax to set up the model. I hope, at this point, it might be clear for the reader who has read through the Model Array, that the meaning of syntax in p.map.
p.map = list(A = “1”, B = “R”, t0 = “1”, mean_v = c(“F”, “M”), sd_v = “M”, st0 = “1”),
library(ggdmc)
model <- BuildModel(
p.map = list(A = "1", B = "R", t0 = "1",
mean_v = c("F", "M"), sd_v = "M", st0 = "1"),
match.map = list(M = list(s1=1, s2=2)),
factors = list(S = c("s1", "s2"),F = c("f1", "f2")),
constants = c(sd_v.false = 1, st0 = 0),
responses = c("r1", "r2"),
type = "norm")
## Parameter vector names (unordered) are: ( see attr(,"p.vector") )
## [1] "A" "B.r1" "B.r2" "t0"
## [5] "mean_v.f1.true" "mean_v.f2.true" "mean_v.f1.false" "mean_v.f2.false"
## [9] "sd_v.true"
##
## Constants are (see attr(,"constants") ):
## sd_v.false st0
## 1 0
##
## Model type = norm (posdrift = TRUE )
npar <- length(GetPNames(model))
mean_v = c(“F”, “M”), refers to that the mean of the drift rate is affected by the F and M factors. The former is an experimental factor and the latter is a latent LBA specific factor. B = “R” refers to that the travel distance parameter is affected by the response factor, which in a binary decision task, is two levels. Here it is either “r1” or “r2”, defined in the response option / argument.
responses = c(“r1”, “r2”),
Therefore, the data.frame (an R way to store real or simulated data ) should have an R column, similar to the below:
> dplyr::tbl_df(dat)
# A tibble: 40,000 x 5
s S F R RT
<fct> <fct> <fct> <fct> <dbl>
1 1 s1 f1 r1 0.745
2 1 s1 f1 r1 0.883
3 1 s1 f1 r1 0.884
4 1 s1 f1 r1 0.678
5 1 s1 f1 r1 0.729
6 1 s1 f1 r1 0.803
7 1 s1 f1 r1 0.735
8 1 s1 f1 r1 0.756
9 1 s1 f1 r1 0.847
10 1 s1 f1 r1 0.855
# ... with 39,990 more rows
- s refers to subject label,
- S is stimulus factor,
- F is frequency factor,
- R is response factor,
- fct refers to factor, namely a categorical variable,
- dbl refers to double, namely a continuous, numerical variable.
In this design, the S factor does not affect any model parameters, and the F factor affects the mean of the drift rate, mean_v = c(“F”, “M”). Because this is a parameter recovery study, I simulated a data set based on the above model. Similarly, I used a random-effects model to generate the data set, so I defined a set of population distribution for each LBA parameters. The names of the parameter were reported by the BuildModel function.
Simulate Data
pop.mean <- c(A=.4, B.r1=.6, B.r2=.8, t0=.3, mean_v.f1.true=1.5,
mean_v.f2.true=1, mean_v.f1.false=0, mean_v.f2.false=0,
sd_v.true = .25)
pop.scale <-c( rep(.1, 3), .05, rep(.2, 4), .1)
names(pop.scale) <- names(pop.mean)
pop.prior <- BuildPrior(
dists = rep("tnorm", npar),
p1 = pop.mean,
p2 = pop.scale,
lower = c(rep(0, 3), .1, rep(NA, 4), 0),
upper = c(rep(NA, 3), 1, rep(NA, 5)))
dat <- simulate(model, nsim = 30, nsub = 40, prior = pop.prior)
dmi <- BuildDMI(dat, model)
ps <- attr(dat, "parameters")
Then I set up prior distributions and hyper-prior distributions.
### FIT RANDOM EFFECTS
p.prior <- BuildPrior(
dists = rep("tnorm", npar),
p1 = pop.mean,
p2 = pop.scale*5,
lower = c(0,0,0,.1,NA,NA,NA,NA,0),
upper = c(NA,NA,NA,NA,NA,NA,NA,NA,NA))
mu.prior <- BuildPrior(
dists = rep("tnorm", npar),
p1 = pop.mean,
p2 = c(1,1,1,1,2,2,2,2,1),
lower = c(0,0,0,.1,NA,NA,NA,NA,0),
upper = c(NA,NA,NA,NA,NA,NA,NA,NA,NA))
sigma.prior <- BuildPrior(
dists = rep("beta", npar),
p1 = c(A=1, B.r1=1, B.r2=1, t0=1, mean_v.f1.true=1,
mean_v.f2.true=1, mean_v.f1.false=1, mean_v.f2.false=1,
sd_v.true = 1),
p2 = rep(1, npar))
###### Must names "pprior", "location", and "scale" to the prirors list #######
priors <- list(pprior=p.prior, location=mu.prior, scale=sigma.prior)
###### Must names "pprior", "location", and "scale" to the prirors list #######
Sampling
Next, I started the sampling. When the debug argument is set TRUE, the run function uses the conventional DE-MCMC sampler, with the its original migration operator.
fit0 <- StartNewsamples(dmi, priors)
fit <- run(fit0, thin = 8)
Model Diagnosis
Next, I checked if the model has converged and analyze the model estimation. In this tutorial, I did the numerical checks firstly by calculating the potential scale reduction factors (Brook & Gelman,1998). All are less than 1.05, suggesting all chains are well mixed.
rhat <- hgelman(fit, verbose = TRUE)
## hyper 1 2 3 4 5 6 7 8 9 10 11 12 13
## 1.02 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01
## 14 15 16 17 18 19 20 21 22 23 24 25 26 27
## 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01
## 28 29 30 31 32 33 34 35 36 37 38 39 40
## 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01 1.01
Then, I calculated effective samples at the hyper parameters, for one participant at the parameter of the data level, and similarly for all participants. This is to check if enough posterior samples are drawn.
hes <- effectiveSize(hsam, hyper = TRUE)
##
## A.h1 B.r1.h1 B.r2.h1 t0.h1
## 4655 1416 1152 2061
## mean_v.f1.true.h1 mean_v.f2.true.h1 mean_v.f1.false.h1 mean_v.f2.false.h1
## 1748 2828 1504 1505
## sd_v.true.h1 A.h2 B.r1.h2 B.r2.h2
## 3997 3406 3611 2630
## t0.h2 mean_v.f1.true.h2 mean_v.f2.true.h2 mean_v.f1.false.h2
## 4906 5329 4615 4342
## mean_v.f2.false.h2 sd_v.true.h2
## 4481 3887
es1 <- effectiveSize(hsam[[1]])
## A B.r1 B.r2 t0 mean_v.f1.true
## 13531 2819 2629 6100 3755
## mean_v.f2.true mean_v.f1.false mean_v.f2.false sd_v.true
## 3793 4983 4239 6572
es <- effectiveSize(hsam)
round(apply(data.frame(es), 1, mean))
round(apply(data.frame(es), 1, sd))
round(apply(data.frame(es), 1, max))
round(apply(data.frame(es), 1, min))
## A B.r1 B.r2 t0 mean_v.f1.true
## Mean 11159 2972 2726 6577 4055
## SD 2728 295 172 903 562
## MAX 13967 3778 3196 8183 5273
## MIN 4525 2382 2331 4581 3092
## mean_v.f2.true mean_v.f1.false mean_v.f2.false sd_v.true
## 3654 4793 4683 8110
## 598<PHONE_NUMBER>
## 5056 5582 5699 13163
## 2647 3960 3865 5830
Then I did the visual check by plotting the six types of trace and density plots. Firstly, I plot the hyper parameters. By entering TRUE to the option, save, you save the data in a data.table format1, for further processing. For instance, you can change the figure to fit the publication requirement.
- Trace plots of posterior log-likelihood at hyper level
- Trace plots of the hyper parameters
- Posterior density plots the hyper parameters
plot(hsam, hyper = TRUE)
DT1 <- plot(hsam, hyper = TRUE, pll = FALSE, save = TRUE)
plot(hsam, hyper = TRUE, pll = FALSE, den = TRUE)
Next I checked the trace plots of the posterior log-likelihood and each of the LBA parameters at the data level.
- Trace plots of posterior log-likelihood at the data level
- Trace plots of the LBA parameters for each participants
plot(hsam)
plot(hsam, pll = FALSE)
Last, I checked the (posterior) density plots at the data level. There are too many density plots for each participants (nsubject x nparameter = 360), so I did not present them here.
- Posterior density plots the LBA parameters for each parameters
Because this is a parameter recovery study, in the following, I used summary function to check whether Bayesian estimates do recover the true parameters of all participant as well as the mechanism of data generation, namely, pop.mean and pop.scale.
There are five arguments in the summary function you need to know to trigger the smart parameter recovery computation. First is hyper = TRUE, which calculate the phi array / matrix, which stores hyper parameters. Second is the recovery = TRUE, which informs the function to look for a true parameter vector, which you should enter it at ps argument (ps = pop.mean). Otherwise, the function will throw an error message, complaining that it cannot find the true parameter vector.
est1 <- summary(hsam, hyper = TRUE, recovery = TRUE, ps = pop.mean, type = 1)
## Error in summary_recoverone(samples, start, end, ps, digits, verbose) :
## Names of p.vector do not match parameter names in samples
The fourth argument is type = 1. This is a hyper parameter recovery specific. This is to recover the location (mostly mean) parameters. When type = 2, the function will attempt to recover the scale parameters, which mostly refer to standard deviations. The last useful argument is verbose = TRUE, printing message.
est1 <- summary(hsam, hyper = TRUE, recovery = TRUE, ps = pop.mean, type = 1)
## No print, the estimates are stored in est1.
est2 <- summary(hsam, hyper = TRUE, recovery = TRUE, ps = pop.scale, type = 2,
verbose = TRUE)
## Storing estmates in est2 and print results rounding to the second digits
## A B.r1 B.r2 mean_v.f1.false mean_v.f1.true mean_v.f2.false
## True 0.10 0.10 0.10 0.20 0.20 0.20
## 2.5% Estimate 0.10 0.09 0.02 0.15 0.17 0.19
## 50% Estimate 0.14 0.12 0.06 0.22 0.21 0.26
## 97.5% Estimate 0.19 0.16 0.10 0.30 0.27 0.34
## Median-True 0.04 0.02 -0.04 0.02 0.01 0.06
## mean_v.f2.true sd_v.true t0
## True 0.20 0.10 0.05
## 2.5% Estimate 0.21 0.11 0.03
## 50% Estimate 0.26 0.14 0.04
## 97.5% Estimate 0.34 0.21 0.06
## Median-True 0.06 0.04 -0.01
By checking the Median-True, namely 50% quantile minus true values, I can confirm that I did recover the true hyper scale parameters. The lines, 2.5% Estimate and 97.5% Estimate inform that the 95% credible intervals, cover the true hyper parameters well. As expected the A and B parameters are sometimes at the boundaries of the 95% intervals, as they are linearly correlated.
More often, researchers concern the location estimates, which I printed out the results stored in est1.
A B.r1 B.r2 mean_v.f1.false mean_v.f1.true mean_v.f2.false
True 0.40 0.60 0.80 0.00 1.50 0.00
2.5% Estimate 0.35 0.61 0.83 0.00 1.47 0.00
50% Estimate 0.40 0.68 0.91 0.16 1.58 0.17
97.5% Estimate 0.45 0.76 0.99 0.31 1.68 0.32
Median-True 0.00 0.08 0.11 0.16 0.08 0.17
mean_v.f2.true sd_v.true t0
True 1.00 0.25 0.30
2.5% Estimate 1.04 0.17 0.26
50% Estimate 1.14 0.25 0.28
97.5% Estimate 1.25 0.30 0.30
Median-True 0.14 0.00 -0.02
The estimates look pretty good. My estimation correctly reflects the difference of the two threshold-related parameters. The true values are B.r1 = .6 and _B.r2 = .8. The estimates are B.r1 = .68 and _B.r2 = .91 (B.r2 > B.r1). Even the difference is very close (0.20 vs. 0.23).
As expected, the mean drift rates for the error accumulators (e.g., mean_v.f1.false) are very difficult to estimate, because I set my prior distributions / belief truncated at the 0 boundary, reflect how prior belief may affect the estimate.
More important is the estimates of the mean drift rate for the correct accumulators (e.g., mean_v.f1.true). Again the condition f1 (e.g., high word frequency) has faster drift than the condition f2 (e.g., low word frequency). The estimates, f1 = 1.58 > f2 = 1.14, closely match the true values f1 = 1.50 > f2 = 1.00.
There are more useful options in the summary function, which I will return to in a later tutorial.
hest <- summary(hsam, hyper = TRUE, hmeans = TRUE)
hest <- summary(hsam, hyper = TRUE, hci = TRUE, prob = c("25%", "75%"))
hest <- summary(hsam, hyper = TRUE, hci = TRUE, prob = c("25%", "75%"), digits = 3)
Posterior predictive check
You can also pipe the result to DMC to use its h.post.predict.dmc to conduct posterior predictive check at the hyper parameter. Note this will take a while, because piping back to DMC means using R language to process large Bayesian MCMC data. Further tutorials for DMC, please refer to Heathcote and colleagues (2018).
setwd("/media/yslin/MERLIN/Documents/DMCpaper/")
source ("dmc/dmc.R")
load_model ("LBA","lba_B.R")
setwd("/media/yslin/MERLIN/Documents/ggdmc_paper/")
hpp <- h.post.predict.dmc(hsam)
plot.pp.dmc(hpp)
tmp <- lapply(hpp, function(x){plot.pp.dmc(x, style = "cdf") })
Reference
Heathcote, A., Lin, Y.-S., Reynolds, A., Strickland, L., Gretton, M. & Matzke, D., (2018). Dynamic model of choice. Behavior Research Methods. https://doi.org/10.3758/s13428-018-1067-y.
-
a different way to store and manipulation data in R. ↩


Quick Change
问题描述 :
J.P. Flathead’s Grocery Store hires cheap labor to man the checkout stations. The people he hires (usually high school kids) often make mistakes making change for the customers. Flathead, who’s a bit of a tightwad, figures he loses more money from these mistakes than he makes; that is, the employees tend to give more change to the customers than they should get.
Flathead wants you to write a program that calculates the number of quarters ($0.25), dimes ($0.10), nickels ($0.05) and pennies ($0.01) that the customer should get back. Flathead always wants to give the customer’s change in coins if the amount due back is $5.00 or under. He also wants to give the customers back the smallest total number of coins. For example, if the change due back is $1.24, the customer should receive 4 quarters, 2 dimes, 0 nickels, and 4 pennies.
输入:
The first line of input contains an integer N which is the number of datasets that follow. Each dataset consists of a single line containing a single integer which is the change due in cents, C, (1 ≤ C ≤ 500).
输出:
For each dataset, print out the dataset number, a space, and the string:
Q QUARTER(S),
D DIME(S),
n NICKEL(S),
P PENNY(S)
Where Q is he number of quarters, D is the number of dimes, n is the number of nickels and P is the number of pennies.
样例输入:
3 124 25 194
样例输出:
1 4 QUARTER(S), 2 DIME(S), 0 NICKEL(S), 4 PENNY(S) 2 1 QUARTER(S), 0 DIME(S), 0 NICKEL(S), 0 PENNY(S) 3 7 QUARTER(S), 1 DIME(S), 1 NICKEL(S), 4 PENNY(S)
解题代码:
//* @author<EMAIL_ADDRESS>import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i = 0; i < n; i++) { int sum = in.nextInt(); int quarter = sum/25; sum = sum %25; int dime = sum/10; sum = sum%10; int nickel = sum/5; sum = sum%5; int penny = sum; System.out.println((i+1)+" "+quarter+" QUARTER(S), "+dime+" DIME(S), "+nickel+ " NICKEL(S), "+penny+" PENNY(S)"); } } }
最长回文子串可以使用manacher算法，将时间复杂度降到O(n)。
问题3中，GetRightPosition()和GetLeftPosition()与STL中的upper_bound()和lower_boune()的代码实现一样吗？
代码不错，赞一个！
这个问题别太纠结了，不同的编译器结果不一
哎，path[0]应该是从零开始吧，为什么是赋值1呢？
为什么暴力求解方法循环到sqrt(n) 就可以了呢
不太懂呀，乡亲们。原理知道代码不会
这个问题应该是有一般性的解决方法
输入样例作为一个整体输入，带回车
是穷举，但是代码有优化（v数组），并不是2^n。测试数据应该没问题，之前有超时的代码。
后面的是python代码啊
赞一个！权限已更新:）
纠正一个错误，二分查找树的中序遍历获得元素的升序排列。
程序只能输出一个子序列


| as_tibble {tibble} | R Documentation |
as_tibble()
turns an existing object, such as a data frame or
matrix, into a so-called tibble, a data frame with class tbl_df
. This is
in contrast with tibble()
, which builds a tibble from individual columns.
as_tibble()
is to tibble()
as base::as.data.frame()
is to
base::data.frame()
.
as_tibble()
is an S3 generic, with methods for:
data.frame
: Thin wrapper around the list
method
that implements tibble's treatment of rownames.
Default: Other inputs are first coerced with base::as.data.frame()
.
as_tibble_row()
converts a vector to a tibble with one row.
The input must be a bare vector, e.g. vectors of dates are not
supported yet.
If the input is a list, all elements must have length one.
as_tibble_col()
converts a vector to a tibble with one column.
as_tibble( x, ..., .rows = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal"), rownames = pkgconfig::get_config("tibble::rownames", NULL) ) ## S3 method for class 'data.frame' as_tibble( x, validate = NULL, ..., .rows = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal"), rownames = pkgconfig::get_config("tibble::rownames", NULL) ) ## S3 method for class 'list' as_tibble( x, validate = NULL, ..., .rows = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal") ) ## S3 method for class 'matrix' as_tibble(x, ..., validate = NULL, .name_repair = NULL) ## S3 method for class 'table' as_tibble(x, `_n` = "n", ..., n = `_n`, .name_repair = "check_unique") ## S3 method for class ''NULL'' as_tibble(x, ...) ## Default S3 method: as_tibble(x, ...) as_tibble_row( x, .name_repair = c("check_unique", "unique", "universal", "minimal") ) as_tibble_col(x, column_name = "value")
x |
A data frame, list, matrix, or other object that could reasonably be coerced to a tibble. |
... |
Unused, for extensibility. |
.rows |
The number of rows, useful to create a 0-column tibble or just as an additional check. |
.name_repair |
Treatment of problematic column names:
This argument is passed on as |
rownames |
How to treat existing row names of a data frame or matrix:
|
_n, validate |
For compatibility only, do not use for new code. |
n |
Name for count column, default: |
column_name |
Name of the column. |
The default behavior is to silently remove row names.
New code should explicitly convert row names to a new column using the
rownames
argument.
For existing code that relies on the retention of row names, call
pkgconfig::set_config("tibble::rownames" = NA)
in your script or in your
package's .onLoad()
function.
Using as_tibble()
for vectors is superseded as of version 3.0.0,
prefer the more expressive as_tibble_row()
and
as_tibble_col()
variants for new code.
tibble()
constructs a tibble from individual columns. enframe()
converts a named vector to a tibble with a column of names and column of
values. Name repair is implemented using vctrs::vec_as_names()
.
m <- matrix(rnorm(50), ncol = 5) colnames(m) <- c("a", "b", "c", "d", "e") df <- as_tibble(m) as_tibble_row(c(a = 1, b = 2)) as_tibble_row(list(c = "three", d = list(4:5))) as_tibble_row(1:3, .name_repair = "unique") as_tibble_col(1:3) as_tibble_col( list(c = "three", d = list(4:5)), column_name = "data" )


--- date: 2010-01-31T00:00:00Z published: true title: The Jihadist Next Door - NYTimes.com url: /2010/01/31/the-jihadist-next-door-nytimes-com/ ---
More than 20 of those fighters have come from the United States, many of them young Somali-Americans from a gritty part of Minneapolis. But it is Hammami who has put a contemporary face on the Shabab’s medieval tactics. In a recent propaganda video viewed by thousands on YouTube, he is shown leading a platoon of gun-toting rebels as a soundtrack of jihadi rap plays in the background.
He is identified by his nom de guerre, Abu Mansoor Al-Amriki, “the American,” and speaks to the camera with a cool, almost eerie confidence. “We’re waiting for the enemy to come,” Hammami whispers, a smile crossing his face.


Properties for the DB Update component can be viewed by double clicking the component on canvas. The properties window can also be opened by right-clicking the component icon on the job canvas and clicking on the 'Properties' option.
The properties contain a 'General' tab and a 'Schema' tab. Common properties are present in the General tab. Schema tab displays the option to accept the field schema i.e. field name, data type, scale etc.
- Name - The identifier for the component. This is a mandatory property. This property is pre-populated with the component name, i.e. 'DBUpdate' followed by an incremental number. It can be changed to any custom name. The name property has following restrictions:
- Must be specified and should not be blank.
- Must be unique across the job.
- Accepts only alphabets (a-z), numerals (0-9) and 4 special characters: "_", "-", ",", " " (space)<./span>
- ID - ID signifies unique Id of component. This Id is generated at the time of component creation. This is a non editable field.
- Type - Type defines the type of component within the category. This typically is the name of the component. This is a non editable field.
- Database Name - Database Name is used to specify the name of database to be updated. User has to select database name from dropdown list provided. On selection of database name appropriate driver class name is displayed. If user selects database name as others then user have to manually specify JDBC Driver Class name. Database name is a mandatory property.
- JDBC Driver Class - JDBC Driver Class Name is used to specify the JDBC Driver Class Name. JDBC driver name is automatically generated on selection of Database name . User has to manually type the JDBC Driver Class name in the text box only if other database name is selected.JDBC Driver Class is a mandatory property.
- DB Url - DB Url is used to specify the Database Url. User has to manually type the Database Url in the text box provided. Database Url is a mandatory property.
- Table Name - Table Name is used to specify the Update table Name. User has to manually type the table name in the text box provided. Table name is a mandatory property.
- Chunk size - Chunk size is used to specify chunk size to define the chunks for DB update. User has to manually type the chunk size in the text box provided. Chunk size is optional property.
- User - User is used to specify the User name to Login to Update Database.
- Password - Password is used to specify the password.
- Update By Keys - Update By Key is used to specify the keys that would be used in "WHERE" clause while running the update. User is provided with read-only text box and a button to select the update Keys. User can not manually type update keys in text box provided.
On clicking the Select Key button, user is provided with Update Keys window to select the Keys on which Update has to be performed. Selecting Update Keys is Mandatory.
Keys selected by user are displayed in the read-only textbox on the property window.
- Batch- Batch simply accepts a numeric number starting from 0 to maximum 99 and signifies the batch this component will execute in. By default this is 0.
Schema is mandatory for DB Update component. Schema tab defines the record format on the in port of the DB Update component. A field in schema has multiple attributes as described below.
- Internal - User is provided a Grid to enter the internal schema of the Input Delimited file.
- Field Name - User needs to enter all the Field names in this column.
- Data type - The data type for the field. This is a mandatory attribute. The default data type is "String". Check supported data types page for list of supported data types.
- Date Format - The format for date data type. Refer to java date formats page for acceptable date formats.
- Precision - Precision for a bigdecimal field can be specified here.
- Scale - Scale for a bigdecimal field can be specified here.
- Scale Type - Scale Type accepts values as implicit or explicit for bigdecimal field and none for other data types. Explicit considers the length of ' . ' and implicit ignores length of ' . ' for the bigdecimal field.
- Field Description - User can specify field description.
External - User can provide an external Hydrograph Schema file of XML format. A text box is provided to either manually type or use the Browse button to select the schema file from File system. The External schema file path is resolved during run time and replaced with the contents of the file in the Job XML.
The DB Update component applies validations to the mandatory fields as described above. Upon placing the DB Update component on job canvas for the first time (from component palette), the component shows up a warning icon as mandatory properties are not provided.
The properties window also displays error icon on mandatory fields if it has an incorrect value. The error icon is displayed on the tab as well, if any of the field within the tab has some error.
If the properties window has some error even after user visit's it once, then the warning icon on the DB Update component on the job canvas changes to error icon. This error icon is removed only when all the mandatory fields are supplied with correct values.


This section of the cookbook aims to bring together a few simple guides for common tasks. The guides are not complete solutions but working examples and code you can use as a starting point in your projects.
| Example | Description |
|---|---|
| List with virtual scrolling |
Basic list with virtual scrolling based on the Angular CDK Virtual Scroller. At the moment, CDK Virtual Scroller only supports fixed sized elements. For further information see Ionic Docs and CDK Virtual Scrolling docs. Show me the code |
| Layout Recipe | Description |
|---|---|
| Single grid container |
Basic example. Everything is within a single grid container. Contains some decorational styles, but no additional layout styles. Show me the code |
| Multiple grid containers |
The same layout as the single grid container example. Created with multiple grid containers. Contains some decorational styles, but no additional layout styles. Show me the code |
| Extended example |
The same layout as the basic examples, but with additional layout styles applied, e.g., there are constructs for a max-width container and for gutter. Show me the code |
| Guide | Showcases |
|---|---|
| Setting up a base chart |
Creating charts using Kirby's configurations. To see more ways to implement charts, see the showcases |


Pair your Android with the Mini60. Make sure that something like "MINI60" is listed in the paired Bluetooth device list. If it has another name, you can change the expected name in the configuration. The expected name is case-insensitive, and only needs to start the full name. For example, "mini" will match "MINI", "MINI 60", "MINI60 AT" etc. If the device is an original SARK100, then "sark" will probably work.
When you start scanning, there will be a quick check that you have already paired with a device that has this kind of name. If it is found, a connection to that device will be attempted. If it is not found, an error message will be displayed.
You can either pick a band from the "Select" tab, or swipe the Analysis screen left or right to cycle through the preset ranges.
Double-tap on the Analysis page to start scanning. The red dot should turn to green (Connected) and/or blue (Scanning). The cyan cursor will move across the graph, showing scan progress. VSWR will be traced in red, impedance in green. If you do not see the curves, then they are off-scale. When the scan is completed, the dot will be green again. The point of minimum SWR will be indicated.
The bluetooth device name is configurable. You only need a case-insensitive prefix of the actual name, such as 'mini' or 'sark' as described above in "Pairing".
The app comes with default frequency ranges for all of the HF bands and 60 meters. You can modify and rename any or all of them if you want. Your changes will be made persistent when you hit "Save". You can always get the original settings back by pressing the "Restore" button. There will be 30 steps for each range.
That is all. The command set for the Mini60 is very small, and there is not really that much that can be accomplished with it. Hopefully this produces an informative chart from the available information. It is a simple device, and a simple app. Have fun!


CSS Sticky Notes: Class and ID Selectors
CSS is a markup language considered highly valuable in the realm of web development because of the organizational heirarchy it provides in separating all the design and formatting "skin" elements from the HTML "skeleton" of a website. In this sense, a designer can easily and efficiently navigate to different layers of a working project, to tweak structure or style accordingly and seeing how they would coexist (or clash) in a live construct of the site. CSS has it's own set of easy to follow syntax rules that allow these systematic changes, to either individual or grouped elements: two of the most invaluable CSS selector tags for doing this are the "class" tag and the "id" tag. I like to think of "class" and "id" as sticky notes reminding your computer to interpret design changes and here's why:
The "class" selector acts as a sticky note in CSS that consolidates a change/design you want across multiple elements of a certain type, and labels that change for the group to be interpreted in HTML. Often you do not want to apply the same styling rules to several selectors across your document over and over again in HTML. Rather, you can apply a "class" label to all those elements in HTML and then define the styling for that class in your CSS file that is linked to the document. Say we have some 'div' sections in HTML with several paragraph sections below them. Instead of styling each paragraph, we can assign different parent-div classes with a label (in this case, "fancy"). We can then go to our CSS file and use the syntax "." + "fancy" followed by "{ font-family: cursive; }" to apply a cursive font to all paragraphs with this class label. How easy is that?!
Sometimes we want a sticky note that tells us we have very specific styling needs for an individual element in our HTML/CSS file. In this case, we would apply the "ID" label. IDs are assigned to elements in HTML with the word "id" and an equal sign, not unlike the process for assigning a "class". The main difference in syntax comes when you are defining your ID in CSS; while you used a "." to define a class, you would use a "#" to associate your id and its attributes. As you can see in the example to the right, though we have multiple HTML paragraphs in this specific 'div' group, we associated an ID only to the first paragraph. That paragraph alone will receive the formatting we have designated in our linked CSS file.
As it should be apparent to you now, Class and ID selectors are an important aspect of the CSS workflow, intended to make your partitioned format choices organized and that much easier to find. In the event you want to overhaul your design choices, all you have to do is refer back to your CSS file and find the correct ID or Class that you used to apply the style. As we will see in the next blog post, you can get even finer control in the heirachy of organization in CSS using 'Pseudo-Class Selectors'


@sandbergja I have ruby, bundler, and yarn installed on my computer. However, as I was installing lando, when I clicked on the executable file, the Windows protection alert popped up stating it blocked the installer from running. I am not familiar with lando, but when I looked it up apparently the warning for Windows users has been popping up regarding lando for several years. Nobody seemed to have a good solution regarding how to handle it or stated if it was safe to proceed with the download. Is there a way I can work on this project without using lando? If not, I am sorry but I can't continue working on the project because I am concerned about downloading the program with that warning.
@Phil94comp -- good to know about that Windows warning, thanks for the info! An alternative would be to not run rake dss:servers:start
, and instead:
mentioned
by Jane Sandberg at 2023-07-19 18:21:15.subscribed
by Jane Sandberg at 2023-07-19 18:21:15.mentioned
by None at 2023-07-19 20:16:34.subscribed
by None at 2023-07-19 20:16:34.referenced
by Christina Chortaria at 2023-07-19 13:19:39.merged
by Christina Chortaria at 2023-07-19 13:19:39.closed
by Christina Chortaria at 2023-07-19 13:19:39.head_ref_deleted
by Christina Chortaria at 2023-07-19 13:19:40.closed
by Christina Chortaria at 2023-07-19 13:19:40.labeled
by Jane Sandberg at 2023-07-19 04:08:05.labeled
by None at 2023-07-19 18:27:21.labeled
by None at 2023-07-19 18:27:21.referenced
by Jane Sandberg at 2023-07-19 20:07:08.merged
by Jane Sandberg at 2023-07-19 20:07:08.closed
by Jane Sandberg at 2023-07-19 20:07:08.head_ref_deleted
by Jane Sandberg at 2023-07-19 20:07:09.head_ref_force_pushed
by Jane Sandberg at 2023-07-19 20:20:23.referenced
by Jane Sandberg at 2023-07-19 20:48:10.merged
by Jane Sandberg at 2023-07-19 20:48:10.closed
by Jane Sandberg at 2023-07-19 20:48:10.head_ref_deleted
by Jane Sandberg at 2023-07-19 20:48:11.closed
by Jane Sandberg at 2023-07-19 17:44:14.referenced
by Jane Sandberg at 2023-07-19 17:44:12.merged
by Jane Sandberg at 2023-07-19 17:44:13.closed
by Jane Sandberg at 2023-07-19 17:44:13.head_ref_deleted
by Jane Sandberg at 2023-07-19 17:44:14.referenced
by Jane Sandberg at 2023-07-19 18:56:42.merged
by Jane Sandberg at 2023-07-19 18:56:42.closed
by Jane Sandberg at 2023-07-19 18:56:42.head_ref_deleted
by Jane Sandberg at 2023-07-19 18:56:43.head_ref_force_pushed
by None at 2023-07-19 15:23:53.renamed
by None at 2023-07-19 15:26:38.head_ref_force_pushed
by None at 2023-07-19 20:09:09.labeled
by None at 2023-07-19 08:41:55.labeled
by None at 2023-07-19 08:41:55.labeled
by None at 2023-07-19 18:45:35.labeled
by Trey Pendragon at 2023-07-19 18:52:59.labeled
by Trey Pendragon at 2023-07-19 18:52:59.renamed
by None at 2023-07-19 18:54:01.Reopening because there is a another local fixity failure on a different volume in the MVW.
https://figgy.princeton.edu/catalog/f8532b69-8a0c-4389-be79-65e2fb0b1c83
reopened
by Eliot Jordan at 2023-07-19 19:51:55.assigned
by Shaun Ellis at 2023-07-19 19:01:57.mentioned
by Kim Leaman at 2023-07-19 19:59:15.subscribed
by Kim Leaman at 2023-07-19 19:59:15.closed
by Shaun Ellis at 2023-07-19 19:02:20.reopened
by None at 2023-07-19 20:06:31.labeled
by None at 2023-07-19 02:19:33.labeled
by None at 2023-07-19 02:19:33.renamed
by Jane Sandberg at 2023-07-19 15:28:29.labeled
by Jane Sandberg at 2023-07-19 15:45:06.


| 018:071 Khan | : |
So they both proceeded, till, when they embarked the ship, he (Khidr) scuttled it. Musa (Moses) said: "Have you scuttled it in order to drown its people? Verily, you have committed a thing "Imra" (a Munkar - evil, bad, dreadful thing)." |
| 018:071 Maulana | : |
So they set out until, when they embarked in a boat, he made a hole in it. (Moses) said: Hast thou made a hole in it to drown its occupants? Thou has surely done a grievous thing. |
| 018:071 Pickthal | : |
So they twain set out till, when they were in the ship, he made a hole therein. (Moses) said: Hast thou made a hole therein to drown the folk thereof? Thou verily hast done a dreadful thing. |
| 018:071 Rashad | : |
So they went. When they boarded a ship, he bore a hole in it. He said, "Did you bore a hole in it to drown its people? You have committed something terrible." |
| 018:071 Sarwar | : |
They started their journey and some time latter they embarked in a boat in which he made a hole. Moses asked him, "Did you make the hole to drown the people on board? This is certainly very strange". |
| 018:071 Shakir | : |
So they went (their way) until when they embarked in the boat he made a hole in it. (Musa) said: Have you made a hole in it to drown its inmates? Certainly you have done a grievous thing. |
| 018:071 Sherali | : |
So they both set out till, when they embarked in a boat, he made a hole in it. Moses said, 'Hast thou made a hole in it to drown those who are in it? Surely, thou hast done a grievous thing.' |
| 018:071 Yusufali | : |
So they both proceeded: until, when they were in the boat, he scuttled it. Said Moses: "Hast thou scuttled it in order to drown those in it? Truly a strange thing hast thou done!" |
Concepts/Themes Covered:
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


美国之音 > Voa English Learning > Go English
VOA Standard English
- VOA Standard English
- VOA Standard English Archives
VOA Special English
- Development Report
- This is America
- Agriculture Report
- Science in the News
- Health Report
- Explorations
- Education Report
- The Making of a Nation
- Economics Report
- American Mosaic
- In the News
- American Stories
- Words And Their Stories
- People in America
VOA English Learning
- Wordmaster
- Learn A Word
- Bilingual News
- American Cafe
- Popular American
- Business Etiquette
- Sports English
- Words And Idioms
- Intermediate American Enlish
VOA英语教学VOA英语教学《美语三级跳 Go English》最近更新
© 2001-2009 Powered by 51VOA.Com