contact_petersen

32 Reputation

2 Badges

15 years, 123 days

MaplePrimes Activity


These are answers submitted by contact_petersen

Thank you, that worked exapmle really did help. 

I am now able to get a funcion returned and plot it however it is nowhere near the data. It actually finishes before the data starts. Do you think you could have a look over what I am doing wrong. Im sure its something obvious but I can't see it.

The function that I want to fit is of the form : F/sqrt(m^2*(omega^2-omega_0^2)^2+b^2*omega^2

So what i have done is:

 

data := [[500, 1.832], [575, 1.818], [650, 1.936], [725, 2.007], [800, 2.379], [875, 2.546], [950, 3.032], [1025, 3.685], [1100, 4.554], [1175, 5.473], [1250, 5.509], [1325, 4.573], [1400, 3.372], [1475, 2.630], [1550, 2.078], [1625, 1.704], [1700, 1.401], [1775, 1.199], [1850, 1.031], [1925, .9514]]

F := 'F'; m := 'm'; omega_0 := 'omega_0'; b := 'b'

func := F/sqrt(m^2*(omega^2-omega_0^2)^2+b^2*omega^2);

residues := map( (d) --> eval(func, 'omega'=d[1]) - d[2] , data)

sol := LSSolve(residues)

omega := 'omega'; curve := eval(func, sol[2])

 

However the the curve produced is a resonance curve but no where near the data, do i need to set initalpoints to get a fit??

I thought LSSolve wouldn't be the best way to do it, but unfortunatly I do actually have to use LSSolve, if I'm honest I don't really understand what to input, I've read all the help files but gat an error something like;

 

LSSolve expected residuals, or something along those lines.

 

Can anyone shed some light on what I should be doing.

The seq command you suggested is a better way of displaying the data, so thanks.

However i still cant figure out how to draw a graph of n(t) vs t. What commands should i be using

Page 1 of 1