Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Check - function for testing the linearity of ODEs Step 7 Write a m - file function name y = CheckLinearity ( odes , var
Checkfunction for testing the linearity of ODEs
Step Write a file function name 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
is boolean: true if ode is linear.
For example,
syms
D Diff;
CheckLinearity DxStep Use the technique that you learned in the class: substitute all the x and its derivatives with a dummy variable s use the matlab buildin function subs As a result, you obtain an expression like fs
Step Check if the final expression is linear respect to This can be done by taking the first derivative of the expression with respect to and check if the resultant has any
Hint: you should use the matlab builtin function has for the last step.
Step Write a test script, name it testCheckLinearity, m that check the output of the function as the above test script.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started