Question: Check - function for testing the linearity of ODEs Step 7 Write a m - file function name y = CheckLinearity ( odes , var

Check-function for testing the linearity of ODEs
Step 7 Write a m-file function name y= CheckLinearity (odes, var) that check the linearity of a given symbolic ODEs, where
odes is the given symbolic expression.
var is the symbolic expression for the function of the given odes
y is boolean: true if ode is linear.
For example,
.
syms x
D 2x=Diff(x,1);
CheckLinearity (D2x+x,xStep 8 Use the technique that you learned in the class: substitute all the x and its derivatives with a dummy variable s (use the matlab build-in function subs). As a result, you obtain an expression like f(s).
Step 9 Check if the final expression f(s) is linear respect to s. This can be done by taking the first derivative of the expression with respect to s and check if the resultant has any s.
Hint: you should use the matlab built-in function has for the last step.
Step 10 Write a test script, name it testCheckLinearity, m that check the output of the function as the above test script.
 Check-function for testing the linearity of ODEs Step 7 Write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!