Question: As tor the previous question, create a function that cakculates the Gutenberg.Richter values (a and b). The inputs will be earthquake megnitude (M) and the

As tor the previous question, create a function that cakculates the Gutenberg.Richter values (a and b). The inputs will be earthquake megnitude (M) and the annual cumilative number (N) of events (less than or equal to that magnitude). In this case you must calculate the a- and b-values using a matrix imersion as detailed befow. Eg.: M=[1234567];N=[1000010001001010.10.01] The Gutenberg-Pichter equation is: log10(N)=abN This can be written as: d=Gm where d is a vector of log(N),m=[a,b] and G is an hperator matrix. You can calculate m using linear algebra: Gid=GYG i (where 'indicates the transpose): Now detine GIG=GG and Gid=Gid: m=Gid(GG)A1 A.t indicates the inverse. You function should retarn a, b, Gid, Gid. Do not modify the first function line: Now define GtGaGiG and G:d-Gu: *-1 and cates the inperse. You farction shoeld relum a, b, Ged, cind. Do not modily the fess tuncbion linal Function 1. fenction {a,b, Gtb, Gtd =gr(M2N) * a is the a-vatue of the Gutenberg-Aicher tarthquake magnitude-freguency equation y is the b-vatue of the Gutenberg-Aticher earthquake aagnitude-frequency nguatian 4. H is a vector of ingut seismic nagnitude 4i is a vector of the cualative number of events at this nagnitude - 5 tg and Gtd are the output square matrices used for the calculation. - Your code... end. Codo to call your function (a,b,GtG,Gtd)=gr(N,N) As tor the previous question, create a function that cakculates the Gutenberg.Richter values (a and b). The inputs will be earthquake megnitude (M) and the annual cumilative number (N) of events (less than or equal to that magnitude). In this case you must calculate the a- and b-values using a matrix imersion as detailed befow. Eg.: M=[1234567];N=[1000010001001010.10.01] The Gutenberg-Pichter equation is: log10(N)=abN This can be written as: d=Gm where d is a vector of log(N),m=[a,b] and G is an hperator matrix. You can calculate m using linear algebra: Gid=GYG i (where 'indicates the transpose): Now detine GIG=GG and Gid=Gid: m=Gid(GG)A1 A.t indicates the inverse. You function should retarn a, b, Gid, Gid. Do not modify the first function line: Now define GtGaGiG and G:d-Gu: *-1 and cates the inperse. You farction shoeld relum a, b, Ged, cind. Do not modily the fess tuncbion linal Function 1. fenction {a,b, Gtb, Gtd =gr(M2N) * a is the a-vatue of the Gutenberg-Aicher tarthquake magnitude-freguency equation y is the b-vatue of the Gutenberg-Aticher earthquake aagnitude-frequency nguatian 4. H is a vector of ingut seismic nagnitude 4i is a vector of the cualative number of events at this nagnitude - 5 tg and Gtd are the output square matrices used for the calculation. - Your code... end. Codo to call your function (a,b,GtG,Gtd)=gr(N,N)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
