Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
??? Subscripted assignment dimension mismatch.

Subject: ??? Subscripted assignment dimension mismatch.

From: X_man Davtyan

Date: 10 Apr, 2010 14:43:05

Message: 1 of 2

hello,
I want to solve this equation but i have some problemes
1. how can i use the information that x is a fonction of t and x is derive bt t, and that x(0)=1 ?

t = 0: 0.1 : 100;
a=5;
b=5;
diff(x,2)=(2*a)*x/sqrt(4*x^2+1)-b*diff(x);

can someone help me?

Thanke you

Subject: ??? Subscripted assignment dimension mismatch.

From: Steven Lord

Date: 13 Apr, 2010 17:29:49

Message: 2 of 2


"X_man Davtyan" <hrayr5@hotmail.com> wrote in message
news:hpq2pp$fdg$1@fred.mathworks.com...
> hello,
> I want to solve this equation but i have some problemes
> 1. how can i use the information that x is a fonction of t and x is derive
> bt t, and that x(0)=1 ?
>
> t = 0: 0.1 : 100;
> a=5;
> b=5;
> diff(x,2)=(2*a)*x/sqrt(4*x^2+1)-b*diff(x);

Written a slightly different way:

d^2x/dt^2 = (2*a)*x/sqrt(4*x^2+1)-b*dx/dt

> can someone help me?

You can either solve this system numerically using ODE45 by rewriting this
2nd order ODE into a system of two 1st order ODEs (in which case you will
also need to know the value of dx/dt at t = 0)

http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-662913.html#brfharp-1

or you could solve it symbolically using DSOLVE in Symbolic Math Toolbox
(which given the information above will return a solution involving one
arbitrary constant if it can solve the ODE.)

http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/dsolve.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us